Jump to content

Edit History

EvaF

EvaF

yes, you are right -  the "href" confused me ..

you have two options(imho):

1) to remove class "cart_quantity_up" resp "cart_quantity_down" ( and then the cart page will refreshing)

2) prepare Javascript yourself to  set qty and let Ajax call to do the rest

something like:

change  tag <a  for  "+"   this way: ( and for "-" analogical) and add the script outside {foreach...

<a rel="nofollow" class="cart_minquantity_up btn btn-default button-plus" 
min_qty="{if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}"   
id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" 
href="{$link->getPageLink('cart', true, NULL, "add=1&qty={if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" 
title="{l s='Add'}">
<span><i class="icon-plus" style="padding:.7em;"></i></span></a>
<script>
  $(document).ready(function(){
	$('.cart_minquantity_up').off('click').on('click', function(e){
		e.preventDefault();
		upQuantity($(this).attr('id').replace('cart_quantity_up_', ''),$(this).attr('min_qty'));
		$('#' + $(this).attr('id').replace('_up_', '_down_')).removeClass('disabled');
	});
	$('.cart_minquantity_down').off('click').on('click', function(e){
		e.preventDefault();
		downQuantity($(this).attr('id').replace('cart_quantity_down_', ''),$(this).attr('min_qty'));
	});
  });
</script>    

(i didn't test it, so take it with reserve)

note:
href is useless (due preventDefault)
 

<a rel="nofollow" class="cart_minquantity_up btn btn-default button-plus" 
min_qty="{if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}"   
id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" 
href="#" title="{l s='Add'}">

 

 



 

EvaF

EvaF

yes, you are right -  the "href" confused me ..

you have two options(imho):

1) to remove class "cart_quantity_up" resp "cart_quantity_down" ( and then the cart page will refreshing)

2) prepare Javascript yourself to  set qty and let Ajax call to do the rest

something like:

change  tag <a  for  "+"   this way: ( and for "-" analogical) and add the script outside {foreach...

<a rel="nofollow" class="cart_minquantity_up btn btn-default button-plus" 
min_qty="{if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}"   
id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" 
href="{$link->getPageLink('cart', true, NULL, "add=1&qty={if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" 
title="{l s='Add'}">
<span><i class="icon-plus" style="padding:.7em;"></i></span></a>
<script>
  $(document).ready(function(){
	$('.cart_minquantity_up').off('click').on('click', function(e){
		e.preventDefault();
		upQuantity($(this).attr('id').replace('cart_quantity_up_', ''),$(this).attr('min_qty'));
		$('#' + $(this).attr('id').replace('_up_', '_down_')).removeClass('disabled');
	});
	$('.cart_minquantity_down').off('click').on('click', function(e){
		e.preventDefault();
		downQuantity($(this).attr('id').replace('cart_quantity_down_', ''),$(this).attr('min_qty'));
	});
  });
</script>    

(i didn't test it, so take it with reserve)

 



 

EvaF

EvaF

yes, you are right -  the "href" confused me ..

you have two options(imho):

1) to remove class "cart_quantity_up" resp "cart_quantity_down" ( and then the cart page will refreshing)

2) prepare Javascript yourself to  set qty and let Ajax call to do the rest

something like:

change  tag <a  for  "+"   this way: ( and for "-" analogical) and add the script outside {foreach...

<a rel="nofollow" class="cart_minquantity_up btn btn-default button-plus" 
min_qty="{if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}"   
id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" 
href="{$link->getPageLink('cart', true, NULL, "add=1&qty={if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" 
title="{l s='Add'}">
<span><i class="icon-plus" style="padding:.7em;"></i></span></a>
<script>
  $(document).ready(function(){
	$('.cart_minquantity_up').off('click').on('click', function(e){
		e.preventDefault();
		upQuantity($(this).attr('id').replace('cart_minquantity_up_', ''),$(this).attr('min_qty'));
		$('#' + $(this).attr('id').replace('_up_', '_down_')).removeClass('disabled');
	});
	$('.cart_minquantity_down').off('click').on('click', function(e){
		e.preventDefault();
		downQuantity($(this).attr('id').replace('cart_minquantity_down_', ''),$(this).attr('min_qty'));
	});
  });
</script>    

(i didn't test it, so take it with reserve)

 



 

EvaF

EvaF

yes, you are right -  the "href" confused me ..

you have two options(imho):

1) to remove class "cart_quantity_up" resp "cart_quantity_down" ( and then the cart page will refreshing)

2) prepare Javascript yourself to  set qty and let Ajax call to do the rest

something like:

change  tag <a  for  "+"   this way: ( and for "-" analogical) and add the script outside {foreach...

<a rel="nofollow" class="cart_minquantity_up btn btn-default button-plus" 
min_qty="{if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}"   
id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" 
href="{$link->getPageLink('cart', true, NULL, "add=1&qty={if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" 
title="{l s='Add'}">
<span><i class="icon-plus" style="padding:.7em;"></i></span></a>
<script>
  $(document).ready(function(){
	$('.cart_minquantity_up').off('click').on('click', function(e){
		e.preventDefault();
		upQuantity($(this).attr('id').replace('cart_minquantity_up_', ''),$(this).attr('min_qty'));
		$('#' + $(this).attr('id').replace('_up_', '_down_')).removeClass('disabled');
	});
	$('.cart_minquantity_down').off('click').on('click', function(e){
		e.preventDefault();
		downQuantity($(this).attr('id').replace('cart_minquantity_down_', ''),$(this).attr('min_qty'));
	});
  });
</script>    

(i didn't test it, so take it with reserve)

 



 

EvaF

EvaF

yes, you are right -  the "href" confused me ..

you have two options(imho):

1) to remove class "cart_quantity_up" resp "cart_quantity_down" ( and then the cart page will refreshing)

2) prepare Javascript yourself to  set qty and let Ajax call to do the rest

something like:

change  tag <a  for  "+"   this way: ( and for "-" analogical) and add the script outside {foreach...

<a rel="nofollow" class="cart_minquantity_up btn btn-default button-plus" 
min_qty="{if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}"   
id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" 
href="{$link->getPageLink('cart', true, NULL, "add=1&qty={if $product.minimal_quantity > 0}{$product.minimal_quantity}{else}1{/if}&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" 
title="{l s='Add'}">
<span><i class="icon-plus" style="padding:.7em;"></i></span></a>
<script>
  $(document).ready(function(){
	$('.cart_minquantity_up').off('click').on('click', function(e){
		e.preventDefault();
		upQuantity($(this).attr('id').replace('cart_quantity_up_', ''),$(this).attr('min_qty'));
		$('#' + $(this).attr('id').replace('_up_', '_down_')).removeClass('disabled');
	});
	$('.cart_minquantity_down').off('click').on('click', function(e){
		e.preventDefault();
		downQuantity($(this).attr('id').replace('cart_quantity_down_', ''),$(this).attr('min_qty'));
	});
  });
</script>    

(i didn't test it, so take it with reserve)

 



 

×
×
  • Create New...