Post by harryo40 » Thu Jan 24, 2013 10:26 pm

How can I alert a customer registering a new account, if there name (frist or lastname) & the first line of there address has already been registered or how can I get the coupon to check against addresses and names instead of the coupon using customer_id?
Explanation as to why!
Basically, if you have a coupon set up to give new customers 10% off there first order, there is nothing to stop that customer opening another account (because it will be a new customer_id number) & then using the coupon code again on the next order.

It is quite surprising how many people will do / try this to save a few £££'s & it works because this part of the code in catalog/model/checkout/coupon.php...

Code: Select all

SELECT COUNT(*) AS total FROM `coupon_history` ch LEFT JOIN `order` o ON(ch.order_id=o.order_id) LEFT JOIN `address` a ON(o.shipping_address_1=a.address_1) WHERE ch.coupon_id = '" . (int)$coupon_query->row['coupon_id'] . "' AND ch.customer_id = '" . (int)$this->customer->getId() . "'");
checks to see if the coupon has been used, using the customer_id but I want to know how I can change this, so that it checks if the coupon has been used, with the customers address.
I have thought of LEFT JOIN the coupon_history with the 'order' & also 'address' like this...

Code: Select all

SELECT COUNT(*) AS total FROM `coupon_history` ch LEFT JOIN `order` o ON(ch.order_id=o.order_id) LEFT JOIN `address` a ON(o.shipping_address_1=a.address_1) WHERE ch.coupon_id = '" . (int)$coupon_query->row['coupon_id'] . "' AND o.shipping_address_1 = a.address_1
but that did't work ???

Add To Cart Confirm Ajax Popup for OC 1.5.1.3 --> 1.5.5.1 - Add to Cart Confirmation Popup
Image Map Banner Module - Image Map Banner Module
----------------------------------------------------------------------
Womens Famous Name Fashion Clothing at bargain prices - Next2nowt.com


Active Member

Posts

Joined
Wed Oct 21, 2009 3:37 am
Location - Blackburn, Lancashire
Who is online

Users browsing this forum: Bing [Bot] and 271 guests