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>
    {/foreach}
    

    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'}">
    {$group_attribute|escape:'html':'UTF-8'}
    </option>
    {/foreach}
    

    before
    0_1514235153594_cc0e3ac7-81d7-4ca6-a3e4-374d9e1c5a51-grafik.png

    _
    after changing
    0_1514235221749_67a959f0-0265-4f46-bc85-c7a4d54c5211-grafik.png

    0_1514235240771_05c0c8ba-eb18-437c-958f-09f3402ac5a0-grafik.png

    0_1514235251512_eef27a23-f312-4c53-8fc4-b8c7cc81e8fa-grafik.png



  • Note, it only works with the dropdown box

    0_1514235686122_863cab9f-8a25-4a48-b41e-524ffe99fc8c-grafik.png



  • 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_1514239564499_4096fb7a-c09f-4882-9865-d599dd6fa89c-grafik.png

    0_1514239579248_1e312feb-0b2b-49ee-91ba-e11e8d8c25b0-grafik.png

    0_1514239598587_e08f1c07-fc91-4b4f-86bd-3b1051936df7-grafik.png



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