Hey everyone! I'm new to this so please bear with me.
I currently have a cart script that is essentially running a bunch of rules based on customer tags. It's working well.
It gets started with this:
def apply(line_item) line_item.change_line_price(line_item.line_price * @discount, message: @message) end
What I'd like to do is wrap it in an IF statement so the rules won't apply if the line item is on sale, eg compare at price is greater than price, or even better, compare at price = nil. However I cannot get it to work!
def apply(line_item) if line_item.compare_at_price = nil line_item.change_line_price(line_item.line_price * @discount, message: @message) end end
Any clues would be very much appreciated!