Created
July 23, 2012 15:55
-
-
Save BDQ/3164364 to your computer and use it in GitHub Desktop.
Create Spree::Promotion for free shipping via console.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p = Spree::Promotion.create(event_name: "spree.checkout.coupon_code_added", name: "Free Shipping", code: "FREESHIPBD") | |
p.promotion_actions << Spree::Promotion::Actions::CreateAdjustment.create() | |
pa = p.promotion_actions.first | |
pa.calculator = Spree::Calculator::FreeShipping.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gotta use Spree::PromotionBuilder