Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

modifying promotional coupons to accept multiple products instead of just one

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-08-2017, 09:03 AM
 
madhatter717 madhatter717 is offline
 

Member
  
Join Date: Oct 2016
Posts: 24
 

Default modifying promotional coupons to accept multiple products instead of just one

hello,

I would like to modify our promotional coupons to accept multiple products, in the "product" input field at the bottom of the coupons creation page.

What files should I be looking at to make the modifications I want? Since it is dealing with the admin side I cannot use webmaster mode to identify the correct pages. I did use the Webmaster Kit module and was pointed to the admin .tpl's only. I did find a reference to Class\XLite\Modules\CDev\Coupons\View\Model\Coupon .php, but I am unsure what the name of the function I am looking for is. Any help locating the particular .php file and the name of the function I should be looking for would be greatly appreciated.

We have a very diverse set of products within our catalog, with a very aggressive marketing campaign, while I can assign multiple products through either the Product Class form field or the Product Category form field, there are occasions where our marketing dept, offers promotions for two kinds of product within the same Product/Category class but NOT to the rest of that Product/Category Class ( an example, one of our product lines is Brochures, Brochures have their own product class for the various kinds of brochures we offer within the Brochure Category. On occasion we offer a promotional discount to buy 2 brochures of the same class within the Brochure category, but NOT to all of the brochures inside that Brochure Product class/Category).

Currently to make these promotions work I have to add an additional temporary Product class which has the 2 items we want to specifically target. While not overly difficult, it is tedious and less than elegant.

The Product form field at the bottom of the Coupons page is the ideal solution for this particular problem, because it can apply the promotional discount to a specific product. The problem is it only allows for a single product to be used, I would like to change that.

Any help or guidance with this would be greatly appreciated.

Thank you
__________________
x-cart business 5.2.14
Reply With Quote
  #2  
Old 11-13-2017, 07:58 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: modifying promotional coupons to accept multiple products instead of just one

It is possible to customise X-Cart this way, however this requires creating a new module and hacking multiple classes and templates from it.

First of all, you should link the coupon model (\XLite\Module\CDev\Coupons\Model\Coupon) with the product model (\XLite\Model\Product) through a two-side @ManyToMany relation.

Then you should edit classes that displays the Edit Coupon form and add a widget that allows you to select products for a coupon.

Plus you should edit classes that implement the coupon discount logic and make it check for the linked products.

If you are unsure how to code the above, I believe you are better to hire someone who can program such a module for you.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:41 AM.

   

 
X-Cart forums © 2001-2020