How to make Coupon Item change total to **COUPON**

Ok I understand your flow now… So your listing Order Price and then Order Total for each line? But if its a coupon instead of listing Order Total you want it to say Coupon

It might be much better if it’s shown like this:

Product A…2…2000…4000
Product B…1…9000…Coupon <= this is redeemed coupon
Product C…1…5000… Free <= this is Gift

Tong Coupon: 9000
Tong Free: 5000
Tong Cong: 4000

Ok so your using Gift and Coupon’s both. You want it to say Free if it was gifted an Coupon if it was coupon where Order Total normally is? Right?

And you want the Order’s price to remain unchanged

Ok give me a minute I will see what is possible.

Yeah, that’s exactly what I mean kendash. :sunny:

Ok one quick thing. The action you used to update Gift State to Free. Can you show that action expanded so I can see how you did it?

Did you use Update Order State action… or did you use Update order Gift State action that was already premade?

I used the script premade in forum.

Ah, Free is my replacement word for Gift, I changed it in template only. Gift state should be the same everywhere.

I think this should work.

Add this above your [ORDERS:Gift] portion of the template:


-- Format for coupon redeemed orders
- {NAME}|{QUANTITY} | [=F(TN('{PRICE}'),'#,##0')] | FREE

Basically you told the state to be Free vs Gift. So [ORDERS:Free] should work.

If you look at the Action used in the Gift rule it will say Gift in the spot where you typed Free… however the actual status is GStatus… State is Free. [ORDERS:X] The X = State Name

So when it sees an order with the State of Free it will print the format you defined for [ORDERS:Free]

It shown nothing after insert the code:

I think I dont know what the state of my Coupon is. :frowning:

Ok hang on. we are getting somewhere It did not show because it was wrapped as expression and it found no value so it didnt print it.

So [ORDERS:Free] did work we just need to fix the other issue.

I need to look at that tutorial I think it is modifying price… so after using coupon {PRICE} probably has no value.

Can you find the rule that executes the coupon on the item? Expand it and expand the action. Action should be Update Order State or something similar

EDIT: Nevermind I just installed it on mine.

Try this [ORDERS:Coupon State] instead of [ORDERS:Free]

Okay I’m trying now.

[ORDERS:Coupon State]

– Format for coupon redeemed orders

  • {NAME}|{QUANTITY} | [=F(TN(’{PRICE}’),’#,##0’)] | FREE

It’s Printed, but the word Free not shown, it appear to be like normal, let’s me take a photo.

The strangest part is when I change [ORDERS:Coupon State] back to [ORDERS:Free]… the redeemed product dis-appeared.

ORDERS:Free must not exist. I am close give me little more.

EDIT: There are a lot of order states being changed including some on ticket close. I need to find the right state for you to call.

Give me some more time I am learning how the coupon system was setup. Did you modify it any? It looks like it was designed for coffee

The default setup is for Coffee. All I need to do to change it is:

  1. Go to Product List, create “VIT LON Cai Coupon”, with Tag “VIT LON Cai”

the script will auto read to Item Tag and put it up to be the redeemed item.

Try [ORDERS:Coupon Paid]

It not work. The way the scrip handle the state of the code is in the code’s entity. Wait, I’ll make a screencap.

Edit: My mistake, in entity, I can only find the Redeemed state as Yes, In Ticket, No…

I installed it… im looking at it now. You can change entity states without creating an actual state btw. It is changing order state multiple times through the transaction. I need to capture the state it is reading when you print bill.

EDIT: That would be the wrong state however I realize this now that was for a coupon thats paid.