Skip to main content

Tips & Tricks: snippet to display tax_rate on products view // v4.x

More
7 years 8 months ago - 7 years 8 months ago #303510 by n00bster
-- HikaShop version -- : 4.0.2

I do not found such a category or place to post it. i find a section with sample codes for the v4.x could be cool.
maybe someone have a use for it.

a snippet for the product view to show the TAX_RATE (listing_price.php):
Code:
// modification START // var_dump($this->element->prices[0]->taxes); if(!empty($this->element->product_id)) { $myProductTaxRate = reset($this->element->prices[0]->taxes)->tax_rate * 100; echo '<span class="enter-a-class-to-style-it">'; echo 'incl. ' . $myProductTaxRate . '% TAX'; echo '</span>'; } // modification END


and to show the TAX_RATE on the checkout at total price per article (checkout/listing_price.php):
Code:
// modification START if(empty($this->unit)) { $myTaxRate = reset($price->taxes)->tax_rate * 100; echo '<span class="enter-a-class-to-style-it">'; echo 'incl. ' . $myTaxRate . '% TAX'; echo '</span>'; } // modification ENDE
Last edit: 7 years 8 months ago by n00bster.
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.199 seconds
Powered by Kunena Forum