Jump to content

Show availability in product page for each combination


Recommended Posts

Hello all,

I have combinations from two attributes (A+B). Attributes are radio buttons (I made them like buttons in css).

See enclosed screen.

Problem is, that Prestashop count total quantity of each attribute. So for e.g. attribute "20cm" shows "available 5pcs", thats correct, but above must somehow dynamically show only availability connected with attribute "20cm". 

 

My code in product.tpl

      {if {$group.attributes_quantity[{$id_attribute|intval}]} < 1}
       {$product->available_later}
        {else}
       {$product->available_now}
       <span> {$group.attributes_quantity[{$id_attribute|intval}]} {l s='ks'}
       
       </span>
					
   {/if}

 

Do you know somebody how to do it?

screen.JPG

Link to comment
Share on other sites

Hello,

Maybe the problem is your theme or something more, because by default PrestaShop display the stock of the selected combination, NOT the sum of all the combinations. You can validate it by changing temporary to the default theme.

 

Regards!

Link to comment
Share on other sites

Hello,

yes, normally it shows like that, but I want to display under each attribute - like picture attached. 

I use the code above.

Like here: 

https://www.i-living.cz/Matrace-z-pametove-peny/Zdravotni-matrace-Tropico-SUPER-FOX

 

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