News:

AbanteCart v1.4.2 is released.

Main Menu

Add 8.5% Sales Tax for Cash Transactions?

Started by masalachai, July 21, 2018, 01:27:32 AM

Previous topic - Next topic

masalachai

Using AbanteCart as POS for live events. Need to be able to add 8.5% sales tax for guest/cash transactions (no login, no address).  Anybody know how?

Thanks!

llegrand

here's the manual directions
https://abantecart.atlassian.net/wiki/spaces/AD/pages/15761420/Tax+Rates


simple instructions are:
In your admin panel  go to system > localization > Tax classes
Click on the edit icon on the taxable goods line, select the Rates tab
set your tax rate
products need to be set to taxable

masalachai

#2
Thanks very much for the reply! Unfortunately, the tax is not carrying over to checkout/guest_step_3 page but is reverting to the non-tax price. Since we are only using AbanteCart for live cash transactions, what page/line would I modify to hard code the 8.5%?

Sub-Total:    $8.15
Sales Tax:    $0.66
Total:    $8.81

==
Thanks again!

llegrand

Assuming you are providing the device for the transactions  you might try this for a solution:


make an account for something like this Guest - the Springfield Music Fest  (whatever the event is)
use the event address,  for the correct tax calculation.


that should set that account to the correct zip code for the tax lookup for the event location
no further selection necessary


just process the cash sale, then leave account signed in for the next transaction.


This should do two thing for you,  process with the correct tax,  and give you a complete recap for the show by looking at the customer activity for the event account customer









masalachai

#4
Thanks! I just figured out where the problem is - it's the drop down choose State.  If I don't choose California, then tax doesn't carry through.  Would prefer to have California selected by default (just like United States is for the Country field).  Do you know what file the states are coming from or how to hard code that in guest_step_1.tpl [storefront/view/default/template/pages/checkout]
Thanks again for all your help with this!

llegrand

you control the dropdown  here


system>Localization > Locations 


you probably only see USA in your location name
click on the edit on the right end of that location
click on location zones  and only select the one you want


by deleting all the ones you don't want






masalachai

#6
hmmm... I selected California, same as before - still have to choose from drop down

masalachai

Not sure I'm even editing the right page anymore... I *thought* it was guest_step_1.tpl, but no matter what I do it still shows all the shipping fields - even after I delete them!
What file is index.php?rt=checkout/guest_step_1 calling from??

llegrand

did you follow my instructions to edit via admin panel?


altering the code,  is inadvisable for most folks.   
when new version comes out you often need to make the same changes.  But if you use the settings via admin panel  they will remain in place thru version updates


the instructions gave last time control the dropdown than shows up on checkout.




masalachai

#9
Thanks Lee - did you try selecting California?  I did several times (as well as cleared server cache and whatever else I could think of), didn't make a difference.
Still getting "--- Please Select ---" (see second screenshot)

For our purposes, we only need three fields in the form: First Name, Last Name, Email (see first screenshot). Until the sales tax biz came along, form worked great (I simply hid the other fields using CSS and the form passed all the way through to checkout, no problem). Now that we need sales tax (which is governed by the Region / State field), I need to somehow not be prompted by the State dropdown.  I know now that it's the guest_step_1.php page that needs to be modified (guest_step_1.tpl is part of it), so will keep tinkering until I figure it out.

masalachai

#10
Got it!
[guest_step_1.tpl]

<h1 class="heading1">
  <span class="maintext"><?php echo $heading_title; ?></span>
  <span class="subtext"></span>
</h1>

<?php if ($success) { ?>
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo $success; ?>
</div>
<?php } ?>

<?php if ($error_warning) { ?>
<div class="alert alert-error alert-danger">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo $error_warning; ?>
</div>
<?php } ?>

<div class="contentpanel">
   <?php echo $form['form_open']; ?>

   <h4 class="heading4"><?php echo $text_your_details; ?></h4>
   <div class="registerbox form-horizontal">
      <fieldset>
               <div class="form-group ">
            <label class="control-label col-md-4">First Name:</label>
            <div class="input-group col-md-6">
                <input type="text" name="firstname" id="guestFrm_firstname" value="" placeholder="" class="form-control "   />
<span class="input-group-addon"><span class="required">*</span></span>
            </div>
            <span class="help-block"></span>
         </div>      
               <div class="form-group ">
            <label class="control-label col-md-4">Last Name:</label>
            <div class="input-group col-md-6">
                <input type="text" name="lastname" id="guestFrm_lastname" value="" placeholder="" class="form-control "   />
<span class="input-group-addon"><span class="required">*</span></span>
            </div>
            <span class="help-block"></span>
         </div>      
               <div class="form-group ">
            <label class="control-label col-md-4">E-Mail:</label>
            <div class="input-group col-md-6">
                <input type="text" name="email" id="guestFrm_email" autocorrect="off" autocapitalize="off" value="" placeholder="" class="form-control "   />
<span class="input-group-addon"><span class="required">*</span></span>
            </div>
            <span class="help-block"></span>
         </div>
         <div class="hide">      
         <div class="form-group ">
            <label class="control-label col-md-4">State</label>
            <div class="input-group col-md-6">
                <input type="text" name="zone_id" id="guestFrm_zone_id" value="3624" placeholder="" class="form-control "   />
<span class="input-group-addon"><span class="required">*</span></span>
            </div>
            <span class="help-block"></span>
         </div>      
         <div class="form-group ">
            <label class="control-label col-md-4">Country</label>
            <div class="input-group col-md-6">
                <input type="text" name="country_id" id="guestFrm_country_id" value="223" placeholder="" class="form-control "   />
<span class="input-group-addon"><span class="required">*</span></span>
            </div>
            <span class="help-block"></span>
         </div>
         </div>      
            </fieldset>
   </div>   
<div class="hide">
   <h4 class="heading4"><?php echo $text_your_address; ?></h4>
   <div class="registerbox form-horizontal">
      <fieldset>
      <?php
         $field_list = array('company' => 'company',
                        'address_1' => 'address_1',
                        'address_2' => 'address_2',
                        'city' => 'city',
                        'zone' => 'zone_id',
                        'postcode' => 'postcode',
                        'country' => 'country_id',
                        );
         
         foreach ($form['fields']['address'] as $field_name=>$field) {?>
         <div class="form-group <?php if (${'error_'.$field_name}) echo 'has-error'; ?>">
            <label class="control-label col-md-4"><?php echo ${'entry_'.$field_name}; ?></label>
            <div class="input-group col-md-6">
                <?php echo $field; ?>
            </div>
            <span class="help-block"><?php echo ${'error_'.$field_name}; ?></span>
         </div>      
      <?php }
         echo $this->getHookVar('address_entry_section'); ?>

         <div class="form-group">
            <label class="control-label col-md-4"></label>
            <div class="input-group col-md-6">
                <?php echo $form['shipping_indicator']; ?>
            </div>
         </div>      
      </fieldset>
   </div>
         
   <!-- start shipping address -->
   <div id="shipping_details" style="<?php echo ($shipping_addr) ? 'display:block;' : 'display:none;' ?>">
   <h4 class="heading4"><?php echo $text_shipping_address; ?></h4>
      <div class="registerbox form-horizontal">
      <fieldset>
      <?php
         $field_list = array('firstname' => 'shipping_firstname',
                        'lastname' => 'shipping_lastname',
                        'company' => 'shipping_company',
                        'address_1' => 'shipping_address_1',
                        'address_2' => 'shipping_address_2',
                        'city' => 'shipping_city',
                        'zone' => 'shipping_zone',
                        'postcode' => 'shipping_postcode',
                        'country' => 'shipping_country',
                        );
         
         foreach ($form['fields']['shipping'] as $field_name=>$field) {
      ?>
         <div class="form-group <?php if (${'error_'.$field_id}) echo 'has-error'; ?>">
            <label class="control-label col-md-4"><?php echo ${'entry_'.$field_name}; ?></label>
            <div class="input-group col-md-6">
               <?php
                     echo $field;
                  ?>
            </div>
            <span class="help-block"><?php echo ${'error_'.$field_id}; ?></span>
         </div>      
      <?php
         }
      ?>   
      </fieldset>
      </div>     
   </div>
   <!-- end shipping address -->     
      </div>
   <div class="form-group">
       <div class="col-md-12 mt20">
          <button class="btn btn-orange pull-right lock-on-click" title="<?php echo $form['continue']->name ?>" type="submit">
              <i class="fa fa-arrow-right"></i>
              <?php echo $form['continue']->name ?>
          </button>
          <a href="<?php echo $back; ?>" class="btn btn-default mr10" title="<?php echo $form['back']->text ?>">
              <i class="fa fa-arrow-left"></i>
              <?php echo $form['back']->text ?>
          </a>
       </div>
   </div>
   </form>
</div>

<script type="text/javascript">

$('#guestFrm_shipping_indicator').change( function(){
   (this.checked) ? $('#shipping_details').show() : $('#shipping_details').hide();
});
<?php $cz_url = $this->html->getURL('common/zone', '&zone_id='. $zone_id); ?>
$('#guestFrm_country_id').change(function() {
    $('select[name=\'zone_id\']').load('<?php echo $cz_url;?>&country_id=' + $(this).val());
});
$('select[name=\'zone_id\']').load('<?php echo $cz_url;?>&country_id='+$('#guestFrm_country_id').val());

<?php $cz_url = $this->html->getURL('common/zone', '&zone_id='. $shipping_zone_id); ?>
$('#guestFrm_shipping_country_id').change(function() {
   $('select[name=\'shipping_zone_id\']').load('<?php echo $cz_url;?>&country_id=' + $(this).val());
});
$('select[name=\'shipping_zone_id\']').load('<?php echo $cz_url;?>&country_id='+$('#guestFrm_shipping_country_id').val());

</script>

llegrand

sorry for disappearing  was traveling had limited time for internet.   Glad you solved your issue. 
Don't forget if you upgrade versions  your fix may need to be re done.


Cheers
Lee

masalachai

#12
Thanks Lee. The drop down for Zone and the drop down for Country are for some reason coded differently. For the Country drop down the countries are all piped in to guest_step_1.php and can be seen using view source in the browser.  That's not the case for Zone. Not sure how or where all the zones are coming from (I know they're in MySQL and I suspect it's one of the JavaScript files that is populating guest_step_1.php via "--- Please Select ---"), but as far as the rendered HTML is concerned, it's missing the "selected" attribute and I couldn't see any other way but to hard code the fix. Also, as far as upgrading goes, at this point our AbanteCart is heavily modified and doing what we need it to do.  Unless there's an immediate security issue or other incompatibility I tend not to upgrade my modified web apps, often for many years. I know that's not the norm, but if an app is working, why spend time rebuilding the thing over and over just because there's an update?

Thanks again!

Forum Rules Code of conduct
AbanteCart.com 2010 -