2

This is what I'm trying to achieve:

I have 2 radiobuttons: 1. Order per item 2. Order per box (6)

Under those radiobuttons, theres a textbox. People need to fill the amount in that field. When I select the first radiobutton, everything I enter in the textbox goes per item. When I select the second radiobutton, everything I enter in the textbox goes per 6 items. So when I selected the second radiobutton and enter 2 in the textbox, it's supposed to order 12 items of the product.

Is there a way to achieve the above with an extension or module or any other way?

Thanks in advance!

1

It's very possible, but if you were my client I'd ask for more information as there is probably a cleaner way of accomplishing what you are trying to do.

However, if you want to build this, you would simply create a custom module with an observer on the event checkout_cart_product_add_before. In this event, you can look at the attributes and manipulate the data being added to the cart as you see fit.

There are a lot of resources out there on creating modules and observers. Search for that event name and you'll see tons of resources on how to do things similar to what you want to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.