Forums / Currencies & Sales Taxes, VAT, GST, etc. / Speicals and Sales Tax Not Included

Speicals and Sales Tax Not Included

Views: 3,824

Results 21 to 22 of 22
7 Jul 2015, 4:02 AM
#21
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Speicals and Sales Tax Not Included

lruskauff:

I thought I remembered seeing that the ZC version of the function has a large SQL statement to factor for all tax types, the session information, etc... And that (the SQL execute result) needs to be set to the variable $product_check

[/quote]
To me, it looks like his function, pt_get_discount_amount, was taken from the middle of Zencarts zen_get_products_display_price. And that has the following before the code:

   $product_check = $db->Execute("select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call, products_type from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");

    // no prices on Document General
    if ($product_check->fields['products_type'] == 3) {
      return '';
    }

So if this function only needs the tax class id, it could be shortened to:

 $product_check = $db->Execute("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");

I'm still looking for the SQL version you mentioned above but it really depends on whether I am guessing correctly as to what this function should do. So maybe the best advice would be is to chose a new template?[/QUOTE]

Yup the second one should do, my confusion earlier was from looking at. Closely similar query in the function_taxes.php file. That was where tax groups or something were added and then given a name. Anyways, with the above query executed inside that function the display of differences between two prices should now come out correctly in this modified template that was developed by someone currently unavailable for what may be personal reasons...

Hopefully can feedback that information so the next poor soul doesn't have to get it fixed either.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

12 Jul 2015, 6:15 AM
#22
mortalwombat avatar

mortalwombat

Zen Follower

Join Date:
Jul 2010
Location:
Australia
Posts:
131
Plugin Contributions:
0

Re: Speicals and Sales Tax Not Included

I'm very sorry to have left you in the lurch all week. I injured myself and was unable to access a computer, BUT...
Thank you SO much, guys! That snippet of code has included the tax on the specials tags (I have included a screenshot as evidence :D)