florin.dediu Posted March 29, 2015 Share Posted March 29, 2015 Salutare dragi colegi, Am tot căutat pe forum, și nu numai, o modalitate de a crea, pe lângă butonul normal, alte două butoane de adăugare în coș. Cu ce ar fi aceste butoane diferite? Cantitatea. Pentru a înțelege mai bine nevoia mea, atașez mai jos ideea de bază. Link to comment Share on other sites More sharing options...
cristic Posted March 29, 2015 Share Posted March 29, 2015 Eu vad urmatorii pasi de facut: 1. Creezi 2 reguli de pret la acest produs - una pentru 2 bucati si una pentru 3; 2. In pagina produsului (product.tpl) trebuie sa modifici partea de "quantity discounts" - ca in loc de afisare tabelara sa pui butoane + acel text cu procentul de reducere; 3. In codul de javascript, la apasarea oricarui buton de discount, apelezi ajaxCart.add cu cantitatea necesara. Link to comment Share on other sites More sharing options...
florin.dediu Posted March 29, 2015 Author Share Posted March 29, 2015 Mulțumesc pentru răspunsul prompt. Pot găsi un sample de cod? Link to comment Share on other sites More sharing options...
cristic Posted March 30, 2015 Share Posted March 30, 2015 Nu stiu sa existe ceva facut... Link to comment Share on other sites More sharing options...
florin.dediu Posted March 30, 2015 Author Share Posted March 30, 2015 (edited) Până la urmă am reușit! Edit: nu am reușit cum trebuie ... Pentru cei interesați atașez mai jos codul sursă din product.tpl <div id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label class="qty-label">{l s='Quantity'}:</label> <div class="quantity-input-wrapper"> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" /> <a href="#" data-field-qty="qty" class="transition-300 product_quantity_down"> <span><i class="icon-caret-down"></i></span> </a> <a href="#" data-field-qty="qty" class="transition-300 product_quantity_up "> <span><i class="icon-caret-up"></i></span> </a> </div> <!-- Butoane reducere --> {if !$content_only} {if (isset($quantity_discounts) && count($quantity_discounts) > 0)} <br><br><button type="submit" name="qty" id="quantity_wanted2 add_to_cart2" class="exclusive2 buttons_bottom_block no-print" value="2"> <span>Adauga 2 produse <br><b>si ai reducere 10%</b></span> </button> {/if} {/if} <!-- end butoane --> <span class="clearfix"></span> </div> Edited April 1, 2015 by florin.dediu (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now