THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour,

Existe-t-il un plugin pour définir la quantité directement sur la page catégorie avant un clic sur 'Ajouter au panier' ?
Y'a-t-il une astuce, un autre chemin ?

Offline


Bonjour,
Tu peux mettre ce mode dans le fichier single-product.html :

{form_field field='quantity'}
                                <div class="form-group group-qty {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
                                    <label for="{$label_attr.for}">{$label}</label>
                                    {if $QUANTITY >= 12}
                                                <select name="{$name}" class="form-control" id="{$label_attr.for}">
                                                    {for $will=1 to 12}
                                                        <option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
                                                    {/for}
                                                </select>
                                            {else}
                                                <select name="quantity" class="form-control" >
                                                    {for $will=1 to $QUANTITY}
                                                        <option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
                                                    {/for}
                                                </select>
                                            {/if}
                                           
                                    {if $error }
                                        <span class="help-block"><i class="fa fa-remove"></i> {$message}</span>
                                    {elseif $value != "" && !$error}
                                        <span class="help-block"><i class="fa fa"></i></span>
                                    {/if}
                                </div>
                            {/form_field}