Originally Posted by
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:
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:
Code:
$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.
Bookmarks