Jump to content

Required checkbox for product


Recommended Posts

Hi, I was wondering how I might go about adding a checkbox to a product? Things like medicines that require a customer to agree to conditions etc, so that if they don't check the box, the product won't be added to their cart. An alternative would be that they agree to the conditions on their user account page. Either of these things possible to do?

I know there is a checkbox during checkout which could maybe be used for this purpose, but as not all all customers will be buying medicine, it seems crude to have to ask everyone to check this box.

Many thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

You will need to create the new checkbox in product.tpl, and then you should modify /modules/blockcart/ajax-cart.js

$('body#product p#add_to_cart input').unbind('click').click(function(){
if ($('#id_of_new_checkbox').css('checked) != 'checked')
{
   alert('you much xyz...');
   return
}
... rest of functions
}


It would be best to use a variable for the text alert which you should define in the product.tpl file using the preatshop translate fucntion

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