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 381 to 400 of 847
3 Apr 2009, 6:50 PM
#382
jbillens avatar

jbillens

New Zenner

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

Re: Quantity Discounts for 1.3

Hello:

I have hit a wall with my website. I have installed the quantity discount addon and it works perfectly. The user exits are a great feature. My problem is I need to be able to use the user exits for only a select group of members. Is it possible to merge both group pricing and quantity discounts so that only people in group a get the quantity discount. I have seen this asked before but never an answer to the problem. I know there is going to have to be some programming here but do not know where to start. Any help is much appreciated.

Josh

5 Apr 2009, 6:58 PM
#383
sailman avatar

sailman

New Zenner

Join Date:
Mar 2009
Location:
Seattle
Posts:
13
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Quantity Discount Levels For Separate Categories:

SWGuy: I have seen this question posted 4 times in this thread, (and it is a long one) with no real answer.
ZC version 1.3.8 - your Quantity Discounts module 1.10 installed and working.
The Admin/Order Totals/Quantity Discounts is installed, no tax or tax calculations, discount units by percentage, Discount basis by category, counting method = Items.

There are no standard Zen Cart discount structures applied in the whole shop. The only other mods are Purchase Order (a payment mod encountered only after Order Totals) and Columns.

The discount structure applied in the Admin/Order Totals/Quantity Discounts module is: 5 to 10 items=5% discount, 10+ is 10%. The rest are blank. This works OK, and discounts are excluded on the "Excluded Categories" in the modules/order_totals/ot_quantity_discount file.

The basic problem is that the user exit for categories with separate discount policies will NOT override the default discount listed in the Admin section.

Here is the code from that section of ot_quantity_discount.php

// Add categories with special discounting policies to this list.
// Note that 99999, 99998 and 99997 are just given as examples.
// Note that the Discounting Units you specified in Admin
// (percentage, currency, currency/item) are also used here.


function apply_special_category_discount($category, $count, &$disc_amount) {
switch($category) {
case 29:
if ($count > 10) {
$disc_amount = 5;
}
break;
case 99997:
$disc_amount = 75;
break;
}
}

Here's the deal: If I order 9 of the units in Category 29, I should get no discount. But I get the standard 5% as entered in Admin. I will eventually expand this to have different discount rates on about 5 other categories, and order and install most of your commercial mods, but I have to get this working first.

Yes, this the correct parent category for the products listed under it. I am also required to make the discount for the same category go to 10% if 25 items are purchased. I tried it various ways, but syntax errors on my end crashed the page when trying to add the next level into this code section. Let's keep it simple and get a single one working first........

Any advice would be appreciated.

5 Apr 2009, 7:19 PM
#384
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

You have not coded the behavior you want explicitly. Instead of:

case 29:
if ($count > 10) {
$disc_amount = 5;
}

it sounds like you want

case 29:
if ($count <= 10) {
  $disc_amount = 0;
} else if ($count > 10) {
  $disc_amount = 5;
}

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 Apr 2009, 9:18 PM
#385
sailman avatar

sailman

New Zenner

Join Date:
Mar 2009
Location:
Seattle
Posts:
13
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Thanks for the fast response. I am trapped over the weekend in Toronto in a hotel with nothing to do, but you should take more time off.......

That part almost works. I tried the "else if" statements before bugging you, but had the brackets in the wrong place. (I guess that's why you make those big bucks....) I am an HTML wizard, but PHP isn't as forgiving.

Anyway, that works, except for when I enter 10 items exactly. 9 items shows no discounts at all, and 11 gives me 5%, but 10 exactly gives me the default 10% in the Admin setup.

function apply_special_category_discount($category, $count, &$disc_amount) {
    switch($category) {
       case 29:
    case 30:
		if ($count <= 9) {
		$disc_amount = 0;
		} else if ($count > 10) {
		$disc_amount = 5;
		}

I need to also have the ability to change the discount to 10% if the items exceed 25. I have searched high and low on your pages and the forums while attempting to make it happen, and crashed the PHP repeatedly in my attempts.

You get enough of the whiners wanting freebies, but lastly, the override of the category discount in this page does not seem to add up the totals between the two (or more) listed categories to determine the discount level. The default settings in the Admin section of your mod work perfectly in the categories that don't need the override........

Is this a syntax error on my part, or is this something you could do for me on a commercial basis?

Thanks again, and try to get out more.......:smile:

5 Apr 2009, 9:24 PM
#386
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

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.

10 Apr 2009, 3:44 PM
#387
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Hi,

I've noticed an error in the amount of tax displayed in the transaction as follows:

I am in the UK with tax rate of 15% applied to goods and shipping. For the purposes of this example i am using a product at £10 with a discount rate of 10% and free shipping.

The checkout totals should be:

Sub-Total: £100.00
Free shipping (Free shipping): £0.00
Quantity Discount: -£10.00
Included VAT @ 15%: £11.74
Total: £90.00

However, they are displaying as follows:

With Include Tax: True, Recalculate tax: None:

Sub-Total: £100.00
Free shipping (Free shipping): £0.00
Quantity Discount: -£10.00
Included VAT @ 15%: £13.04 (the tax on £100 - incorrect)
Total: £90.00

With Include Tax: False, Recalculate tax: None:

Sub-Total: £100.00
Free shipping (Free shipping): £0.00
Quantity Discount: -£8.70
Included VAT @ 15%: £13.04 (the tax on £100 - incorrect)
Total: £91.30

With Include Tax: True, Recalculate tax: Standard:

Sub-Total: £100.00
Free shipping (Free shipping): £0.00
Quantity Discount: -£10.00
Included VAT @ 15%: £11.54 (the tax on £88.50 - correct)
Total: £88.50

With Include Tax: False, Recalculate tax: Standard:

Sub-Total: £100.00
Free shipping (Free shipping): £0.00
Quantity Discount: -£8.70
Included VAT @ 15%: £11.73 (the tax on £89.99 - correct)
Total: £89.99

Therefore, none of the combinations allow the checkout totals to display correctly. The discount should include the tax and the tax should be calculated based on 15% of the total, not 15% of the subtotal.

Any help on this issue would be much appreciated.

1 May 2009, 6:25 PM
#389
jacka avatar

jacka

Zen Follower

Join Date:
Nov 2007
Location:
Dallas, Texas USA
Posts:
180
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

I just successfully loaded this mod and all is working, except I still see "Sorry, there are currently no Quantity Discounts" after editing the promo page in the define_pages editor. I do have a discount setup, using your mod, based on % of the total purchase. Am I missing something?

Thanks for a great mod and I'll make a donation.

Jack

Zen Cart v. 1.3.8

1 May 2009, 7:27 PM
#390
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

Hmmm...

./includes/modules/pages/quantitydiscounts_promo/header_php.php

has not been installed? Perhaps Quantity Discounts isn't installed under Admin->Modules->Order Total?

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.

1 May 2009, 8:03 PM
#391
jacka avatar

jacka

Zen Follower

Join Date:
Nov 2007
Location:
Dallas, Texas USA
Posts:
180
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Those are installed.

The discount is computed on the Step 2 of 3 page, but I am referring to the promo page with the link on the sidebox. The page that is editable from the define_pages editor, where the discount is explained. I temporarily took it out of the php file for now, but activating the mod doesn't automatically do so.

21 May 2009, 3:33 PM
#392
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Hi swguy,

I've been having some problems with the way that ZC is calculating the tax percentage on orders. It appears to have been cleared up for the discount coupon module, but not for the Quantity Discount one.

When:
Include Tax
true

Re-calculate Tax
None

Sub-Total: £100.00
Free Shipping: £0.00
Quantity Discount (10%) :-£10.00
Included VAT @ 15%:£13.04 (incorrect)
Total:£90.00

When:
Include Tax
false

Re-calculate Tax
Standard

Sub-Total: £100.00
Free Shipping: £0.00
Quantity Discount (10%) :-£8.70
Included VAT @ 15%:£11.73
Total:£89.99

Any help on this would be much appreciated.

24 May 2009, 10:00 AM
#393
unicorn avatar

unicorn

Zen Follower

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

Re: Quantity Discounts for 1.3

Please help?

I moved the category I used QD for up to top level, and then the mod stopped working altogether.

I tried moving the category back, and I've tried making a new category - nothing works. :no:

What to do?

http://www.hjemmemamma.com/nettbutikk

24 May 2009, 10:11 AM
#394
unicorn avatar

unicorn

Zen Follower

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

Re: Quantity Discounts for 1.3

Never mind, it just magically started working again, I've no idea why... :)

30 May 2009, 8:33 AM
#395
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

JackA:

Those are installed.

The discount is computed on the Step 2 of 3 page, but I am referring to the promo page with the link on the sidebox. The page that is editable from the define_pages editor, where the discount is explained. I temporarily took it out of the php file for now, but activating the mod doesn't automatically do so.

I have this same problem. However, my discounts are special discounts defined in the ot_quantity_discount.php file.

Shouldn't these discount show on the discount promo page?

30 May 2009, 10:03 AM
#396
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

shocker:

I have this same problem. However, my discounts are special discounts defined in the ot_quantity_discount.php file.

Shouldn't these discount show on the discount promo page?

The discount promo page just shows the settings you have for QD in admin. If you've done special things in ot_quantity_discount.php, you need to edit the define page for the promo page and add some text.

I can't reverse engineer your mods and describe them for your customers. :)

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.

30 May 2009, 10:32 AM
#397
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

swguy:

The discount promo page just shows the settings you have for QD in admin. If you've done special things in ot_quantity_discount.php, you need to edit the define page for the promo page and add some text.

That kind of makes sense. I just wanted to be sure the mod was working properly.

Just a note: the following documentation is incorrect when it states:

Q: I only want discounts applied to items in category 11. How do I do this?
A: Update the function exclude_category() in includes/modules/order_total/ot_quantity_discount.php as follows: 
    function exclude_category($category) {
        switch($category) {
           case 11:
                return false;
        }
        return true;
    }


Q: I don't want discounts applied to items in category 7. How do I do this? 
A: Update the function exclude_category() in includes/modules/order_total/ot_quantity_discount.php as follows: 
    function exclude_category($category) {
        switch($category) {
           case 7:
                return true;
        }
        return false;
    }

Please forgive me if I'm not understanding something.

30 May 2009, 1:22 PM
#398
swguy avatar

swguy

Administrator

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

Re: Quantity Discounts for 1.3

shocker:

Just a note: the following documentation is incorrect ...

The documentation is not incorrect. This is how it works. If it's not working for you, you have one of the category issues which I documented on this page.

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.

1 Jun 2009, 11:51 AM
#399
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

accidentally duplicated my post

1 Jun 2009, 11:53 AM
#400
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: Quantity Discounts for 1.3

Ok, please clarify

I have no linked products. The category I want to apply a discount to is category 27 (see diagram below)

Men's Clothing (10)
|
----> Stylish Shirts (27)
| -------> shirt A
| -------> shirt B
| -------> shirt C
|
----> Batik Shirts (16)
| -------> shirt A
| -------> shirt B
| -------> shirt C
So I made the following edit to ot_quantity_discount.php

    function apply_special_category_discount($category, $count, &$disc_amount) {
        switch($category) {
          [B] case 27:           // Discounts Stylish shirts[/B]
                if ($count > 1) {
                   $disc_amount = 10; 
                }
                if ($count > 4) {
                   $disc_amount = 20; 
                }
                break; 
           case 99997:
                $disc_amount = 0;
                break;
        }
    }
```is this the recommended method?