• Closed by: Marek
  • Closed on: 01.03.19, 16:23
  • Reason: Closed
  • Comment: Glad to help!

Ticket #13736 - Management of combinations without stock

Good morning Marek!
I worked with Alysum again (I no longer work with the module that made us have problems with the template) and I wonder how to adjust a couple of things on the product page:
1- How can I make sure that the combinations are not shown without stock?

I copy you the link of an article with combinations. The stock of these combinations is:
Size M color khaki : stock 1
Size L color khaki: stock 1
Size L blue: Stock 0 - This shows it but does not let you buy and returns you to the default combination
Size XL blue: stock 1
Size XXL garnet colour: stock 0 - This one doesn’t show it.

https://elsximplets.cat/inici/521-8740-somiatruites-samarreta-home.html#/3-talla-l/57-color-caqui

In my configuration I have:
Do not show products without stock
Do not allow the sale of products without stock

I deduce that when the complete combination (case of garnet) is exhausted, it does not show it, but while there are sizes left (case of blue), it shows it… Can I do something about it?

On the other hand, I would like to try to show the sizes in dropdown, just like you do in your demo: https://alysum5.promokit.eu/oldstyle/en/tops/34-324-printed-chiffon-dress.html#/6-color-taupe/19-shoes_size-36 Where do I access the choice of how to display these attributes?

Best regards!
Cristina

Comments

Marek 13 Feb 2019, 12:19

Hi, Cristina.
To make sure something wrong with the theme I would recommend you to install another PrestaShop from scratch and test out the same product configuration there.
Here you can find how to change the type of attribute http://take.ms/TZo7Z

ximplets catalans 13 Feb 2019, 12:36

Dropdown size set!
To make sure I’ve got it right:
You suggest me to install a new prestashop in another location, configure a product like the one I linked in my ticket, make sure it works and then apply the theme alyssum to see if it still works? isn’t it?

Marek 13 Feb 2019, 12:43

No, you don’t have to apply Alysum theme. Just see how it works in “Classic” theme

ximplets catalans 13 Feb 2019, 14:26

Hello there!
I tried what you told me (a new prestashop in another folder and create the product with the same features) here you leave the link:
http://elsximplets.cat/prueba/es/men/20-40-somiatruites.html#/1-tamano-s/6-color-gris_pardo All product combinations have stock 1 except for L red and M black.
Gives me the option to choose the combination, but if you don’t have stock leads me to the default combination (S-gray)
In the option :
* Show products with attributes not available on the product page - NO
* Availability Preferences - Behavior when product is out of stock: Use default behavior (Deny orders)
For this matter, does alysum have any option not to show combinations without stock?
I was looking for information on the subject and found this, could it work? Where should I enter this text?

Edit the file product.tpl on the line:

</div> <!-- end attributes -->
{/if}
</div> <!-- end product_attributes -->

We add a line so that if the stock is at zero, that it does not show it:

{if $groups.$id_attribute_group.attributes_quantity.$id_attribute == 0}disabled{/if}

It would look like this in the end:

</div> <!-- end attributes -->
{/if}
{if $groups.$id_attribute_group.attributes_quantity.$id_attribute == 0}disabled{/if}
</div> <!-- end product_attributes -->

What do you think?

Cristina

Marek 14 Feb 2019, 11:46

As I understand Alysum works in the same way as default prestashop theme, right?
As for your code, open the file /themes/alysum/templates/catalog/_partials/product-variants.tpl
Find the line:

<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>

and add your code like this:

<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}{if $groups.$id_attribute_group.attributes_quantity.$id_attribute == 0} disabled{/if}>