Disable textfield quantity in card

  • Posts: 137
  • Thank you received: 2
13 years 7 months ago #13946

Hi!

We would like to disable the textfield quantity in the cart, so the user can't change the quantiy of a product in the cart.

But if we disable the textfield in the view, it's not possible to remove the produkt from the cart. Why?

Best regards

Please Log in or Create an account to join the conversation.

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13956

Are you sure that you didn't remove the delete icon as well when deleting the quantity field ?
Both are next each other so maybe you removed both ?

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 7 months ago #13977

I didn't delete the quantity field, I just disabled it. The delete icon is still there, but the item is not removed of the cart.

Please Log in or Create an account to join the conversation.

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13994

Indeed, if you hide the quantity field, the delete icon doesn't work.
Could you go in the menu Display->Views and edit the file cart of the view product and change the line:
<a href="<?php echo hikashop::completeLink('product&task=updatecart&cart_product_id='.$row->cart_product_id.'&quantity=0&return_url='.urlencode(base64_encode(urldecode($this->params->get('url'))))); ?>" onclick="var qty_field = document.getElementById('hikashop_cart_quantity_<?php echo $row->cart_product_id;?>'); qty_field.value=0; document.hikashop_cart_form.submit(); return false;" ><img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="remove product" /></a>


to:
<a href="<?php echo hikashop::completeLink('product&task=updatecart&cart_product_id='.$row->cart_product_id.'&quantity=0&return_url='.urlencode(base64_encode(urldecode($this->params->get('url'))))); ?>" onclick="var qty_field = document.getElementById('hikashop_cart_quantity_<?php echo $row->cart_product_id;?>'); if(qty_field){qty_field.value=0; document.hikashop_cart_form.submit(); return false;}else{ return true;}" ><img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="remove product" /></a>

That should solve the problem

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum