After doing some research into this, we have found this workaround solution that may help you achieve this functionality in Sitefinity, but this will only work if the weight of the product to be purchased will not be entered by the user.
These are the steps to be followed within Sitefinity:
1. Create a product attribute
that will be used as the Weight (Please do not use the name Weight
for this as it a reserved name for the product and will cause errors)
2. Create the values for the attribute
3. Create the product variations
using the values of the attribute created
After following the previous steps you will need to implement a custom solution where you will extend the EcommerceOrderCalculator
and override the CalculateAndSaveChanged()
method. You will need to iterate through all items in the cart until you get the product you want to modify. Here you will need to get the variation of the item and get the attribute values found in the Variant property to get the AttributeValueId, but you will need to deserialize this object before doing this. After this you should overwrite the Weight property of the product, with the weight established in the variation.
You will also need to add a Global.asax file and subscribe to the Bootstrapper_Initializer and register your custom class.
You should be able to see the changes to the shipping calculations after applying this solution.
I am attaching files with sample code as a reference for you to use in creating a custom solution to achieve this functionality, please use this at your consideration.
You may also refer to the following article for more details about the custom order calculator:
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal
and vote to affect the priority of the items