Jump to content

[solved] Display product features (such as height, width) in shopping cart


Recommended Posts

I read many postings about how to add products weight to the cart - however, I am not sure how to add a custom product feature (lets say height or weight) to a column in the shopping cart.

 

Anyone solved this one yet?

 

This is quite important as here in the EU, shop owners need to show important specs / features of the products to the customers in the shopping cart summary...

Link to comment
Share on other sites

to the shopping-cart.tpl file located in your theme, just add this code:

{assign var='features' value=Product::getFrontFeaturesStatic($cookie->id_lang, $product.id_product)}
		    {if isset($features) && $features}
				    {foreach from=$features item=feature}
					   {if isset($feature.value)}
								    {$feature.value|escape:'htmlall':'UTF-8'}:
								    {$feature.name|escape:'htmlall':'UTF-8'}
					   {/if}
				    {/foreach}
		    {/if}

  • Like 2
Link to comment
Share on other sites

Thanks, vekia!

 

I integrated your suggestion into 1.5.4 and it works perfectly. Thanks for your help!

 

Also, I tweaked it a bit: Put it in a div to unbold it when inserting it in the product description cell in the cart; changed the order of name and value of the features; but a line break, so that each feature is displayed on a separate line.

 

<div class="normalfeaturesfont">
{assign var='features' value=Product::getFrontFeaturesStatic($cookie->id_lang, $product.id_product)}
		  {if isset($features) && $features}
				 {foreach from=$features item=feature}
					    {if isset($feature.value)}
								 {$feature.name|escape:'htmlall':'UTF-8'}:
	  {$feature.value|escape:'htmlall':'UTF-8'}
								   <br/>
	 {/if}
				  {/foreach}
		    {/if}
</div>

Link to comment
Share on other sites

  • 3 months later...

Thanks, vekia!

 

I integrated your suggestion into 1.5.4 and it works perfectly. Thanks for your help!

 

Also, I tweaked it a bit: Put it in a div to unbold it when inserting it in the product description cell in the cart; changed the order of name and value of the features; but a line break, so that each feature is displayed on a separate line.

 

<div class="normalfeaturesfont">
{assign var='features' value=Product::getFrontFeaturesStatic($cookie->id_lang, $product.id_product)}
			  {if isset($features) && $features}
					 {foreach from=$features item=feature}
						    {if isset($feature.value)}
									 {$feature.name|escape:'htmlall':'UTF-8'}:
		  {$feature.value|escape:'htmlall':'UTF-8'}
									   <br/>
		 {/if}
					  {/foreach}
			    {/if}
</div>

 

 hi there can you show me a picture of how this looks like now?

Link to comment
Share on other sites

  • 1 month later...

it will be much easier for you if you will be able to test it on your own :) believe me, it's always the best to test code,

especially when you use non-default theme

Hi Vekia, tanks but this code is not working on prestashop ver 1.5.6.2

Link to comment
Share on other sites

what you see instead of features?

Tanks for the reply Vekia.

in Prestashop 1.5.6.2 works only if I insert this code in the file "shopping-cart-product-line.tpl" not in the file "shopping-cart.tpl"

 
But still this is not what I'm looking for, I'm looking for a better solution for displaying the Weight of the products at Shopping-cart summary, like in this topic:  link
 
Tanks again.
Edited by majority (see edit history)
Link to comment
Share on other sites

  • 8 years later...

Hello folks,

For legal security reasons, I need to display product properties in the shopping cart. I have Prestashop 1.7.8.7

Does anyone have a solution for this so that the properties are displayed in the shopping cart at checkout?

Thanks in advance
Johann

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...