Products with variants without pre-selection of a variant

  • I read a few days ago in a topic that in the product view for articles with variants of the customer must choose because there is no pre-selection.
    Since I had this time in a PS-Shop, I have again found in the PS-Forum.

    Here I would like to emphasize that I have not completely tested the ordering process, but the product in the shopping cart works.
    So you see in products with variants, no preselection of a particular variant.

    find in your theme/product.tpl

    {foreach from=$group.attributes key=id_attribute item=group_attribute}
    <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>

    replace with

    <option value="choose" selected="selected" title="--choose--">{l s='--Please Select--'}</option>
    {foreach from=$group.attributes key=id_attribute item=group_attribute}
    <option value="{$id_attribute|intval}" {if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute)} selected="selected" {/if} title="{$group_attribute|escape:'html':'UTF-8'}">


    after changing



  • Note, it only works with the dropdown box


  • Great, I will try it as soon as I find some time. Does it have custom warning message if you click on add to cart button before choosing the attributes? Or I have to change the meaning of other predefined message?
    Merry Christmas to everybody!

  • @mockob
    No, unfortunately not yet. I think it would be necessary to insert an additional code in which, for example, only after the selection of the shopping cart appears active.
    But it is a start.

  • It would be better to be active and when you click on add to cart to show pop up message informing customer to choose attributes. If the button is not active the customer may decide the product is out of stock and just leave the page.

  • @mockob

    I have now changed the code in my first post. There will be no error message, because the shopping cart is shown after selecting. The add to cart button is hidden.
    The first line of the changed code is:

    <option value="choose" selected="selected" title="--choose--">{l s='--Please Select--'}</option>




  • 0_1514241006209_15142395681124096fb7a-c09f-4882-9865-d599dd6fa89c-grafik.png

  • It looks great @zimmer-media but as I told earlier, I believe the customers don’t like to read! So they could easily miss adding product to cart because there is no button, especially if most products (without features) are with add to cart button.
    Check eBay or aliexpress on both the buttons are not hidden.

    Edit: I got troubles with the eBay link but it could be easily checked.


Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.