What would be the correct approach to implement this thing, so that a coupon can "Auto load in cart if possible" only if there is an affiliate, should I create a new plugin or should this option be added to the already existing coupon creation section in hikashop?
Can you guide me?
Thank you!
I was about to hit "submit" button but I checked a little more and noticed that in the Coupons option
Force affiliation to I can select current customer partner
With this option and the check below (where we check if there is a partner in the cookie), we can have a very powerful feature.
Because we will be able to create a single coupon that can be used in combination with any affiliate, without having to create a coupon for each affiliate.
$partner = JRequest::getCmd('hikashop_affiliate',0,'cookie');
if(empty($partner)) continue;
That will skip all the discounts if there is no partner.