Zen Cart Logo
Forums / Addon Order Total Modules / Quantity Discounts for 1.3

Quantity Discounts for 1.3

Views: 226,136

Results 1 to 20 of 847
13 Aug 2006, 10:22 AM
#1
swguy avatar

swguy

Administrator

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

Quantity Discounts for 1.3

My quantity discounts module has been posted in

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=235

You may discount by item, by category or by total items in cart, in either percentages or currency units. Up to five discount levels are provided. A link is given on the checkout page to show the customer how the discount was calculated.

Please follow up here for support.

Thanks,
Scott (swguy)

PS> One bug has been found already; for those who are using discount by total items in cart, please make this change:

change l. 149-151 from

      if ($count < $this->total_level_1)
           continue;
      $disc_amount = $this->total_discount_1;

to

      if ($count < $this->total_level_1)
         $disc_amount = 0;
      else
         $disc_amount = $this->total_discount_1;
13 Aug 2006, 2:02 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Quantity Discounts for 1.3

You have an interesting idea here, however ...

From a naming convention standpoint, you have broken pattern that could lead to conflicts with other Order Total Modules ...

You will notice how there is a pattern to the naming of the constants ...

You really want to maintain that pattern so that the module more or less "owns" the pattern ...

First you use this pattern:
MODULE_ORDER_TOTAL_QUANTITY_DISCOUNT_blah

But then you leap to:
MODULE_ORDER_TOTAL_LEVEL_blah

Then to:
MODULE_ORDER_TOTAL_DISCOUNT_blah

You may want to give that a think through and re-establish a pattern that more or less "belongs" to this Order Total Module so that there is less likelyhood of a colision in the configuration table or in the running of the module ...

Thanks again for the contrib ... looks interersting ... :)

13 Aug 2006, 2:55 PM
#3
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

Doooh! I thought I had changed that. You are absolutely right - database variables must stay in their own name space to prevent collisions. I will fix this in the next release and provide a cleanup procedure for people to get rid of the old variables.

Thanks,
Scott

15 Aug 2006, 4:31 AM
#4
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Hi,

Thanks for the contribution. I'm a new member and 'making' my way through a setup of Zen-Cart to replace my aging ws4d ecommence system.

I've tested your quanity discount submission, but I cannot get the category discount to work at all.
I added 3 items from the same category into my cart (which is calculated to discount 10%) but it won't discount it.
I changed over to Order Discount and that works correct.

Most importantly my question is this, can I assign an off/on to EACH category with the Quantity discounting module you created, or can it be modified to contain this?

I need some categories WITH this discounting and others with standard prices without discounts.

thanks so much,

Jeff Michaels
pres of Musical Creations Ltd.
Cary NC

15 Aug 2006, 9:28 AM
#5
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

To turn discounting on or off for particular items or categories, you'd have to
extend the code. In the next release (just a couple of weeks out), I'll mark specific places in the code where you can do this.

As to why it's not working: please check your settings and ensure they are:
discount units: percentage; discount basis: total by category; discount level 1: 3 (or 2); discount amount 1: 5. Then check the products themselves: when you go to admin->catalog->categories/products go to the category you want and make sure
all three items are in that category. (Oh, one more thing: are you running
ZenCart 1.3?)

Thanks,
Scott

15 Aug 2006, 12:10 PM
#6
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I think I know why it didn't work under categories....

I had all the test items gathered from the Hardware master category, but they were also from different sub-categories within Hardware. I guess they all have to be from the same sub-category also.

Here's what I'd like to do (and I'm currently doing in my old site). I have 5 discounts for mp3 downloads, 5 discounts for songs shipped on custom CDs (both by quantity level) and NO quantity discount for collection CDs and CDGs that are purchased on my site. This was all done under WS4D ecommerce back in 2004. The programmer has now disappeared, so I can't make any internal changes to the code (compiled). I've been looking for a solution to host on my OSX server for about a year and discovered Zen-Cart about a week ago. It does nearly everything I need out of the box...plus more. With 67,000 karaoke products and a current Filemaker Pro database in the office, it'll take till the end of this year to get it all up and running. I got the Filemaker to SQL transfer solved this past weekend with a plugin. Now, it's just the flow of the entire website that needs a lot of planning on paper before I actually begin to really import. The Quanity Discount module you created is one of many solutions that will make this happen for me. :D

thanks,
Jeff Michaels
http://www.musicalcreations.com

15 Aug 2006, 12:23 PM
#7
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

Interesting ... I considered adding subcategory support, but I thought for the first release that I would just use categories. Sub-category fans, please speak up
and let me know how you want this to work.

I'm pretty close to wrapping up version 1.1, which has support for user exits to easily modify discounts for specific items and categories and to allow certain categories and items to be excluded from discounting. I'm hoping to release this before the 8/25. I'll collect up the subcategory feedback I'm getting and do a follow up release a few weeks after that. Thanks!

Good luck,
Scott

15 Aug 2006, 12:44 PM
#8
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I just added a bunch of 'mice' from the Hardware category and the discounting worked.
If I add 3 different items from Hardware, but each under different sub-categories, it will not disount.

It seems you have sub-category discounting enabled already, not the master category.

This wouldn't be a problem for me when the 1.1 release allows me to turn on/off which parts I want to use under Quantity Discounts. Currently, it doesn't work for me as is. (I'm in the concept stage anyway, so no 'biggie' yet).

Quick side note: Do you know if "music genre", "record artist" and "record companies" can be added as separate searched in the Advanced Search? I'd like to first make them: Collection Title, Song Title, Artist (and others). This is critcal to my new site and will probably need custom programming help with.

Example is at: http://www.kararokewh.com
on top left with their QuickSearch.... more in their Advanced Search.

thanks,
Jeff Michaels

15 Aug 2006, 10:18 PM
#9
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

Hi Jeff! Please PM me with your email address so we can discuss.

Thanks,
Scott

16 Aug 2006, 10:48 AM
#10
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

I think there is some interest in setting discount thresholds by DOLLARS SPENT,
not by quantities of items where dollars spent (or other currency spent) could be tracked by item, by category, or by total number of items in the cart. It's not a hard change either - in fact, the only thing I'm having trouble with is thinking about what to call it! So if you want to discount by dollars and not by item count, please speak up and let me know what what you think the config item name should be, and any other config you think is needed.

Thanks,
Scott

17 Aug 2006, 12:03 AM
#11
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I prefer to have discounting by quantity, not be dollar amounts.
I'd just love to have the availibility of having it in sub-categories---as you mentioned.

I also found a problem while I'm coding.
I added an attribute and I selected
Apply Discounts Used by Product Special/Sale: NO
and the discounts are still coming up.

Can you check on this for me?

I selected 3 of the same items to do this as a test (if that helps)

thanks,
Jeff Warzecho

17 Aug 2006, 12:14 AM
#12
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

This mod does not share configuration with the other discounting features; it has its own
configuration. In the next release, there will be an easy way to exempt products from
discounting.

Scott

22 Aug 2006, 1:12 AM
#13
stephen avatar

stephen

New Zenner

Join Date:
Jul 2006
Posts:
12
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Would it be possible to alter the qty discount logic so that the discounts persist when adding greater quantities than what is set in the admin panel? So more items than the set discount quantity still get discounted.

For example if each item costs $10 and 9 items cost $90, then with a $1 per item discount, 11 items should cost $99. Currently 11 items cost $100. So the discount stops accumulating for quantities greater than the number set in the qty discount control panel, at least until you reach the next discount level.

Or am I not using this module correctly?

23 Aug 2006, 1:38 AM
#14
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

You are using it correctly, but the "discount by currency" is a flat discount.
Why not discount by % and give 10% off over 10? That would yield the result you seek.

Scott

25 Aug 2006, 5:52 PM
#15
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

The new Quantity Discounts module (version 1.1) has been posted at

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=235

This version has user exits for removing items and categories from
the discounting plan, and providing different discounting levels for
certain items and categories.

Thanks,
Scott

28 Aug 2006, 1:04 AM
#16
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

Generous discounters please note: there is a known problem with sales tax computation when combining either Group Discounts or Quantity Discounts with coupons (and probably other discounting mechanisms). See the following thread:

http://www.zen-cart.com/forum/showthread.php?t=43436

We're working on a solution.

Thanks,
Scott

31 Aug 2006, 3:22 AM
#17
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I have an interesting problem: I have a product that lists for $17.95 and I have entered a 4.1% discount to get the product for $17.20 when someone buys 6 to 11 of them and 8.1% to get the price to $16.50 if someone buys 12 or more. These are manufacturer requirements. This works out fine and is calculated correctly in the checkout process. But at the bottom of the product pages, the discounts are shown to have the product at $17.50 for 6 to 11 items and at $16.96 for 12+. My customers will not realize what the true discount is and will think I am overpriced vs my competitors. How does one rectify this?

Also, I really want the discount to cover a main category and ALL of its subcategories but it only discounts the subcategories individually and not all of them together under the main category. Can this be fixed? Thanks! Amy

31 Aug 2006, 9:48 AM
#18
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

How are you showing the discounts on the product page? Please provide an URL and post your Quantity Discounts settings.

Thanks,
Scott

1 Sep 2006, 12:17 AM
#19
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

http://www.doodlebuckets.com/fuzzi_bunz/index.php?main_page=product_info&cPath=16_17&products_id=60

Here is one of my product pages. (Please excuse the color schemes, I have not modified PurpleShades fully just yet!) To control inventory, I have a page for each size and color of diaper since Zencart does not yet track inventory for multiple attributes. For the small, medium, large and XL diapers, there is an MSRP structure as follows:

1-5: $17.95ea
6-11 $17.20ea
12+ $16.50 ea.

I put my settings at:

Discount Units
percentage

Discount Basis
Total Items in Cart

Discount Level 1
6

Discount Amount 1
4.2

Discount Level 2
12

Discount 2
8.1

I had to put it to "total items in cart" because doing it by "category" was not going to give me the discount I needed if someone ordered different sizes. It's odd, though (maybe you can tell me why...) but the quantity discounts only show up on my diaper pages anyway.

It would be nice if the mod included a way to enter what the item price was for each category and subcategory for the different #'s of items ordered, instead of percentages and then have it applied to all categories that I need it to be. At least that's what would work for me :)

If you notice at the bottom of the product page, the prices for the quantities do not match up with what gets calculated at checkout. Thus my dilemma...

Thanks for your help! Amy

1 Sep 2006, 1:16 AM
#20
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

The box you have at the bottom announcing your discounts is not produced by the
Quantity Discounts module; it's produced by products price manager. You seem
to have configured both Quantity Discounts and Products Price Manager.

Go into one of your products through admin and see if this isn't so. Quantity Discounts definitely did not produce that table of discounts.

Scott