- Posts: 70
- Thank you received: 1
Show prices with tax/without tax toggle
3 years 2 months ago #353304
by Storm
Show prices with tax/without tax toggle was created by Storm
-- HikaShop version -- : 4.7.47
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.33
Is there a way to have a toggle at the top of the page (as a module) which can be toggled to show prices with and without tax?
All prices are shown on the page, but then then style is updated.
For example, when the toggle is set to show prices with tax, the style would be:
<div class="productPrices">
<div class="priceswithTax bold">£120.00</div>
<div class="priceswithoutTax">£100.00</div>
</div>
the if the toggle is set to show prices without tax, the style would be:
<div class="productPrices">
<div class="priceswithoutTax bold">£100.00</div>
<div class="priceswithTax">£120.00</div>
</div>
I can then style them accordingly. What the best way to do this please?
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.33
Is there a way to have a toggle at the top of the page (as a module) which can be toggled to show prices with and without tax?
All prices are shown on the page, but then then style is updated.
For example, when the toggle is set to show prices with tax, the style would be:
<div class="productPrices">
<div class="priceswithTax bold">£120.00</div>
<div class="priceswithoutTax">£100.00</div>
</div>
the if the toggle is set to show prices without tax, the style would be:
<div class="productPrices">
<div class="priceswithoutTax bold">£100.00</div>
<div class="priceswithTax">£120.00</div>
</div>
I can then style them accordingly. What the best way to do this please?
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353308
by nicolas
Replied by nicolas on topic Show prices with tax/without tax toggle
Hi,
You'll have to develop a module ( docs.joomla.org/J3.x:Creating_a_simple_m...oping_a_Basic_Module ) with your toggle button and a dozen lines of javascript code ( stackoverflow.com/questions/67881886/how...iner-with-javascript ) to do the swap.
Even better would be to swap the elements without changing the HTML, just by changing the class with flex items :
developer.mozilla.org/en-US/docs/Web/CSS.../Ordering_flex_items
So the javascript would just have to change ( stackoverflow.com/questions/195951/how-c...lass-with-javascript ) the main productPrices class to, for example, productPricesReverse and then, you would do the swap with pure CSS.
stackoverflow.com/questions/3047755/i-am...button-in-javascript
You'll have to develop a module ( docs.joomla.org/J3.x:Creating_a_simple_m...oping_a_Basic_Module ) with your toggle button and a dozen lines of javascript code ( stackoverflow.com/questions/67881886/how...iner-with-javascript ) to do the swap.
Even better would be to swap the elements without changing the HTML, just by changing the class with flex items :
developer.mozilla.org/en-US/docs/Web/CSS.../Ordering_flex_items
So the javascript would just have to change ( stackoverflow.com/questions/195951/how-c...lass-with-javascript ) the main productPrices class to, for example, productPricesReverse and then, you would do the swap with pure CSS.
stackoverflow.com/questions/3047755/i-am...button-in-javascript
Please Log in or Create an account to join the conversation.
3 years 1 month ago #354293
by netsolid
Replied by netsolid on topic Show prices with tax/without tax toggle
It would be nice as a new feature to made this a toggle for incl.tax or excl.tax possible.
Or maybe for B2B usergroup set excl.tax and for regular customers incl.tax (registered).
This looks a common use!
Or maybe for B2B usergroup set excl.tax and for regular customers incl.tax (registered).
This looks a common use!
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.177 seconds