Latest News: (loading..)
swguy

[Contribution] Quantity Discounts for osCommerce 3.0

26 posts in this topic

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

hi, thx for the addon.

 

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

 

thx

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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 ...

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

@@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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

@@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

Share this post


Link to post
Share on other sites

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"

Share this post


Link to post
Share on other sites

@@allenwd

 

yes, in the admin area under modules>> order total> you can set the sort order.

 

 

Chris

 

no tip is required. I offer advice for free on this forum.

Share this post


Link to post
Share on other sites

That doesn't work. I doesn't matter which order I put them in it still shows the subtotal as an amount before discounts.

 

Which file actually send the total to Authorize/Paypal?

 

I was thinking I could go in there and edit the code to deduct the discounts when calculating the sub-total.

Share this post


Link to post
Share on other sites

I have installed the mod and it doesn't seem to be actually deducting the discount, it displays but doesn't actually deduct it even though it shows negative. The order total before deductions is $450.00 They get free shipping at $130 per order and then an additional 10% discount over $300 It picks up the free shipping, it calculates the quantity discount but the subtotal should read $405 not $450 Free Shipping: $0.00 Quantity Discount: -$45.00 Sub-Total: $450.00 PST 5%: $31.50 GST 7%: $22.50 Total: $504.00

 

If I could just get this working.......

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