User Tools

Site Tools


en:redeeming_coupons

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:redeeming_coupons [2013/09/15 20:46]
admin [Finding Coupons]
en:redeeming_coupons [2013/09/16 04:47] (current)
Line 66: Line 66:
 On next step we have to solve another issue. We’re displaying coupon number on ticket header but we’ll loose this information when we scan another coupon. You can forbid multiple coupons on a single ticket but for this example we’ll allow it. To be able to support multiple coupons on a single ticket we need to store coupon numbers on order lines. ​ On next step we have to solve another issue. We’re displaying coupon number on ticket header but we’ll loose this information when we scan another coupon. You can forbid multiple coupons on a single ticket but for this example we’ll allow it. To be able to support multiple coupons on a single ticket we need to store coupon numbers on order lines. ​
  
 +===== Storing Coupon Data on Order Lines =====
  
 +We’ll create a ''​Update Order State''​ action to store Coupon Numbers on order.
 +
 +{{:​en:​promotions:​coupons23.jpg?​700|}}
 +
 +This action updates ''​Coupon Number''​ state of the order. We’ll call this action from last ''​Ticket Entity Changed''​ rule we’ve created. So after adding free coffee order it will also update coupon number of the order line.
 +
 +So we can edit ''​Add Free Product when Coupon Loaded''​ rule and add this action after ''​Add Gift Order''​ action.
 +
 +{{:​en:​promotions:​coupons24.jpg?​700|}}
 +
 +As shown on the screenshot we'll type ''​{ENTITY NAME:​Coupon}''​ tag to read current Coupon'​s number from ticket entity and pass it to ''​Coupon Number''​ parameter of the action.
 +
 +After updating Coupon Number we can change Coupon’s Redeemed status as ''​In Ticket''​ so multiple scanning of a coupon number won’t generate multiple gifts. Since we’ll immediately update this data, scanning coupon from other terminals will also not work. This is a big issue for most POS software but we can solve it. We’ll call ''​Update Coupon Redeem Status''​ action to update Coupon. ​
 +
 +{{:​en:​promotions:​coupons25.jpg?​700|}}
 +
 +To be able to update coupon correctly we’ll set Coupon Number variable with ''​{ENTITY NAME:​Coupon}''​ tag. We’ll also use “In Ticket” as Value. ​
 +
 +We don’t need storing Coupon Number on ticket header anymore because we are storing it on order line. We can call ''​Load Coupon to Ticket''​ action to remove coupon from ticket header. It will also release coupon so since coupon entity is not assigned to a ticket we can delete redeemed coupons to keep your coupon list fresh and clean. ​
 +
 +{{:​en:​promotions:​coupons26.jpg?​700|}}
 +
 +We’ll enter * as Coupon number so it will remove Coupon from ticket header. Since this action changes Ticket Entity it will execute ''​Ticket Entity Changed''​ event again but we already prevented it from executing by adding a constraint for new entity name parameter and checking if it is different than *. 
 +
 +We can go back to POS screen and test what will happen after these changes. ​
 +Enter the Coupon Number again and hit enter.
 +
 +{{:​en:​promotions:​coupons27.jpg?​700|}}
 +
 +Perfect! We can see coupon number on order line and there is nothing on ticket header. Also typing same coupon number should not create additional orders because Coupon Redeem Status is ''​In Ticket''​. When you click on order line you shouldn’t see ''​Gift''​ and ''​Void''​ buttons. ​
 +
 +User can submit this order or cancel it by clicking on order line and clicking Cancel. We permit that because we give a chance to customer to change her mind before submitting ticket. Maybe she thought this is a free Breakfast coupon :) 
 +
 +On next step we’ll handle both cases. Cancel this order now and change Coupon Redeem Status by editing Coupon entity and changing Redeemed Field value to No.
 +
 +===== Canceling and Submitting Promotion Orders =====
 +
 +To be able to understand an order line is cancelled before submitted to kitchen we’ll handle ''​Order Cancelled''​ event.
 +
 +{{:​en:​promotions:​coupons28.jpg?​700|}}
 +
 +We’ll check if a coupon number attached to order that is being cancelled. We can use ''​{ORDER STATE:​Coupon Number}''​ tag to read assigned Coupon Number to the order. If it is not null we can update Redeem Status of the Coupon to No. So we can use that coupon again later. ​
 +
 +Now we’ll Change Redeem Status of Coupon to Yes when order submitted. We’ll create another rule for ''​Order State Updated''​ event. ​
 +
 +{{:​en:​promotions:​coupons29.jpg?​700|}}
 +
 +Like we did on previous rule we’ll check if there is a coupon number attached to the order and new state of the order is ''​Submitted''​. If so we’ll update Coupon as Redeemed by changing Redeemed field value to ''​Yes''​ and this coupon can’t be used again.
 +
 +Now test how it works. Scan a coupon number, scan it again, cancel it, scan it again and submit it. Create a new ticket and scan it again. It should work fine for all cases. ​
 +
 +Our Coupon Management Infrastructure is almost ready. You’ll notice SambaPOS generates no response when Coupon is already redeemed or scanned. On last step we’ll generate messages to inform operator. ​
 +
 +===== Creating Operator Feedbacks =====
 +
 +We’ll show a message to let operator understand why coupon code is not working. Let's create a “Show Message” action. ​
 +
 +{{:​en:​promotions:​coupons30.jpg?​700|}}
 +
 +When we call this action it displays a modal message to user. We’ll set message text from rule so we’ll configure Message parameter as a variable. [:Message] syntax creates a new value named as message. ​
 +
 +Now we’ll create another rule to check Coupon Status and display a message if it is already scanned. We’ll use “Ticket Entity Changed” rule for this. 
 +
 +{{:​en:​promotions:​coupons31.jpg?​700|}}
 +
 +When Loaded coupon Redeem Status is ''​In Ticket''​ we’ll display a message. Before displaying the message we’ll also remove coupon from ticket header. ​
 +
 +We need another rule to test if Coupon is already Redeemed. I’ll clone this rule and change related values.
 +
 +{{:​en:​promotions:​coupons32.jpg?​700|}}
 +
 +On Custom Constraints section we’re checking if selected entity is a Coupon and if yes we’re checking it’s status. If it is ''​Yes''​ we’ll display a message to warn user. 
 +
 +Now test it to see how it works. Since our previous coupon is already redeemed change it’s Redeemed value to No or create another one by selling a coupon. ​
 +
 +You can test these cases:
 +  - When we double scan a coupon code in a ticket we should see “Coupon already scanned” message.
 +  - When we submit a coupon and scan it again it should display “Coupon already redeemed” message.
 +
 +{{:​en:​promotions:​coupons33.jpg?​700|}}
 +
 +Our Coupon Management System is ready. Now we can sell and give free items with coupons. ​
 +
 +  * Back to [[Promotion Coupons Documentation]]
 +  * Next Topic > [[Printing Coupons]]
en/redeeming_coupons.1379263592.txt.gz · Last modified: 2013/09/16 00:46 (external edit)