Jump to content

Help for add product to cart


TranceCode

Recommended Posts

hey guys i have my webstore that i work but whit problem, i change and add a list whit my stock, but when i select for example 13 product of my list and press the button add to cart only add 1, i can select 12, 9, 20 product but allways add 1 product :( 

this is my website http://tucan.bri.cl/everwines/shop/index.php?id_category=12&controller=category

and this is my code that i add to default template from prestashop 1.7.2.3 Please someone can help me :D 

 

<!--  custom code -->

        <div class="clearfix atc_div">

            <p id="quantity_wanted_p"{if (!$allow_oosp && $product.quantity <= 0) || !$product.available_for_order || $PS_CATALOG_MODE} style="display: block;"{/if}>

                                    <select name="qty_{$product.id_product|intval}" id="quantity_to_cart_{$product.id_product|intval}" class="form-control not_unifrom">        
                                {section name=foo_q start=0 loop=$product.quantity  step=1}
                                         <option value="{$smarty.section.foo_q.index + 1}">{$smarty.section.foo_q.index + 1}</option>
                                        {/section}
                                         {if $product.quantity_all_versions < 1}
                                            <option value="0">0</option>
                                         {/if}                                                                             
        </select>                     
                                    </p>
                    
        <!--  Condicion para deshabilitar boton si stock es cero -->

                    {if ($product.allow_oosp || $product.quantity == 0 )}
                        <div class="add"> <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" disabled >
                             <!--  <i class="material-icons shopping-cart">&#xE547;</i> -->
                             <span class="add-text">{l s='Add to cart' d='Shop.Theme.Actions'}</span> <span class="psudo-icon"></span>
                             <!--  Agregar -->
                             </button>
                        </div>
                    {else}
                        <button class="add_to_cart btn btn-primary btn-sm add-to-cart" onclick="mypresta_productListCart.add({literal}$(this){/literal});">
                        {* < i class="material-icons"> add_shopping_cart </ i>{l s='Add to cart' d='Shop.Theme.Actions'} *}
                        <span class="add-text">{l s='Add to cart' d='Shop.Theme.Actions'}</span> <span class="psudo-icon"></span>
                    {/if}
                    <!--  Termina Condicion para deshabilitar boton si stock es cero -->
       
                <!-- fin custom code Testing-->

Link to comment
Share on other sites

Hey Gianni, thank for your answer, actually i talk about the product list page, when i add product to my cart, but i talk about my website if you check the url is diferent to default theme, we use the default theme and make change on this. have a problem when we select over 1 product, no take the quantity to select, please check our website and screenshot

lista de productos.png

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