0

I am using the Commerce Shipping Rate Field to set a unique shipping rate per product.

However, I would like to use this value in calculating another shipping value/service (commerce_shipping_price x 0.5). I can't seam to work out how to pull this value/field into a Calculation Rule.

How do I create a calculation Rule of 50% of the Commerce Shipping Price?

0

The problem you're facing is that shipping rates are calculated at the order level while your field exists at the product level. You can loop over the line items on an order to inspect this field value and then make calculations to the price based on what you find, but what do you do when the field value is different for different products on an order?

In my opinion, this logic is going to get confusing quickly to try and reproduce in Rules. I would favor writing a custom Rules action that inspects and sorts the product data in code, adjusting the price directly via the API instead of through the Rules UI.

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.