Jump to content

Recommended Posts

Hello everyone, I 'm looking for a module similar to this but free :
 

http://addons.prestashop.com/en/19487-ilm-quantity-in-dozen.html

Otherwise you can with ( product and cart ) .tpl make a small mod that allows me to be able to use only even numbers in the selection of the amount (2-4-6-8)? 

I have experience in html / css / js and little php.

 

Please Help me..  :(

 

Share this post


Link to post
Share on other sites
 

I find a quick solution to the product page. :P 


Add this code on product.tpl after {if !$PS_CATALOG_MODE}{/if}



{assign var='categories' value=Product::getProductCategoriesFull($product->id, $cookie->id_lang)}
{foreach from=$categories key='categoryId' item='category' name='categories'}
{/foreach}

{if $categoryId == '33' OR $categoryId == '34' OR $categoryId == '37'}

{literal}
<script type="text/javascript">
$(document).ready(function(){

$('#quantity_wanted').val(2);

$('.product_quantity_up').on('click',function(){
if (isNaN(parseInt($('#quantity_wanted').val()))){$('#quantity_wanted').val(1)}
else {
if(parseInt($('#quantity_wanted').val())<=1){$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())+0)}
else {$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())+1)};
}
});

$('.product_quantity_down').on('click',function(){
if (isNaN(parseInt($('#quantity_wanted').val()))){$('#quantity_wanted').val(1)}
else {
if(parseInt($('#quantity_wanted').val())<=1){$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())-1)}
else {$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())-1)};
};

});
});
</script>
{/literal}

{/if}


 

But I miss implement it in the summary of the cart ..

I cant find the file .TPL of summary cart order.. ( Steap - 1 )

 

Help please :( 

Edited by Mantovani Maurizio (see edit history)

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More