Jump to content



[Contribution] Quantity Discounts for osCommerce 3.0


  • Please log in to reply
24 replies to this topic

#1   swguy

swguy
  • Members
  • 175 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 08 June 2009 - 09:38 PM

I have ported my Quantity Discounts contribution to osCommerce 3.0.  

My Quantity Discounts contribution permits you to offer discounts that are structured many different ways:

* By total number of items purchased
* By number of items purchased, counting per item
* By number of items purchased, counting per category
* Counting by items or by number of dollars spent, in any of the ways above
* Specifying the discount as a percentage, a flat dollar figure or dollars per item

Download it here:
http://addons.oscommerce.com/info/6804

Installation instructions and configuration help is in the README; more ideas and sample marketing text is on my home page.
Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0.  See my profile for more details.

#2   asbestos0

asbestos0
  • Members
  • 4 posts
  • Real Name:Raymond Ong

Posted 09 June 2009 - 03:02 AM

Hi software guy! will like to know is it possible to have the quantity discounts v1 to work with the order editor add on:

http://www.oscommerce.com/community/contributions,1435.

There is problem when I try to edit my order and the total order price , there is problem adding up!

Fatal error: Call to a member function get_products() on a non-object in /home/canvas/public_html/includes/modules/order_total/ot_quantity_discount.php on line 293

       $products = $_SESSION['cart']->get_products();
       $prod_list = array();
       $prod_list_price = array();
       $cat_list = array();
       $cat_list_price = array();
       $all_items = 0;
       $cat_list_back = array();
       $prod_list_back = array();
       $all_items_price = 0;
       for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          if (!$this->is_discountable($products[$i]['id']))  continue;



thank!

#3   swguy

swguy
  • Members
  • 175 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 09 June 2009 - 04:44 AM

View Postasbestos0, on Jun 8 2009, 11:02 PM, said:

Hi software guy! will like to know is it possible to have the quantity discounts v1 to work with the order editor add on:

Yes - but the problem you are reporting is with the osCommerce 2.2 version of Quantity Discounts; this thread is for osCommerce v3.  I will post a fix to the problem you have reported to the 2.2 thread later this month.
Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0.  See my profile for more details.

#4   grazianno

grazianno
  • Members
  • 12 posts
  • Real Name:grazianno

Posted 24 June 2009 - 11:57 PM

hi, thx for the addon.

is it possible to show the discount in the shopping_cart.php ?

thx

#5   swguy

swguy
  • Members
  • 175 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 25 June 2009 - 12:09 AM

In osCommerce 3.0, the discount is automatically shown in the shopping cart.  In 2.2, you have to write software; PM me for details.
Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0.  See my profile for more details.

#6   seank123

seank123
  • Members
  • 337 posts
  • Real Name:Sean Kennedy
  • Gender:Male

Posted 13 July 2009 - 02:44 PM

Needed something to do a 'Buy 2 get 3rd free' type offer - this does it perfectly! Many thanks!

Just one question - is it possible to get it to only apply the discount to a specific country/zone only?

Cheers

#7   swguy

swguy
  • Members
  • 175 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 13 July 2009 - 02:48 PM

View Postseank123, on Jul 13 2009, 10:44 AM, said:

Just one question - is it possible to get it to only apply the discount to a specific country/zone only?

That's not a feature it has right now.

Did you add code for buy 2 get a third free?  Otherwise the results when you buy 4 or more might be surprising ...
Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0.  See my profile for more details.

#8   seank123

seank123
  • Members
  • 337 posts
  • Real Name:Sean Kennedy
  • Gender:Male

Posted 17 July 2009 - 04:04 PM

View Postswguy, on Jul 13 2009, 03:48 PM, said:

That's not a feature it has right now.

Did you add code for buy 2 get a third free?  Otherwise the results when you buy 4 or more might be surprising ...

Cheers for the reply.  Hopefully it will appear in future versions!

I set 'Discount Level 1' to 3 and 'Discount Amount' to the price of the items (all items are the same price) - seems to work  - when I add 2 itmes I get no discount, when I add 3 or more items I get the price of one item discounted - perfect!  Probably will run into problems if the prices of items are different though!

Would it be possible to set the discount amount to the cost of the cheapest item if the 'Total Items In Cart' option was selected rather than a set value?

#9   swguy

swguy
  • Members
  • 175 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 17 July 2009 - 04:19 PM

View Postseank123, on Jul 17 2009, 12:04 PM, said:

Would it be possible to set the discount amount to the cost of the cheapest item if the 'Total Items In Cart' option was selected rather than a set value?

No.  It offers a percentage or a fixed amount as the discount choices.
Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0.  See my profile for more details.

#10   Gergely

Gergely

    Action Hero

  • Community Team
  • 970 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 02 August 2009 - 07:28 PM

Hi!

I get this problem:

Catchable fatal error: Object of class osC_OrderTotal_quantity_discounts could not be converted to string in K:\xampp\htdocs\osc3\includes\modules\order_total\quantity_discounts.php on line 644



(I change to this pair)
currency per item
Total Items in Car



Used options:


Sort Order
Sort order of display. 3

Include Tax
Include Tax in calculation.
true
x false

Re-calculate Tax
Re-Calculate Tax
None
x Standard

Discount Units
Are AMOUNT values below expressed as a percentage or as currency units (e.g. dollars)
currency
percentage
x currency per item

Discount Basis
How quantity totals are computed
Total By Category
Total By Item
x Total Items in Cart

Counting Method
Are LEVEL values below expressed in number of items or currency units (e.g. dollars spent)
x items
currency

Discount Level 1
Total required to reach this discount level
10

Discount Amount 1
Percent or amount off at this level
10

Discount Level 2
Total required to reach this discount level
11

Discount Amount 2
Percent or amount off at this level
20

Discount Level 3
Total required to reach this discount level
20

Discount Amount 3
Percent or amount off at this level
22

Discount Level 4
Total required to reach this discount level
30

Discount Amount 4
Percent or amount off at this level
30

Discount Level 5
Total required to reach this discount level
100

Discount Amount 5
Percent or amount off at this level
30
some rewrites :-)

#11   swguy

swguy
  • Members
  • 175 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 02 August 2009 - 07:50 PM

In the file includes/modules/order_total/quantity_discounts.php go to line 644.  Change

           $h_exp = $verb . " " . $over_level . " " . $basis . " " . $this->$this->GET . " " . $off_amt . " " . $this->PER_ITEM_OFF;

to

           $h_exp = $verb . " " . $over_level . " " . $basis . " " . $this->GET . " " . $off_amt . " " . $this->PER_ITEM_OFF;

Thanks for the report.  This will be fixed in the next release.
Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0.  See my profile for more details.

#12   Gergely

Gergely

    Action Hero

  • Community Team
  • 970 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 19 September 2009 - 12:51 PM

Hi swguy!


I find TAX calculating problem of Quantity Discounts:



Example:

Shopping Cart
Shopping Cart
Date Added: 09/19/2009
Delete osCommerce T-Shirt
- Size: Medium
- Front: 15,000Ft
Sub-Total: 15,000Ft
Free Shipping (for orders over 20Ft): 0Ft
Quantity Discounts: -1,200Ft
Áfa 25%: 3,000Ft
Total: 16,800Ft


My opinion, that the Quantity Discounts:-1,200Ft have to be -1500Ft without tax or 1800Ft with Tax value. The total results have to be 16200Ft.
:blink:
some rewrites :-)

#13   Marsy

Marsy
  • Members
  • 23 posts
  • Real Name:Marsalkó István
  • Gender:Male
  • Location:Hungary - Veresegyhaz

Posted 19 September 2009 - 02:26 PM

View PostGergely, on Sep 19 2009, 02:51 PM, said:

Hi swguy!


I find TAX calculating problem of Quantity Discounts:



Example:

Shopping Cart
Shopping Cart
Date Added: 09/19/2009
Delete osCommerce T-Shirt
- Size: Medium
- Front: 15,000Ft
Sub-Total: 15,000Ft
Free Shipping (for orders over 20Ft): 0Ft
Quantity Discounts: -1,200Ft
Áfa 25%: 3,000Ft
Total: 16,800Ft


My opinion, that the Quantity Discounts:-1,200Ft have to be -1500Ft without tax or 1800Ft with Tax value. The total results have to be 16200Ft.
:blink:

Hi Gergely and swguy!

Gergely!
You've got the wrong sort of calculation.
VAT should be calculated at the end.

osCommerce T-Shirt
- Méret: Medium
- Front:  25.000,-Ft

  
Sub-Total:              25.000,-Ft (bruttó)
Quantity Discounts: -2.000,-Ft
Free Shipping (for orders over 2.000,-Ft): 0,-Ft
Total:  22.500,-Ft
VAT (ÁFA 25%): 4.500,-Ft


10pcs tshirt 2.000,-Ft +25% VAT (ÁFA)  = 25.000,-Ft
Setup:
Include Tax
Include Tax in calculation= false (20000-10% engedmény = 18.000,-Ft)
Bruttó Total: 18.000,-Ft + 25% ÁFA = 18000*1,25= 22.500,-Ft
TAX (ÁFA  25%) 18000*0,25%= 4.500,-Ft

The module is correctly calculated. In my opinion. Are you agree?
---
Thanks and regards
Marsy from Hungary

#14   Gergely

Gergely

    Action Hero

  • Community Team
  • 970 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 19 September 2009 - 02:41 PM

View PostGergely, on Sep 19 2009, 02:51 PM, said:

Hi swguy!


I find TAX calculating problem of Quantity Discounts:



Example:

Shopping Cart
Shopping Cart
Date Added: 09/19/2009
Delete osCommerce T-Shirt
- Size: Medium
- Front: 15,000Ft
Sub-Total: 15,000Ft
Free Shipping (for orders over 20Ft): 0Ft
Quantity Discounts: -1,200Ft
Áfa 25%: 3,000Ft
Total: 16,800Ft


My opinion, that the Quantity Discounts:-1,200Ft have to be -1500Ft without tax or 1800Ft with Tax value. The total results have to be 16200Ft.
:blink:


Sorry, but very important, that the last will be the TAX modul sort order number!!!!! :o

Thanks to Marsy!
some rewrites :-)

#15   wilsonao

wilsonao
  • Members
  • 21 posts
  • Real Name:Alex

Posted 08 October 2009 - 03:08 AM

Wow! Thanks for this! :) I'm going to install it this afternoon and give it a test run. Will help greatly for the holiday season i think.

#16   allenwd

allenwd
  • Members
  • 8 posts
  • Real Name:Bill

Posted 10 May 2013 - 02:52 PM

I need help with my quantity discount module, please !!

I have installed the Quantity Discount Module and everything seems to be working fine on my site (ie..the discount shows perfectly)  However, when my customer clicks process payment button the order total in Paypal Standard or Authorize.net (which ever they choose) does not reflect the discounted amount.  It tried to charge the total amount before the discounts (in other words the discount is not being carried over to paypal or authorize).

I really don't mind (although it would be nice) if the paypal order is not itemized.  I just want the correct total to show.

Background...I am not an oscommerce expert by any means.  

I have now been burned twice by programmers that said they can fix this and here I am.

CAN ANYONE PLEASE HELP?  (besides paying "that software guy" $200 to fix this)

Not sure if it matters I believe I am running  Oscommerce v2.3.1  (Paypal Standard)

#17   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 10 May 2013 - 08:13 PM

@allenwd

ONLY the total should be seen by PayPal or Authorize.net.  Usually, discounts, taxes, shipping, etc.....are not provided to the payment processor.  So, As along as you have your discounted amount deducted before the sub-total, it shouldn't make any difference to your payment processor.



Chris

ps.  If you are in fact using v3.0.....you're in for a world of disappointment as it is/ was never really supported and is now dead as the core structure originally used in 3.0 has changed with newer GITHUB revisions.

Edited by DunWeb, 10 May 2013 - 08:14 PM.

:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#18   allenwd

allenwd
  • Members
  • 8 posts
  • Real Name:Bill

Posted 10 May 2013 - 08:30 PM

Chris,

Thank You for your response !!

I have seen people say to discount before subtotal in other parts of the forum, however, I don't know how/where to do this.  Can you explain?

I believe I'm using v2.3.1 is that bad??  If so how hard is it to upgrade?

#19   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 10 May 2013 - 08:32 PM

@allenwd

2.3.1 is better than v3.0 for sure.  So, that's a good thing.  You could upgrade to v2.3.3 when you get time.


In the order total module, you can assign a sort order. Ensure your discount code is before the sub-total and it should work just fine.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#20   allenwd

allenwd
  • Members
  • 8 posts
  • Real Name:Bill

Posted 10 May 2013 - 09:41 PM

Ok, do you mean in

ot_total.php ?

If not which one ??

Thank You For Your Help !!  

ps..If this helps me fix the problem do you have a paypal account so i can send you a "Tip"