Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_add_4_40_for_two_x_250ml_bottles_shipped" : {
- "LABEL" : "Add $4.40 for Two x 250ML bottles shipped",
- "PLUGIN" : "reaction rule",
- "REQUIRES" : [ "rules", "commerce_line_item", "commerce_shipping" ],
- "ON" : [ "commerce_shipping_calculate_rate" ],
- "IF" : [
- { "data_is" : { "data" : [ "commerce-line-item:type" ], "value" : "shipping" } },
- { "data_is" : {
- "data" : [ "commerce-line-item:commerce-shipping-service" ],
- "value" : "up_to_two_x_250ml_bottle"
- }
- }
- ],
- "DO" : [
- { "LOOP" : {
- "USING" : { "list" : [ "commerce-line-item:order:commerce-line-items" ] },
- "ITEM" : { "250ml_line_items" : "250ML Line Items" },
- "DO" : [
- { "data_calc" : {
- "USING" : {
- "input_1" : [ "250ml-line-items:quantity" ],
- "op" : "*",
- "input_2" : "440"
- },
- "PROVIDE" : { "result" : { "calcualted_shipping_price_two_250ml_bottles" : "Calculated Shipping Price for Two x 250ML Bottles" } }
- }
- },
- { "commerce_line_item_unit_price_add" : {
- "commerce_line_item" : [ "commerce_line_item" ],
- "amount" : [ "calcualted-shipping-price-two-250ml-bottles" ],
- "component_name" : "flat_rate_up_to_two_x_250ml_bottle",
- "round_mode" : "0"
- }
- },
- { "commerce_shipping_delete_shipping_line_items" : { "commerce_order" : [ "250ml-line-items:order" ] } }
- ]
- }
- }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement