Jump to content
Latest News: (loading..)
swguy

[Contribution] Quantity Discounts by That Software Guy

Recommended Posts

Great work Guy!

I noticed a little issue with order editor. In admin/edit_orders.php, when the quantity of items is modified to a quantity under the first level (a quantity without discount), the order editor refreshes and shows the order total correctly, but it continues showing a 'Quantity Discount' line with the previous discount amount that creates confussion.

 

Thanks Guy!

 

Glad it's working well for you.

 

I believe that if you're editing the order manually, you need to edit the discount too.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

I have tested it again on a clean osc2.2rc2a with order editor 5.0.6.6. only. I corroborate the issue.

In admin/edit_orders.php, when the quantity is modified, the discount and all the other order_total lines refresh correctly. But when the new quantity is without discount (under the first level of quantity discount) the quantity discount's line on order_total doesn't disapears, and shows the previous amount of discount as a string, instead of showing as an input to be manually edited. Although the total cost of the order is showed correctly.

Thanks Guy for your interest!

Share this post


Link to post
Share on other sites

It sounds like perhaps you're running osCommerce MS2 and an early copy of this contribution? If you download the latest copy of this contrib, this issue has been fixed.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

yes it's oscommerce ms2, i tryed the first contributions and i found that error... so i installed the second one but with no positive results.

Is it an error of my shop ? or anything else ?

Share this post


Link to post
Share on other sites

You will need to delete the original database entries by hand and reinstall the latest one. BTW, you really should upgrade to the latest osCommerce.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Dear swguy,

 

Thank you for your interesting contribution.

Unfortunately I could not make it work for my client store. The contribution shows up in the check out page as below:

 

 

Sub-Total: 150.00$

Quantity Discount: -37.50$

Free Shipping: 0.00$

TPS: 7.50$

TVQ: 11.81$

Total: 169.31$

 

However, as you could see the total function ignores the discount line.

Here is my admin config:

 

Quantity Discount

 

 

This module is installed

true

 

Sort Order

2

 

Include Tax

false

 

Re-calculate Tax

Standard

 

Discount Units

percentage

 

Discount Basis

Total Items in Cart

 

Counting Method

currency

 

Discount Level 1

100

 

Discount Amount 1

25

 

Discount Level 2

0

 

Discount Amount 2

0

 

Thank you in advance.

Edited by samad

Share this post


Link to post
Share on other sites

Hi swguy,

I have experimented an issue with Quantity Discounts working with products of different taxes, the order total, at checkout_confirmation.php, is not being calculated correctly. I have only tested with 2 products with 2 diferent simple taxes, not compounded taxes.

 

I didnt find a solution for this issue.

¿Has someone solved this problem?

 

Thanks for your work!

Share this post


Link to post
Share on other sites

Hey swguy,

 

I found an issue in the taxes line of order total, and I think I have solved with success.

When DISPLAY_PRICES_WITH_TAXES = true you have to configure ot_quantity_discount with 'Include Tax = true' and 'Re-calculate Tax = None'. This causes an error: the taxes line of order total does not show the tax discounted.

 

I solved this issue with the next code. I would like to know your opinion about it, Thanks!!

 

At modules/order_total/ot_quantity_discount.php, on function calculate_deductions(), near line 478, inside switch ($this->calculate_tax), I have added a new case:

 

    case 'None':
      reset($order->info['tax_groups']);
      while (list($key, $value) = each($order->info['tax_groups']))
      {
        $tax_rate = $this->get_tax_rate_from_desc($key);
        if ($tax_rate > 0) {
          $od_amount[$key] = ($od_amount['total'] * $tax_rate) / ($tax_rate + 100);
          $order->info['total'] += $od_amount[$key];
        }
      }
      break;

Share this post


Link to post
Share on other sites

TROQUELADO, this looks a bit like setting recalculate tax = Standard. If this works better for your situation, great!


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

I wanted to find out if I can use this contribution to work with a payment module called deposit payments. I want to use the percentage discount for one item based on the fact that they are paying right away. If they use the 25% or 50% deposit payment then the discount will not apply. Is this possible to do? What would I have to do to make it work?

Share this post


Link to post
Share on other sites

I wanted to find out if I can use this contribution to work with a payment module called deposit payments....

 

You're going to have to write a bunch of glue logic; these things don't know about each other out of the box. I wouldn't know how to do it unless I did it so I really can't advise you.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Hi, thank you for the Contrib.

It Works fine, but i've a small issue.

 

I've defined all 5 Levels

 

1) 250$ to 2%

2) 500$ to 5%

3) 1000$ to 8%

4) 2500$ to 13%

5) 3500$ to 15%

 

the Calculation is ok and work. If i klick in the overview on the link to open the java Window, then this work for Level 1 and 2, if i have more than 1000$, then i got a Failuremessage in the Explorer "failure on the Site", thats all, the order can finished without problems.

have you an idea what the Problem can be in this case? its not important, its just a (in german we say - Schönheitsfehler) an i dont no how its called in english :-)

 

thnk you

Share this post


Link to post
Share on other sites

I have never heard of this problem. You could just not use the javascript popup.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Has anyone attempted this contribution in CRE Loaded?

 

Wouldn't it be best to ask this question on the CRE forum?


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Hi, thanks for a great mod -- appreciate especially the unique install files :)

The discount pportion is working fine, but I'm having a problem with getting it to calculate tax correctly -- I've got it set so that tax sort order is larger, tax calc=standard, per the instructions, but it seems to be calculating on the discount, rather than the subtotal -- am I missing something? I've been back and forward over the help pages and this forum -- and the tax situation mentioned above doesn't seem to be my issue.

The discount is by item (12) and amount (9) so that's fine

 

Here's a check out Example:

Sub-Total: $39.00

Flat Rate (Best Way): $5.00

Quantity Discount: -$9.00

HST: $1.08

Total: $36.08

 

The HST rate is 12% - and the sort orders above are, very simply, 1,2,3,4,5

 

thanks for any help, or even a place to look

Edited by chepierre

Share this post


Link to post
Share on other sites

Hi Scott, thanks for the contrib.

 

I've installed this and it works fine with a single category included, though I had to reverse your logic to get it to work to this:

 

function exclude_category($category) {

switch($category) {

case 22:

return true;

}

return false;

 

Using your logic (false, true) didn't work. However, when I try to change it to two sub-categories, i.e:

 

function exclude_category($category) {

switch($category) {

case 24:

case 137:

return true;

}

return false;

 

It gives very strange results, not discounting these categories, but discounting in a different sub-category under the same parent category.

 

Any idea what is going on?

 

Thanks,

 

Steve.

Share this post


Link to post
Share on other sites

Perhaps it's a linked categories issue? Here's the help:

 

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

 

Thanks, but I still can't get this to work, either it doesn't seem to handle sub-categories well, or I've still got it wrong. Let me explain better what I'm trying to do.

 

I have a parent directory (one of many), this one with nine sub-directories. Two of these sub-directories have linked products in and I want to discount all items in both of them - but not anything in any other of the sub-categories or higher categories. How do I do that?

Share this post


Link to post
Share on other sites

It doesn't do subcategories - it uses the parent category only. Try exclude_product if you're mixing in linked categories.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

I double check to make sure the two files need to be in the right directory already. But When I go to admin->module->Order Total and I still don't see 'Quantity Discount' listed. I know this should be simple. But I must miss something now. Please help.

 

I have oscommerce v2.2 RC2.

Edited by mongee

Share this post


Link to post
Share on other sites

Very nice contribution, but I'm having similar problems to others here with Taxes.

 

My store is UK based and will need to charge VAT. However, no matter which way I set the two tax-related fields, my store is calculating the tax on the initial subtotal of the order, where I need it to be calculated on the post-discount subtotal. Other people here seem to have had similar problems, did anyone get a solution?

 

I've installed clean versions of the ot_tax and checkout_confirmation files, just in case another contribution was causing problems.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×