Magento – How to add a weight option to the magento simple products product options

custom-optionsmagento-1.9

I have a setup where I'm using shipping on basis of product weight, using Magento CE 1.9. I have setup a simple product with some custom options, now my issue is that Magento does not support a weight per custom option.

I've now modified the code by adding a text input for the weight and when submitting the form, it does send the data to the database, the table is catalog_product_option_type_weight which is a copy of the catalog_product_option_type_title. My problem is when going back to edit the product options, the values from the database do not get populated in the newly created field.

I debugged also the frontend and seems that the weight is missing from the product object also there. Could anyone point me to the correct direction, which files to modify and how to get also the weight populated like the other fields (title, price, price type)enter image description here?

I've modified the core files, I know that is not recommended but in this case I'm not intending to upgrade Magento.

Best Answer

I would suggest to use a configurable product instead of product options for this. You then need to create the different simple products where you can assign the weight and price. This also allows you to manage your stock for each weight package (if you want to). These simple products are then assigned to the configurable product so the customer gets to select the weight he needs. Because the order is created with the simple product where the weight is entered you can calculate the shipping based on the weight.

Related Topic