Yes, you are correct, the coupon system of power store was created with discounts in mind.
It is not really intended as a means for tracking purposes. a much better tool for tracking is to use Google analytics. This allows you to track incoming links to the store to determine where they are coming from.
We appreciate your feed back and will consider adding more tracking features in a future release.
If there are other features you would like to see considered, please post them to the wishlist forum.
As for the coupon name showing in the order receipt page, that is not something that the power store files do out of the box. you would need to edit the code to achieve this.
to show the coupon code for the order you will need to edit the orders_detail.php, the admin/orders_detail.php
on the orders_detail.php page:
change the recordset code:
$query_WADAorders = sprintf("SELECT * FROM ps4_orders LEFT OUTER JOIN ps4_users ON OrderUserID = UserID WHERE OrderID = %s AND UserID = %s", GetSQLValueString($ParamOrderID_WADAorders, "int"),GetSQLValueString($ParamUserID_WADAorders, "int"));
to:
$query_WADAorders = sprintf("SELECT * FROM ps4_orders LEFT OUTER JOIN ps4_users ON OrderUserID = UserID INNER JOIN ps4_coupons ON ps4_orders.OrderCoupon = ps4_coupons.CouponID WHERE OrderID = %s AND UserID = %s", GetSQLValueString($ParamOrderID_WADAorders, "int"),GetSQLValueString($ParamUserID_WADAorders, "int"));
you can then add the display of the coupon code under the section that shows ho much you saved.
edit the following code:
<tr>
<td class="label">You Saved:</td>
<td>-$<?php echo number_format($totalDiscount, 2); ?></td>
</tr>
to:
<tr>
<td class="label">You Saved:</td>
<td>-$<?php echo number_format($totalDiscount, 2); ?></td>
</tr>
<tr>
<td class="label">coupon code:</td>
<td><?php echo $row_WADAorders['CouponCode']; ?></td>
</tr>
you will need to make similar changes on the admin/orders_detail.php. change the recordset code:
to:
$query_WADAorders = sprintf("SELECT * FROM ps4_orders LEFT OUTER JOIN ps4_users ON OrderUserID = UserID INNER JOIN ps4_coupons ON ps4_orders.OrderCoupon = ps4_coupons.CouponID WHERE OrderID = %s OR ( -1= %s AND OrderID= %s)", GetSQLValueString($ParamOrderID_WADAorders, "int"),GetSQLValueString($ParamOrderID2_WADAorders, "int"),GetSQLValueString($ParamSessionOrderID_WADAorders, "int"));
then add the code to display the coupon code under the discount.
change:
<p>
<label class="readonly-bottom">Discount:</label>
<span class="discount errorText">-$<?php echo(number_format($totalDiscount,2)); ?></span>
</p>
to:
<p>
<label class="readonly-bottom">Discount:</label>
<span class="discount errorText">-$<?php echo(number_format($totalDiscount,2)); ?></span>
</p>
<p>
<label class="readonly-bottom">coupon code::</label>
<span class="discount errorText"><?php echo $row_WADAorders['CouponCode']; ?></span>
</p>
to show the coupon code in the recipt email, you could edit the line of code that shows the discount:
<tr>
<td style="text-align:left; font-weight:bold; color:#2D2B2E; /* Text_Dark */ padding: 10px 5px 10px 7px; border-top:solid 1px #FFFFFF; /* Global_White */">Discounts</td>
<td style="text-align:right; padding: 10px 14px 10px 5px; border-top:solid 1px #FFFFFF; /* Global_White */ color: #666666; /* Global_Gray */">-<?php echo WA_eCart_DisplayMoney($WA_Store_Cart, $WA_Store_Cart->GetDiscounts()); ?></td>
</tr>
to also show the code used:
<tr>
<td style="text-align:left; font-weight:bold; color:#2D2B2E; /* Text_Dark */ padding: 10px 5px 10px 7px; border-top:solid 1px #FFFFFF; /* Global_White */">Discounts <?php echo(isset($_SESSION['WA_ECart_Coupons'])?"Code Used: ".$_SESSION['WA_ECart_Coupons']."":""); ?></td>
<td style="text-align:right; padding: 10px 14px 10px 5px; border-top:solid 1px #FFFFFF; /* Global_White */ color: #666666; /* Global_Gray */">-<?php echo WA_eCart_DisplayMoney($WA_Store_Cart, $WA_Store_Cart->GetDiscounts()); ?></td>
</tr>
you would need to make this change in the WA_UniversalEmail/Email_Tempaltes/recipt.php, pp_recipt.php and admin_recipt.php files.