If this is your first visit, check our documentation. To post, register or login.
Forums / Addon Order Total Modules / Quantity Discounts for 1.3

Quantity Discounts for 1.3

Started by swguy on 13 Aug 2006, 10:22 AM · Views: 226,694

Results 441 to 460 of 847
23 Sep 2009, 5:02 PM
#441
wk4hm avatar

wk4hm

New Zenner

Join Date:
Jan 2007
Posts:
24
Plugin Contributions:
0

Quantity Discounts for 1.3

we use a michigan state tax for only orders in mi but your quantity discount puts the tax on every transaction, do you know how I can fix this?

Thank you very much for your time.

12 Oct 2009, 5:26 PM
#442
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I'm running 1.38a using the quantity discount module as well as the discount preview mod. I have set up my discounts simply to be an absolute $ discount depending on the quantity ordered...with no limitations based on category, etc. This is working fine. Now, I wanted to temporarily offer a category specific coupon using the regular zen-cart discount coupon system...but I am running into a problem.

To simplify things, assume all of my products are $5.00 each. I offer a $1 quantity discount for each product with the purchase of 5 or more products.

Now I want to offer a 12% discount coupon only on one category. When I use that coupon and only choose products within that category, the system works fine. However, if I choose products both within and without that category it does not work properly.

Here is what happens. If I order 5 products all within the discounted category...the checkout shows something like this: Total $25...quantity discount $5...discount coupon....$2.40... (That is the correct amount, namely that it applies a 12% discount based on the $20 price reflected after first applying the quantity discount.)

However if I then add a 6th product which is not within the discounted category...I get the following: Total $30....quantity discount $6....discount coupon $2.28....(What has happened is that the discount coupon, instead of calculating based on a total of $20 is instead applying the discount to only $19. This apparently results from the coupon correctly applying the discount to the correct number of products (5)...but basing the $ amount of the discount by deducting all of the quantity discounts, not just the quantity discounts applicable to the products for which the coupon is intended.)

So I wondered if there is a workaround for this problem?

Thanks

12 Oct 2009, 6:15 PM
#443
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

Try changing the sort order of coupons so that it is before quantity discounts.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

12 Oct 2009, 7:06 PM
#444
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

swguy:

Try changing the sort order of coupons so that it is before quantity discounts.

I just tried that but it does not solve the problem. In case I was unclear before I do want the discount to be taken on the price after the quantity discounts....but only as to those products which are included within the category where the coupon applies.

If I change the sort order as suggested then the 12% discount is applied to the Sub-Total price (i.e. the price before the quantity discount.)

So in the examples I gave before, with 5 items priced at $5 each the coupon then incorrectly becomes valued at $3 instead of $2.40(i.e 12% of $25 instead of 12% of $20).

The only good news is that when I then add a 6th item (which is not part of the coupon discount) then the coupon discount does not change....it remains at the (incorrect) amount of $3.

So I still am unable to correctly apply a discount coupon restricted to just one category when I have quantity discounts applied to all categories.

13 Oct 2009, 10:30 AM
#445
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

maineiac13:

So I still am unable to correctly apply a discount coupon restricted to just one category when I have quantity discounts applied to all categories.

Yes, you would need to write software to do what you want to do.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

13 Oct 2009, 10:34 AM
#446
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

Quick reminder for new users and people who just want to learn more about Quantity Discounts: there is extensive documentation, examples, code fragments, frequently asked questions, etc. available on my home page. The link is in the readme file, or you can just go to my home page and click the Zen Cart link and search for Quantity Discounts.

I only update the readme file in the contribution when I update the software, but the documentation on my home page is updated constantly. Quantity Discounts is over three years old, so chances are, someone has had the same questions you're having and I've put answers on this page.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

5 Nov 2009, 6:06 PM
#447
travellers avatar

travellers

Zen Follower

Join Date:
Oct 2008
Posts:
143
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

swguy:

Quantity Discounts is over three years old, so chances are, someone has had the same questions you're having and I've put answers on this page.

I'm positive someone has asked this before, if only because the link I followed to the mod explicitly said it, but unfortunately zen search won't find it using any strings I can think of that might have found it!

On the FAQ in your Better Together page, one of the questions is: > Can I do three for the price of two? Four for the price of three?and the answer was > No. But Quantity Discounts can do this sort of discounting.. So, went there, installed that, but I'm going crazy here - I can't see anything that will permit me to effectively have 'buy three items from x cat, get the third free'. Yes, I could code a 33% discount in there which would make the above example work, but what about where items in category x have different prices? Basically then, we're looking for 'buy three items, get the cheapest free'. I thought from the text on the QD page that such a thing is feasible - am I wrong?

The instructions say Insert Disk 3, but only two will fit...
https://www.shedtraders.co.uk
https://www.tobermorychocolate.co.uk

5 Nov 2009, 7:30 PM
#448
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

I should change this wording because it's confusing. The real answer is, "you can do this with Quantity Discounts if you're willing to write code and use the user exits. "

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

9 Nov 2009, 4:13 AM
#449
sgt_slaughter avatar

sgt_slaughter

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I'm running into an issue where The Quantity Discounts is not calculating my taxes properly.

Basically I in my order total table I have a subtotal (class ot_subtotal) and a shipping (ot_shipping).

I have 2 seperate tax groups for these.

When I have a quantity discount, when It calculates the tax it is doing the following:

  1. (subtotal - Quantity Discount) * product_tax_rate
  2. (shipping - Quantity Discount) * shipping_tax_rate

As you can see this causes a problem as it is discounting the quantity discount twice for (only for the calculating of tax).

While this doesn't seem like much, each transaction I'm not charging approx $1 of tax that I have to pay to the government...

Anyways any help would be appreciated. I haven't yet went into the quantity discount code to look at things as I would rather not have to :)

9 Nov 2009, 6:33 AM
#450
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

Your only option at this point is to set recalculate tax to none so the customer is responsible for the original level of taxes.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

11 Nov 2009, 10:02 PM
#451
bassface avatar

bassface

New Zenner

Join Date:
Jan 2005
Location:
Aurora, CO USA
Posts:
71
Plugin Contributions:
1

Re: Quantity Discounts for 1.3

Hi all!

I am looking for a mod that does exactly what this one does! - almost! A few questions then, yes?

  1. If I add a category to the exclude_category() function, does that exclude it from the order product count or does it exclude that category from getting the discount?

  2. Tough one I think:
    I have set it up on my test machine and set Discount 1:

[B]Discount Basis[/B]
Total Items in Cart

[B]Counting Method[/B]
items

[B]Discount Level 1[/B]
12

[B]Discount Amount 1[/B]
10

I am wondering if I can modify it to do what I need, here is my situation:
My store sells items **individually **or sometimes by the case (a case *always *= 12 individual items).

If a customer buys a case of Item1 and a single Item 2, I need this to equal 13 items, not 2 items, and trigger the 10% discount on Item 2 only. My case items are mostly in their own categories, btw.

Thanks in advance for any guidance!

11 Nov 2009, 10:04 PM
#452
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

  1. both
  2. response by PM.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

17 Nov 2009, 1:19 AM
#453
bassface avatar

bassface

New Zenner

Join Date:
Jan 2005
Location:
Aurora, CO USA
Posts:
71
Plugin Contributions:
1

Re: Quantity Discounts for 1.3

swguy:

  1. both
  2. response by PM.

Thanks! While I did manage to modify the mod to do what I described in my earlier post, it seems I misunderstood my client. Turns out the mod does just what they need 'right out of the box'!
Oh well! :P

18 Nov 2009, 9:58 PM
#454
pe1234ter avatar

pe1234ter

New Zenner

Join Date:
Mar 2009
Posts:
28
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I have little problem with the Quantity Discounts Mod.

I want to setup discount by dollar spend, it works fine on USD but not on other currency.

for example, order sub-total with US$20 will get 5% discount, but discount do not apply for order sub-total with GBP£19

how to make the Quantity Discounts Mod support multi-currency?

thanks

18 Nov 2009, 10:10 PM
#455
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

There's nothing built in to do this; you'd have to write code.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

19 Nov 2009, 11:51 AM
#456
svschouw avatar

svschouw

New Zenner

Join Date:
Oct 2007
Posts:
2
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

There's a small bug in calculating taxes:

in ot_quantity_discount::calculate_deductions() you calculate individual tax group tax deductions, and the total tax deduction.

$od_amount[$key] = $tod_amount = round((($od_amount['total'] * $tax_rate)) /100, 2) ;
$od_amount['tax'] += $tod_amount;

However, in ot_quantity_discount you only update the tax groups, and not the total tax. This causes problems if further order total modules calculate further discount, because they need the base price with $order->info['total'] - $order->info['tax'], but the latter isn't correct anymore.

The fix is simple:

Add this line:

$order->info['tax'] = $order->info['tax'] - $od_amount['tax'];

Just around this line:

$order->info['total'] = $order->info['total'] - $od_amount['total'];
19 Nov 2009, 12:09 PM
#457
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

Interesting - thank you for posting. Is this still required if the sort order of tax is after Quantity Discounts? What are your other tax settings?

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

2 Dec 2009, 7:18 PM
#458
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I set up the Exlude categories: Here is the code:

class ot_quantity_discount {
var $title, $output;
var $explanation;

// Add categories you wish to exclude to this list.
// Go to Admin->Catalog->Categories/Products and look 
// at the left hand side of the list to determine 
// category id.   Note that 99999 and 99998 are just given
// as examples.
function exclude_category($category) {
    switch($category) {
       case 5:
       case 106:
       case 351:
       case 119:
       case 357:
       case 256:
       case 255:
            return true;
    }
    return false;

But it is still discounting all items from category 5. Any thoughts?!?!?

Thanks!

Melanie

2 Dec 2009, 7:20 PM
#459
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Quantity Discounts for 1.3

I wrote a page on how to debug problems like this.

http://www.thatsoftwareguy.com/zencart_category_issues.html

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.