Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

edwardames

Archived
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • Real Name
    Edward Ames

edwardames's Achievements

  1. I had been having a problem with getting registry purchases to charge sales tax correctly. Tax was being calculated on registry pruchases based on the default address of the purchaser, and not based on the delivery address of the recipient, like it needs to be for my purposes. My State Comptroller's office is not very pleasant about such issues. I fixed the problem by changing order.php under /catalog/includes/classes/. By default order.php appears to set sales tax around line 147 like so: $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'"); $tax_address = tep_db_fetch_array($tax_address_query); I fixed my gift registry sales tax problem by replacing those lines with the following if-else code:. if($cart->registry_customers_id > '0'){ $tax_address['entry_zone_id']=$shipping_address['entry_zone_id']; $tax_address['entry_country_id']=$shipping_address['entry_country_id']; }else{ $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'"); $tax_address = tep_db_fetch_array($tax_address_query); } It might more neatly be fixed by doing stuff to $sendto in checkout_shipping.php, but the above change was easier for me with all the changes I have made to my own checkout_shipping file. If there's a better way, do tell. Edward
×
×
  • Create New...