♥raiwa 1,419 Posted September 29, 2015 (edited) Display tax info Version 3.0 by @raiwa Download: http://addons.oscommerce.com/info/9365**********************************************************************Based on:Version 2.3 for oscommerce-2.3.x:http://addons.oscommerce.com/info/8160Original version:By www.tim-international.nethttp://addons.oscommerce.com/info/6725And:Tax info 1.6http://addons.oscommerce.com/info/2788**********************************************************************Complete new modularized version.All Configuration entries, language definitions, currency class extension and styleshhets included in one store module.Copy the modules and language files and install the module.That's all.What does this version do:It will display the following below the price on each page included in the module:1. If the tax value of the displayed price is = 0: Shows: "VAT excl." or any other text you define in the language file2. If the tax value of the displayed price is not = 0: Shows: "XX% VAT incl." or any other text you define in the language file Where XX is the value of the tax in percentage as defined in admin/tax rates Note: For other languages/uses its possible to define a text string before the tax rate and another after the tax rate: Example: for german it will look like this: "inkl. XX % MwSt." Page selection where to use the module Optional parameter added to display_price function which allows to switch off the tax information. Edited September 29, 2015 by raiwa About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
pmsmiers 0 Posted October 4, 2015 Dear Rainer , First I like to say, installing was a breeze easy and this add-on works and looks great. I have one problem when I enable this add on for the : product_info.php page, I get the following at the top left side of this page : Incl. 21% BTW">Incl. 21% BTW" /> (I'm dutch) When I check the element inspector (Goofle Chrome) the first line is inserted just before the first meta tags and the second one somewhere between the las meta tags. Can you help ? Share this post Link to post Share on other sites
♥raiwa 1,419 Posted October 4, 2015 Hello @@pmsmiers, It seems you have a header tag module which uses the "display_price" function on the product_info page. You should localize the header tag module by switching off step by step the header tag modules and then once you know which one, search in it for the "display_price" function. Apply then the modification like explained at the end of the installation instructions under "Optional": Add "false" as the sixth parameter of the "display_price" function. Regards Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
pmsmiers 0 Posted October 4, 2015 Hello @@pmsmiers, It seems you have a header tag module which uses the "display_price" function on the product_info page. You should localize the header tag module by switching off step by step the header tag modules and then once you know which one, search in it for the "display_price" function. Apply then the modification like explained at the end of the installation instructions under "Optional": Add "false" as the sixth parameter of the "display_price" function. Regards Rainer Yes, found it in : header_tags_opengraph.php and works great. Thanks man for this fast reaction. Regards, Peter Share this post Link to post Share on other sites
♥raiwa 1,419 Posted October 4, 2015 Hello Peter @@pmsmiers, Thanks for the report. I'll include a fix for this in the next update. regards Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
baulie38 2 Posted December 11, 2015 Hi guysDoes anyone know why I cant see the tax info on the reviews page (product_reviews.php)? i use edge Share this post Link to post Share on other sites
♥raiwa 1,419 Posted December 12, 2015 Hello Tim @@baulie38, Please check if you have product_reviews.php activated in the page list. (Admin => Modules => Store => Tax below price => Pages) About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
baulie38 2 Posted December 13, 2015 hi @@raiwa yes its activated. i've tested in edge and gold. both the same, no tax on reviews page. Share this post Link to post Share on other sites
♥raiwa 1,419 Posted December 15, 2015 Hello Tim @@baulie38, I had a deeper look on this and found the bug. It happens also on product_reviews_write.php.The st_tax_below_price.php module is loaded in template_top.php which loads in these 2 pages below the product price definition. So the currencies class modification is not yet loaded and doesn't modify the product price.To fix it, please move this line (line 45 in product_reviews.php, line 75 in product_reviews_write.php): require(DIR_WS_INCLUDES . 'template_top.php'); Up before the product price definition (line 29 in product_reviews.php, line 64 in product_reviews_write.php): if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } So it should look like this (begins with line 29 in product_reviews.php and line 64 in product_reviews_write.php): require(DIR_WS_INCLUDES . 'template_top.php'); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } Please confirm and I'll include these instructions to the add-on. Thank you and kind regards Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
baulie38 2 Posted December 17, 2015 @@raiwa thanks it works fine :) 1 raiwa reacted to this Share this post Link to post Share on other sites
Pelvis 2 Posted August 10, 2016 What's Happening her With 19% Tax in Germany for a Product that Cost 5.00 EURO Net Price When in Configuration Display Prices with Tax "False" everything is fine I see 5.00 EURO. But when I Turn Display Prices with Tax "True" I see the amount of 16,28. It has nothing to do with the Modul when I Turn the Module off I see the same wrong number 16.28 I post it her because of the strange Tax amount under the price see the attached Pictures. https://www.dropbox.com/s/xrnfyxd6iu75zfl/Display%20Prices%20with%20Tax19%25_True.jpg?dl=0 https://www.dropbox.com/s/pu776n1q0r9hjn8/Display%20Prices%20with%20Tax19%25_False.jpg?dl=0 Share this post Link to post Share on other sites
Pelvis 2 Posted August 10, 2016 What's Happening her With 19% Tax in Germany for a Product that Cost 5.00 EURO Net Price When in Configuration Display Prices with Tax "False" everything is fine I see 5.00 EURO. But when I Turn Display Prices with Tax "True" I see the amount of 16,28. It has nothing to do with the Modul when I Turn the Module off I see the same wrong number 16.28 I post it her because of the strange Tax amount under the price see the attached Pictures. https://www.dropbox.com/s/xrnfyxd6iu75zfl/Display%20Prices%20with%20Tax19%25_True.jpg?dl=0 https://www.dropbox.com/s/pu776n1q0r9hjn8/Display%20Prices%20with%20Tax19%25_False.jpg?dl=0 I found the error In the data base at the Table "zones_to_geo_zones" the "zone_id" of the default zone must set to "0" it was set to "1" that "1" was giving the wrong tax calculation. If someone has the same problem the solution is set in the Table "zones_to_geo_zones" the "zone_id" to "0" Share this post Link to post Share on other sites
Pelvis 2 Posted August 10, 2016 Maybe this time I am more Lucky and somebody will help I want to display the Product Price Like this: (in the middle the calculated Tax amount) Preis: 5,00€ +19%MwSt.: 0,95€ Total: 5,95€ I Have done This (In Germany the vat is19%) and it displays the vat also the 19 Preis: 5,00€ +19%MwSt.: 19,00€ Total: 5,95€ Here is the Code: ----------- function display_price($products_price, $products_tax, $quantity = 1, $show_tax_info = true) { if(DISPLAY_PRICES_NET_GROSS == 'true' && DISPLAY_PRICE_WITH_TAX == 'true' && $products_price > 0){ return '' . $this->format($products_price * $quantity . '<br /><small>', true, null, null, $products_tax, $show_tax_info) . $this->format($products_tax) . '<br />' . $this->format($this->calculate_price($products_price, $products_tax, $quantity)) . '</small>'; } else{ return $this->format($this->calculate_price($products_price, $products_tax, $quantity)); } } ----------- I don't know how to fix this part: . $this->format($products_tax) Would be happy if somebody could help Share this post Link to post Share on other sites
Pelvis 2 Posted November 16, 2016 I installed the Version 3.4 and Become the following Error (in Version 3.3 everything was o.k.) Warning: include(includes/languages/english/modules/cfg_modules/st_tax_below_price.php) [function.include]: failed to open stream: No such file or directory in /users/folder/www/catalog/admin/includes/classes/cfg_modules.php on line 28Warning: include() [function.include]: Failed opening 'includes/languages/english/modules/cfg_modules/st_tax_below_price.php' for inclusion (include_path='.') in /users/folder/www/catalog/admin/includes/classes/cfg_modules.php on line 28 Fatal error: Class 'st_tax_below_price' not found in /users/folder/www/catalog/admin/includes/classes/cfg_modules.php on line 31 P.S. The Verson is OSC Edge the Newest with Depricaded names-paths ... Share this post Link to post Share on other sites
♥Dan Cole 546 Posted November 16, 2016 @@Pelvis Did you install the compatibility module? http://addons.oscommerce.com/info/9506 Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Share this post Link to post Share on other sites
Pelvis 2 Posted November 16, 2016 (edited) Yes I Have Installed that before? Edited November 16, 2016 by Pelvis Share this post Link to post Share on other sites
Pelvis 2 Posted November 16, 2016 Thanks! Solved was my mistake Confusing folders and I put a file that had to come to the "front/modules" folder in "admin/modules" folder to. I had inside the folder /catalog/admin/includes/modules/cfg_modules/ 2 files 1. st_tax_below_price.php (this is only needed in "front/modules" folder and was causing the error) 2. cfgm_store.php Thanks ! 1 raiwa reacted to this Share this post Link to post Share on other sites
felix-swiss 20 Posted March 17, 2017 Hello Rainer Thank you for this simple contribution! I did not wanted to install the way to big German Market add-on (as for the moment Switzerland fortunately is not requesting these EU stuff...) - so I tired yours and it is working perfectly. In my old store (2.2 MS) I had as well an additional link to the shipping page included. I tried a bit around and found that the coding is quite simple. So I cam up with this solution: Starting at line 218 I added--> tep_href_ link('shipping.php') $format_string .= sprintf(MODULE_STORE_TAX_BELOW_PRICE_INCLUDING_TAX_AMOUNT, $products_tax, tep_href_link('shipping.php'), null); } else { $format_string .= sprintf(MODULE_STORE_TAX_BELOW_PRICE_INCLUDING_TAX_TEXTONLY, tep_href_link('shipping.php')); and in the language file I added <a href="%s">shipping</a> define('MODULE_STORE_TAX_BELOW_PRICE_INCLUDING_TAX_TEXTONLY', 'VAT incl. + <a href="%s">shipping</a>');/***!--- Put here the text to display when Display tax amount? = false--***/ define('MODULE_STORE_TAX_BELOW_PRICE_INCLUDING_TAX_AMOUNT', '%s%% VAT incl. + <a href="%s">shipping</a>');/***!--- Put here the text to display when Display tax amount? = true--***/ So I ended up with a clickable link which leads to the shipping & returns page. Maybe there would even be an easier way, but I am just a beginner :-) Regards - Felix Whoever finds errors and misspellings in my postings can keep them o:) Moving from 2.2 MS to 2.3.4 BS EDGE - and I love this version! I might show "online" all the time - but I might be away from my computer ;) Share this post Link to post Share on other sites
rubberfashion 1 Posted June 15, 2017 (edited) On 4.10.2015 at 11:39 AM, raiwa said: Hello Peter @@pmsmiers, Thanks for the report. I'll include a fix for this in the next update. regards Rainer Hi Rainer, great contribution! problem exists anymore. ( I have one problem when I enable this add on for the : product_info.php page, I get the following at the top left side of this page : Incl. 21% BTW"> Incl. 21% BTW" /> ) After deactivating the open_graph in SEO Header Tag V3.3.5 the problem is solved. Kind Regards David Edited June 15, 2017 by rubberfashion Share this post Link to post Share on other sites
♥raiwa 1,419 Posted June 15, 2017 (edited) Hello David @rubberfashion, It seems the SEO Header Tag still uses the "display_price" function to format and show the price. Display Tax Info modifies this function to add the tax info. Another function, "display_raw" has been introduced in 2.3.4 BS EDGE and should be used for all SEO Tags. Please find in your SEO Header Tag the "display_price" function and replace it by ""display_raw". This should solve the problem. Another possibility is to supress the Tax Info addition by adding an additional parameter to the "display_price" function. This is explained in the Display Tax Info Instructions under "OPTIONAL". rgds Rainer Edited June 15, 2017 by raiwa About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
rubberfashion 1 Posted June 15, 2017 Thank you Rainer @raiwa :) Share this post Link to post Share on other sites
mcmannehan 21 Posted June 15, 2017 @raiwa Very great work...!!!!!!!!!!!!!!! The clever one learn from everything and from everybody The normal one learn from his experience The silly one knows everything better [socrates, 412 before Christ] Computers help us with the problems we wouldn't have without them! 99.9% of the bugs sit in front of the computer! My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0 if(isset($this) || !isset($this)){ // that's the question... Share this post Link to post Share on other sites
ce7 8 Posted September 30, 2018 @raiwahi Thanks for the addon. I have tried to copy this addon code to show the % of the tax rate, this is the catalog/includes/languages/english.php define('GST_TEXT', '('. (tep_get_tax_rate($product_info['tax_rate'])).' % GST Incl.)'); Instead of showing the correct 10% tax, it show 0. How can I fix this problem? Many thanks! Lyn Share this post Link to post Share on other sites
♥raiwa 1,419 Posted September 30, 2018 (edited) For the product listing you'll need to use: tep_get_tax_rate($listing['products_tax_class_id']) But I wouldn't include the function in the language file. use %s and sprintf( to format the output. Edited September 30, 2018 by raiwa 1 ce7 reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥raiwa 1,419 Posted October 1, 2018 Hello Lyn @ce7, I had a deeper look now and I believe you can do this easier. If your problem is that with the header tag of the add-on you get the tax rate shown twice - once below the prices with tax and again below the prices without tax you should do the following: In the core currency class duplicate and rename the "display_price" and "format" functions to something like "format_no_tax" and "display_price_no_tax". Be aware to change also the function name used in the "display_price_no_tax" function from "format" to "format_no_tax". Then use the function "display_price_no_tax" to show the prices without tax in the product listing modules and elsewhere. 1 ce7 reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites