Jump to content


Corporate Sponsors


Latest News: (loading..)

[Contribution] Quantity Discounts for osCommerce 3.0


  • You cannot reply to this topic
14 replies to this topic

#1 swguy

  • Community Member
  • 153 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 08 June 2009, 21:38

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.1 and 3.0. See my profile for more details.

#2 asbestos0

  • Community Member
  • 4 posts
  • Real Name:Raymond Ong

Posted 09 June 2009, 03:02

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

  • Community Member
  • 153 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 09 June 2009, 04:44

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.1 and 3.0. See my profile for more details.

#4 grazianno

  • Community Member
  • 11 posts
  • Real Name:grazianno

Posted 24 June 2009, 23:57

hi, thx for the addon.

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

thx

#5 swguy

  • Community Member
  • 153 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 25 June 2009, 00:09

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.1 and 3.0. See my profile for more details.

#6 seank123

  • Community Member
  • 337 posts
  • Real Name:Sean Kennedy
  • Gender:Male

Posted 13 July 2009, 14:44

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

  • Community Member
  • 153 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 13 July 2009, 14:48

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.1 and 3.0. See my profile for more details.

#8 seank123

  • Community Member
  • 337 posts
  • Real Name:Sean Kennedy
  • Gender:Male

Posted 17 July 2009, 16:04

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

  • Community Member
  • 153 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 17 July 2009, 16:19

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.1 and 3.0. See my profile for more details.

#10 Gergely

  • Community Member
  • 328 posts
  • Real Name:Tóth Gergely
  • Gender:Male

Posted 02 August 2009, 19:28

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
Header Footer Content Modules
SCM
V3

and some rewrites :-)

#11 swguy

  • Community Member
  • 153 posts
  • Real Name:Scott Wilson
  • Gender:Male
  • Location:Tampa Bay, Florida

Posted 02 August 2009, 19:50

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.1 and 3.0. See my profile for more details.

#12 Gergely

  • Community Member
  • 328 posts
  • Real Name:Tóth Gergely
  • Gender:Male

Posted 19 September 2009, 12:51

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:
Header Footer Content Modules
SCM
V3

and some rewrites :-)

#13 Marsy

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

Posted 19 September 2009, 14:26

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

  • Community Member
  • 328 posts
  • Real Name:Tóth Gergely
  • Gender:Male

Posted 19 September 2009, 14:41

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!
Header Footer Content Modules
SCM
V3

and some rewrites :-)

#15 wilsonao

  • Community Member
  • 21 posts
  • Real Name:Alex

Posted 08 October 2009, 03:08

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.