This would all have to be customize ...
Currently, the Referral Code, even if used as a Discount Coupon still would need to be added during the Checkout on the checkout_payment ...
So you would need a link in an email to take the customer to the Login ...
That link would need to include the Discount Coupon code that could then be used for the referral code to pre populate the field ...
You could take it a step further that on the successful creation of an account that the Referral code is used to set the Discount Coupon ... but if there are any restrictions on the Discount Coupon it will fail as there is nothing in the shopping cart to validate the Discount Coupon ...
The other way the Referral can be done is to use the first Discount Coupon that the customer uses in the checkout ... this would then only need one entry of the Discount Coupon, providing the Shopping Cart Products qualify for the Discount Coupon ...
Another way to do all of this is to build in a check for the URL in the email where there is a code passed and that code is tested for being a valid Discount Coupon code ...
If valid, then per-populate the Referral Code on the create account and set that as the current Discount Coupon coupon_id on the session variable:
$_SESSION['cc_id']
then when the customer gets to the Checkout and the checkout_payment if the Discount Coupon is not valid for the Order it would be removed ...
This would take quite a bit of customization but it could be done ...
Granted, this would only work if the customer immediately creates an account, unless you take it a step further and try to set the
$_SESSION['cc_id']
from the referral code on the URL and it stays active during the session and the customer would eventually create an account and use that ...
However, if the customer's session times out, then the:
$_SESSION['cc_id']
would be lost and the customer would need to manually enter the Discount Coupon code during the create account and/or during the checkout_payment ...


Reply With Quote
