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

Exclude Products from Percent Off Special Offers

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-07-2009, 01:53 PM
 
KurtVeloc KurtVeloc is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 37
 

Default Exclude Products from Percent Off Special Offers

We often run store wide sales but have to exclude certain products or categories. We have the xcart Special Offers module installed so I modified it to exclude the products that we don't want to have the sale applied to.

To do this open modules\Special_Offers\func.php and search for "case 'D':" and change it to:
Quote:

case 'D': # discount
if ($product_checked) {

if($product["discount_avail"] =="Y"){
if ($bonus['amount_type'] == '%') {
$discount = $product['price'] * $bonus['amount_min'] / 100.00;
$limit = price_format($bonus['amount_max']);
}
else {
$discount = price_format($bonus['amount_min']);
$limit = price_format($product['price'] * $bonus['amount_max'] / 100.00);
}
if ($discount > $limit && $limit !== '0.00') {
$discount = $limit;
}
if ($discount > $product['price']) {
$discount = $product['price'];
}
$apply['discount'] = max($apply['discount'], $discount);

}
}

Now any product that you want to exclude from a site wide sale in Special Offers just uncheck the "Apply Global Discounts" box in the Product Admin page.

If you have a ton of products from one company that you want to exclude and have access to php_myadim you can run the following script to update them (just add whatever your table prefix is and put in the company name
Quote:

update products set discount_avail = "N" where companyname = ""
__________________
X-Cart 4.1.6
Reply With Quote
  #2  
Old 02-03-2009, 10:47 PM
 
RobinThor RobinThor is offline
 

Member
  
Join Date: Mar 2008
Posts: 16
 

Default Re: Exclude Products from Percent Off Special Offers

Hi KurtVeloc,

I'm trying to apply discount via Special Offers as well, but i want to limit the discount to only one category.

Supposing using your method above, if I were to change the discount_avail from "Y" to "N", meaning "if($product["discount_avail"] =="N"){", will it work?

This is because I have quite a few discounts happening altogether, like the global discount and discount coupon.. is there a way to mod this?


Thanks!
__________________
Vi8e Interactive

X-Cart Gold 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 08:27 AM.

   

 
X-Cart forums © 2001-2020