Jump to content

Add new column Tax for product in cart page


robs2809

Recommended Posts

On 12/29/2023 at 4:16 PM, robs2809 said:

On the shopping cart page I would like to detail the tax value for each product entered by adding a new column in the detail table.
Do you have an idea how I can do this?

Hi,

You can make theme override to modify the shopping cart page.

  • Copy the template file responsible for displaying the shopping cart (e.g., cart.tpl) from the original Prestashop theme directory to your theme's directory.
  • Add a new table header for your tax column.
  • Inside the loop that displays the products, add a new column to display the tax value for each product
  • You might need to adjust the CSS to make sure the new column aligns properly with the existing columns.
  • After making changes, clear the PrestaShop cache and test on the front end to ensure that the new column is displayed correctly.

Note: Before making any changes, it's highly recommended to backup your files and database.

Link to comment
Share on other sites

Thks

3 hours ago, AddWeb Solution said:

Hi,

You can make theme override to modify the shopping cart page.

  • Copy the template file responsible for displaying the shopping cart (e.g., cart.tpl) from the original Prestashop theme directory to your theme's directory.
  • Add a new table header for your tax column.
  • Inside the loop that displays the products, add a new column to display the tax value for each product
  • You might need to adjust the CSS to make sure the new column aligns properly with the existing columns.
  • After making changes, clear the PrestaShop cache and test on the front end to ensure that the new column is displayed correctly.

Note: Before making any changes, it's highly recommended to backup your files and database.

Hi

Thks for your reply.

Every step is very clear, but which code i've to insert to show the value?

Alessandro

 

Link to comment
Share on other sites

22 minutes ago, robs2809 said:

which code i've to insert to show the value?

Example code

To add New table header

<th>{l s='Tax' d='Shop.Theme.Actions'}</th>

To display Tax value for each product

<td>
    {convertPrice price=$product.tax_price|intval}
</td>

Try this and let me know if it works!

Thanks!

Link to comment
Share on other sites

33 minutes ago, AddWeb Solution said:

Example code

To add New table header

<th>{l s='Tax' d='Shop.Theme.Actions'}</th>

To display Tax value for each product

<td>
    {convertPrice price=$product.tax_price|intval}
</td>

Try this and let me know if it works!

Thanks!

Hi

thks!

I've activated the debug and this is the error:

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file ...../templates/checkout/_partials/cart-detailed-product-line.tpl" on line 143 "{convertPrice price=$product.tax_price|intval}" unknown tag 'convertPrice'

I'think it works in the version 1.7  and not in the version 8 of PS

Regards

 

Link to comment
Share on other sites

10 minutes ago, AddWeb Solution said:

Try this

<td>
    {$product.tax_price|priceDisplay}
</td>

Thanks!

Another error

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file....warehousechild/templates/checkout/_partials/cart-detailed-product-line.tpl" on line 143 "{$product.tax_price|priceDisplay}" unknown modifier 'priceDisplay' 

Thanks!!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...