Skip to main content

Disable textfield quantity in card

More
15 years 5 months ago #13946 by emergentec
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.

More
15 years 5 months ago #13956 by nicolas
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.

More
15 years 5 months ago #13977 by emergentec
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.

More
15 years 5 months ago #13994 by nicolas
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.183 seconds
Powered by Kunena Forum