What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Flow for checking discount code

Flow for checking discount code

AnthonyH2
New Member
4 0 0

Hey all, Im trying to count how many items in an order have a 0 sales price and how any have a > 0 sales price. The reason to do this is to tag orders containing a BOGO order. 

Can anyone advise on how to do this?

BTW - I have tried to simply flag the discount code attached to the order to then trigger the tag but this doesnt work either. 

Thanks so much in advance for any help. 


Replies 6 (6)

TDogs
Tourist
4 1 2

Hello @AnthonyH2 :

 

The discount code should appear under the order details: 

 

TDogs_0-1715804243060.png

 

Can you share details as to why this approach did not work?

 

Counting the items at each price level is possible, but would require using a run code action in the flow, which would be more complicated.  Also, it seems the price-based approach might catch other orders that are not BOGO, if there are other reasons items could be reduced to $0 (e.g., a reshipment for damaged items or a free gift promotion). Thus, using the discount code would be preferred, if it would preform the same result.

AnthonyH2
New Member
4 0 0

Hi TDogs, thanks so much for your reply. Ive reverted back to the simplest method by comparing the discount code to the code in the condition box as follows:

Its not picking up the B2G3FLASH discount code in the shopify order summary. I used order.discountCode as the condition attribute. 

The discount code is shown in the order summary, and it matches with the code in the order.



Flow diagram.jpg

Discount code .jpg

TDogs
Tourist
4 1 2

Hi @AnthonyH2 ,

 

Can you try using the newer field "Discount Codes"? It should be located just below the one you are using.

AnthonyH2
New Member
4 0 0

Hi @TDogs, thanks again, Im trying the new field.

Will let you know if i get it solved!


AnthonyH2
New Member
4 0 0

HEY @TDogs Im still having the Flow problem. 

Ive attached the order summary which shows that the discount code exists Flash24 
But in the flow result, the discount code is empty. 
Any ideas why this might be happening?

Order summary.jpg

Flow result.jpg




paul_n
Shopify Staff
1439 157 333

I'm not sure of the scenarios where discountCode is empty but there is a code. you could try discountApplications or the plural discountCodes. You can try rerunning that same workflow once you make changes. FYI, you can also use "log output" to show the output from those variables in the workflow run page

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.