1

I'm selling rolls that come in two widths. The user can choose which width is required however the user can also type in the length in metres. Then a price is calculated.

For instance if the price is £5 square metre, and the user chooses the 4m option and types in a length of 4.5m then the total cost should be 5 x 4 x 4.5

Is there an existing extension, is this simple to program?

1

I have used both of the extensions mentioned by @Marius, and I can say that they might meet your needs. In my case, they were not robust enough for us to use.

I ended up having to write my own solution, here's the basic flow:

  • Created a custom product type
  • Custom product type uses it's own template for the product_type_data block where I can include my own form fields for the user to enter dimensions.
  • Custom product type main model class has a setPrice method where I can use my own calculations to determine the price
  • I have an observer on the sales_quote_add_item event where I can take the request and pass it along to the setPrice method.
  • The custom product type's type model uses _prepareProduct to add the user's choices as custom options added to the additional_options option.

This should be enough to get you started. Depending on your requirements, there might be additional things to code so that, for example, a user is able to edit their choices when clicking the "edit" button in the cart.

  • Hi Pspahn - Thanks for the suggestions, unfortunately i'm a complete newbie in Magenta, could you some assistance on the code ? – Orange Juice Jones Jul 27 '15 at 14:45
1

I haven't used or tested this, but you can give it a try, or at least investigate further: http://www.fmeextensions.com/magento-length-area-volume-pricing-calculator.html. It claims it does what you need (price per surface) and more: price per volume, support for different unis of measure.... This one also claims the same: http://www.micosolutions.com/advanced-variation-pricing.
I haven't used any of these and I'm in no way associated with the developers. I just found these on a quick search.

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.