Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Discount Coupon Applicable for Regular Price Item Only?

Discount Coupon Applicable for Regular Price Item Only?

Locked

Views: 4,267

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
6 Mar 2007, 4:31 AM
#1
stenrique avatar

stenrique

Zen Follower

Join Date:
Apr 2005
Posts:
355
Plugin Contributions:
0

Discount Coupon Applicable for Regular Price Item Only?

I have set up a discount coupon and wish to make it applicable only to regular price items only. Thus far, I can only find restriction base on category and product. Is there a blanket restriction to "Deny" product(s) that are on promotion?

TIA

24 Jul 2007, 2:07 PM
#2
arovuo avatar

arovuo

New Zenner

Join Date:
Jul 2007
Posts:
13
Plugin Contributions:
0

Re: Discount Coupon Applicable for Regular Price Item Only?

Bump.

... or rather to have coupons to apply only on products, which are not having attribute name "gift" ?

... or alternatively, you have a product with attribute name of "Type" with three different values, where discount coupon would not apply if Type "xyz" is selected.

... or the ultimate answer for my need, the group discount applies only on products, where certain attribute is not existing.

How can I achieve that?

24 Jul 2007, 2:09 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Discount Coupon Applicable for Regular Price Item Only?

You would need quite a bit of custom coding done for this and may be better off posting in the Commercial Help Wanted to get the custom coding written for this ...

This is not an easy task ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Jul 2007, 2:17 PM
#4
arovuo avatar

arovuo

New Zenner

Join Date:
Jul 2007
Posts:
13
Plugin Contributions:
0

Re: Discount Coupon Applicable for Regular Price Item Only?

Oh, thought if someone had a ready-made solution so that I would not need to tweak the code myself... :)

24 Jul 2007, 5:56 PM
#5
arovuo avatar

arovuo

New Zenner

Join Date:
Jul 2007
Posts:
13
Plugin Contributions:
0

Re: Discount Coupon Applicable for Regular Price Item Only?

I figured, that following SQL gives me what I need to know:

select sum(products_quantityfinal_price(products_tax/100+1)) as sum from zen_orders_products where orders_id=27 and orders_products_id in (select orders_products_id from zen_orders_products_attributes where orders_products_id in (select orders_products_id from zen_orders_products where orders_id=27) and Products_options='Tyyppi' and product_attribute_is_free=1);

So, basically that SQL gives me the sum-value of the products ordered, where I want to apply group discount. ie. those products have been selected with certain attributes by purchaser.

in ot_group_pricing.php I found following line:

$discount = ($order_total - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;

Now, the only thing what I seem to need to do is to replace $order_total with the output of my SQL clause.

The only last problem is that I am not able figure out which variable contains the orders_id in ot_group_pricing.php

Ideas?

25 Jul 2007, 3:19 PM
#6
arovuo avatar

arovuo

New Zenner

Join Date:
Jul 2007
Posts:
13
Plugin Contributions:
0

Re: Discount Coupon Applicable for Regular Price Item Only?

Anybody interested, this is what I did, and it works: (for me)

// Mod - start
// $discount = ($order_total - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;

$normals = $db->Execute("select sum(p.products_price*b.customers_basket_quantity) as sum from zen_customers_basket b, zen_products p where b.products_id in (select ba.products_id from zen_customers_basket_attributes ba where ba.customers_id='" . (int)$_SESSION['customer_id'] . "' and ba.products_options_id=1 and ba.products_options_value_id=1) and p.products_id=substring_index(b.products_id,':',1);");

$discount = ($normals->fields['sum'] - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;
// Mod - end

What I wanted, is 10% discount given on products, which have certain attribute name and certain attribute value.
Above hardcoded mod inserted into ot_group_pricing.php and users in discount group, which has that 10% discount gives the desired results.

This effectively disables normal group discount system and may break something else as well ... :unsure: But serves the purpose for me :blink:

29 Jul 2007, 12:14 AM
#7
supplymydorm avatar

supplymydorm

New Zenner

Join Date:
Apr 2006
Posts:
22
Plugin Contributions:
0

Re: Discount Coupon Applicable for Regular Price Item Only?

So what you are saying is that if I have specials and on top of that a coupon/discount/newcustomer then I would be applying the discount on top of the specials?

So your option removes this? Did anything break?

--
"I dont want money or property most! I just want to be free!"

http://supplymydorm.com

29 Jul 2007, 2:25 AM
#8
arovuo avatar

arovuo

New Zenner

Join Date:
Jul 2007
Posts:
13
Plugin Contributions:
0

Re: Discount Coupon Applicable for Regular Price Item Only?

This mod has an effect only on the group discount module, other modules should operate as normal.

I have not noticed any unwanted behaviour because of this.