Jump to content

[Solved] Showing Features on Shopping Cart Page


Recommended Posts

Hi!

I need to show a specific product feature on the shopping cart pages. I know this is possible, and this is the code I'm using for it:

On the top of shopping-cart-product-line.tpl file:


               {foreach from=$product.features item=feature}
                   {if $feature.name == 'FeatureX'}
                       {foreach from=$feature.value item=part name=featurex}
                               {assign var='featurex' value=$part}
                                                 {/foreach}
                   {/if}
               {/foreach} 



And to call it simply, I use this on the same page:

{$featurex}



The same code works on other pages (product page, home featured block etc.; but doesn't seem to work on the shopping cart.)

I'm using One Page Checkout & PS Version 1.4.1

Any help is really appreciated.

Thanks,

B

Link to comment
Share on other sites

Looking at the getProducts() function in classes/Cart.php, it seems PrestaShop doesn't include features in the cart products. You will need to create override/classes/Cart.php to override that function and change the query to include features.

Link to comment
Share on other sites

  • 1 month later...

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