Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Trouble with quantity discounts

Trouble with quantity discounts

Locked

Views: 1,334

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
17 Aug 2009, 12:51 AM
#1
kateb avatar

kateb

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

Trouble with quantity discounts

Hi! I am trying to use quantity discounts. This is the quantity discount feature that comes with Zen Cart, not any sort of add-on module. I am using version 1.3.8a with php 5.2.9. The basic problem is that although the proper discounts show up as a table at the bottom of the product page, they are not appropriately reflected in the shopping cart when the products are added.

I have read through several of the existing posts on quantity discounts and found the "known bug" fix in which you edit the shoping_cart.php file. I have done that. The affected parts of that file, as they currently stand for my shop are pasted in below. I really hope I did something wrong with that -- please let me know!

// reset($this->contents); // breaks cart
$check_contents = $this->contents;
reset($check_contents);
while (list($products_id, ) = each($check_contents)) {
$test_id = zen_get_prid($products_id);
if ($test_id == $chk_products_id) {
$in_cart_mixed_qty_discount_quantity += $check_contents[$products_id]['qty'];
}
}
return $in_cart_mixed_qty_discount_quantity;
}
/**

  • Method to calculate the number of items in a cart based on an abitrary property

and

// reset($this->contents); // breaks cart
$check_contents = $this->contents;
reset($check_contents);
while (list($products_id, ) = each($check_contents)) {
$test_id = zen_get_prid($products_id);
if ($test_id == $chk_products_id) {
$in_cart_mixed_qty += $check_contents[$products_id]['qty'];
}
}
return $in_cart_mixed_qty;
}
/**

  • Method to calculate item quantity, bounded the mixed/min units settings

The specific quantity discount settings that I have, for a representative product, are listed below. This is intended to give a 7 cent discount for 300 or more, and 14 cents for 600 or more. Base price is $1.40.

Discount Qty Applies to Mixed Attributes: No
Discount Type: Amount off Discount Priced from: Price

Level Min Qty DiscVal CalcPrice ExtendedPrice
Discount 1 300 0.0700 $1.33 x 300 = $399.00
Discount 2 600 0.1400 $1.26 x 600 = $756.00

If you want to see this in action, you can look at the following product page. Before adding anything to the cart, be sure you put something in the space provided for "Enter File URL" since that is a required text attribute.

http://www.podscriptgenie.com/index.php?main_page=product_info&cPath=1_8&products_id=6

I feel like I must be missing something really obvious with this. I would appreciate any help or suggestions anyone can offer!!

Thanks, and best wishes,

Kate

17 Aug 2009, 1:11 AM
#2
kateb avatar

kateb

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

Re: Trouble with quantity discounts

Hi -- me again.

I experimented around a little bit more and found that if I choose an attribute for that product, this causes some sort of error in the price calculation such that the price gets doubled.

The "product" I'm selling is transcription services. The base price for the product I referred to above is $1.40 / audio minute. If I add an attribute that should raise that to $1.50 / audio minute, it shows up in the cart as costing $2.80 / audio minute.

Any ideas??

Any help or suggestions appreciated!

Thanks,

Kate.

17 Aug 2009, 1:14 AM
#3
kateb avatar

kateb

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

Re: Trouble with quantity discounts

Sorry for this whole chain of posts. I should add that this doubling problem never showed up before trying to do the quantity discounts. We've had a lot of orders placed before then that used the attributes, and they were all fine.

Thanks!

22 Aug 2009, 9:28 PM
#4
kateb avatar

kateb

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

Re: Trouble with quantity discounts

I guess this has stumped everyone? Or did I post this problem to the wrong part of the forum? I seem to have a talent for posting things to the wrong area. If someone can let me know if I need to repost somewhere else, I'd appreciate it!

Thanks!

23 Aug 2009, 4:23 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Trouble with quantity discounts

What happens if you switch to the Classic Template?

Does it work?

23 Aug 2009, 4:26 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Trouble with quantity discounts

Also, do you have Price by Attributes turned on? If so, can you turn that off ...

23 Aug 2009, 10:41 PM
#7
kateb avatar

kateb

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

Re: Trouble with quantity discounts

OH. MY. GOD. I am officially awed.

I looked and, indeed, I had priced by attributes turned on. I barely even remember setting it up to be priced by attributes once upon a time -- I can't imagine diagnosing that just from the mystifying symptoms I described! I went in and unchecked that, and it seems to work perfectly now.

Thank you so much! Just a sec here -- I'm clicking on that link to buy coffee and donuts. You're amazing.

24 Aug 2009, 2:16 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Trouble with quantity discounts

You are most welcome ... and thanks for the coffee and donuts!! We really appreciate the support to help keep Zen Cart humming along to run your shop ... :cool: