I'm trying to run a campaign in the Script Editor but have been running into this error:
[Error] undefined method 'run' for #<ApplyDiscountCodes:0x7f8ecfcc52b0>
I can only assume that I'm missing some fundamental syntax or rule but I cant identify whats going wrong with this basic script:
class ApplyDiscountCodes puts "Apply Discount codes" end CAMPAIGNS = [ ApplyDiscountCodes.new(), ] CAMPAIGNS.each do |campaign| campaign.run(Input.cart) end Output.cart = Input.cart
Also how do I prevent 'ApplyDiscountCodes' from running initially and instead waiting to be run through the CAMPAIGNS.each do function?
Solved! Go to the solution