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

[Contribution] Quantity Discounts by That Software Guy

Recommended Posts

I have installed this mod and everything works as in giving the discount, my question is I am trying to use the "Quantity Discounts Marketing 4 output" I have set up the Discount Level 1, Discount Level 2, Discount Level 3, etc but when I look at the chart on the product page it return results like: *note the 0.00 dollar amounts

 

Amount Spent Discount

$0.00 - $60.99 15%

$0.00 - $99.99 20%

$0.00 + 25%

 

If you look at the chart above I would think it would return:

 

Amount Spent Discount

$40.00 - $60.99 15%

$61.00 - $99.99 20%

$100.00 + 25%

 

I am trying to figure out why it isn't showing correctly? Could someone help me out with this? What am I missing?

Share this post


Link to post
Share on other sites

On OSC 2.2rc2 with php5 it works perfectly if you paste the code in to product_info.php. Did you type the code by hand? Did you perhaps miss

 

$dislist = $discount->get_discount_parms();

 

 

That's the only possible cause I can see.


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 used the code that was located on That Software Guy

 

<!-- bof osCommerce Quantity Discounts Contribution Example 4 Marketing Text -->
<tr><td>
<?php
 $value = "ot_quantity_discount.php"; 
 require_once(DIR_WS_LANGUAGES . $language . 
         '/modules/order_total/'. $value);
 require_once(DIR_WS_MODULES . "order_total/" . $value);
 $discount = new ot_quantity_discount();  
 if (($discount->check() > 0) && 
     ($discount->is_discountable((int)$HTTP_GET_VARS['products_id'])) ) { 
    echo '<div class="content" id="discountPolicy4">'; 
    echo '<table border="1" bgcolor="#FFFF66"><tr><td>Amount Spent</td><td>Discount</td></tr>'; 
    $dislist = $discount->get_discount_parms();
    $raw_dislist = $discount->get_discount_parms(true);
    global $currencies; 
    for ($i = 0; $i < sizeof($dislist); $i++) {
        echo '<tr><td>' . $currencies->display_price($dislist[$i]['level'], 0); 
        if ($i == (sizeof($dislist) - 1)) {
           echo " + "; 
        } else { 
           echo " - ";
           echo $currencies->display_price($raw_dislist[$i+1]['level'] - 0.01, 0); 
        }
        echo "</td><td>" . $dislist[$i]['discount'] .  "</td></tr>";
    }
    echo '</table>';
    echo '<br /></div>';
 }
?>
</td></tr>
<!-- eof Quantity Discounts Contribution Example 4 Marketing Text -->

 

I copied and pasted the code, uninstalled through admin with still no resolution.

 

On OSC 2.2rc2 with php5 it works perfectly if you paste the code in to product_info.php. Did you type the code by hand? Did you perhaps miss

 

$dislist = $discount->get_discount_parms();

 

 

That's the only possible cause I can see.

Share this post


Link to post
Share on other sites

What OSC and PHP are you running?

 

Please try this code:

 

<!-- bof osCommerce Quantity Discounts Contribution Example 4 Marketing Text TEST -->
<tr><td>
<?php
 $value = "ot_quantity_discount.php"; 
 require_once(DIR_WS_LANGUAGES . $language . 
         '/modules/order_total/'. $value);
 require_once(DIR_WS_MODULES . "order_total/" . $value);
 $discount = new ot_quantity_discount();  
 if (($discount->check() > 0) && 
     ($discount->is_discountable((int)$HTTP_GET_VARS['products_id'])) ) { 
    echo '<div class="content" id="discountPolicy4">'; 
    echo '<table border="1" bgcolor="#FFFF66"><tr><td>Amount Spent</td><td>Discount</td></tr>'; 
    $dislist = $discount->get_discount_parms();
    $raw_dislist = $discount->get_discount_parms(true);
    global $currencies; 
    for ($i = 0; $i < sizeof($dislist); $i++) {
        echo '<tr><td>' . $currencies->display_price($raw_dislist[$i]['level'], 0); 
        if ($i == (sizeof($dislist) - 1)) {
           echo " + "; 
        } else { 
           echo " - ";
           echo $currencies->display_price($raw_dislist[$i+1]['level'] - 0.01, 0); 
        }
        echo "</td><td>" . $dislist[$i]['discount'] .  "</td></tr>";
    }
    echo '</table>';
    echo '<br /></div>';
 }
?>
</td></tr>
<!-- eof Quantity Discounts Contribution Example 4 Marketing Text TEST -->

Edited by swguy

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

It appears that this is working correctly. Can I ask what you did to change to get the parm to work ? Thanks for helping with this and thanks for the Mod!

 

What OSC and PHP are you running?

 

Please try this code:

 

<!-- bof osCommerce Quantity Discounts Contribution Example 4 Marketing Text TEST -->
<tr><td>
<?php
 $value = "ot_quantity_discount.php"; 
 require_once(DIR_WS_LANGUAGES . $language . 
         '/modules/order_total/'. $value);
 require_once(DIR_WS_MODULES . "order_total/" . $value);
 $discount = new ot_quantity_discount();  
 if (($discount->check() > 0) && 
     ($discount->is_discountable((int)$HTTP_GET_VARS['products_id'])) ) { 
    echo '<div class="content" id="discountPolicy4">'; 
    echo '<table border="1" bgcolor="#FFFF66"><tr><td>Amount Spent</td><td>Discount</td></tr>'; 
    $dislist = $discount->get_discount_parms();
    $raw_dislist = $discount->get_discount_parms(true);
    global $currencies; 
    for ($i = 0; $i < sizeof($dislist); $i++) {
        echo '<tr><td>' . $currencies->display_price($raw_dislist[$i]['level'], 0); 
        if ($i == (sizeof($dislist) - 1)) {
           echo " + "; 
        } else { 
           echo " - ";
           echo $currencies->display_price($raw_dislist[$i+1]['level'] - 0.01, 0); 
        }
        echo "</td><td>" . $dislist[$i]['discount'] .  "</td></tr>";
    }
    echo '</table>';
    echo '<br /></div>';
 }
?>
</td></tr>
<!-- eof Quantity Discounts Contribution Example 4 Marketing Text TEST -->

Share this post


Link to post
Share on other sites

It appears that this is working correctly. Can I ask what you did to change to get the parm to work ? Thanks for helping with this and thanks for the Mod!

 

I changed the first call to display_price to

 

        echo '<tr><td>' . $currencies->display_price($raw_dislist[$i]['level'], 0); 

 

Please confirm your PHP and osCommerce version; I'm curious why my original code didn't work for you, and I have never seen this bug report.


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

Sure!

HTTP Server: Apache

PHP Version: 5.2.5 (Zend: 2.2.0)

Server OS: Linux 2.4.21-60

Database: MySQL 5.0.67

osCommerce Online Merchant v2.2 RC2 (from application_top.php)

 

Hope this information helps.

 

 

I changed the first call to display_price to

 

        echo '<tr><td>' . $currencies->display_price($raw_dislist[$i]['level'], 0); 

 

Please confirm your PHP and osCommerce version; I'm curious why my original code didn't work for you, and I have never seen this bug report.

Share this post


Link to post
Share on other sites

Well, I tightened up the code a bit for examples 4 and 5 and posted them. I'm happier with this now anyhow.

 

Thanks for reporting this issue.


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 setup my Quantity Discounts with this property

 

Disable If Coupon Used = true

 

but anyways when there is a coupon still shows up

when it should not right?

 

please some advice or help

or if I have to pay you to have this working please let me know but I need to fix this problem

 

thanx

Share this post


Link to post
Share on other sites

I setup my Quantity Discounts with this property

Disable If Coupon Used = true

...

 

There are several Quantity Discounts mods; you're using another one. Mine does not have this setting.


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

There are several Quantity Discounts mods; you're using another one. Mine does not have this setting.

 

would it be hard to add that feature?

thanks

Share this post


Link to post
Share on other sites

Coupons are a mod to osCommerce, so it would depend on what version, flavor, etc. I wouldn't add this to my mod for general use because there would be too many ways to go wrong. If you want a quote on customizing your specific site, you are welcome to email me.


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

Hello, I am very new to OsCommerce and e-commerce in general. I found your contribution very interesting but I just can´t get it to install. I put the files in the right directories and installed (I made sure the module had a different sort order), but nothing shows up at the product information page. I´m running OSC2.2rc and this is my webpage www.panda.pe

Thank you for this great contrib! It was just what i was looking for!

Share this post


Link to post
Share on other sites

Hello, I am very new to OsCommerce and e-commerce in general. I found your contribution very interesting but I just can´t get it to install. I put the files in the right directories and installed (I made sure the module had a different sort order), but nothing shows up at the product information page. I´m running OSC2.2rc and this is my webpage www.panda.pe

Thank you for this great contrib! It was just what i was looking for!

 

Welcome to osCommerce. The discount doesn't show up on the product information page by default; it shows up on the checkout confirmation page.

 

If you want something to show up on the product information page, you need to add the "marketing text" as follows:

 

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


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

Thank you so much!!! I finally solved it! Just one more question, is it possible to apply different discount rates for different categories?? For example:

category 1:

20% off for 20 items

40% off for 30 items

 

category 2:

10% off for 12 items

20% off for 24 items

 

Is there some kind of way to implement this?

Share this post


Link to post
Share on other sites

Thank you so much!!! I finally solved it! Just one more question, is it possible to apply different discount rates for different categories??

 

Yes, but you have to write a bit of code.

 

Look for apply_special_category_discount in the help:

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

Edited by swguy

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

Well, the only problem is that this function appears to be available only if one is using "Total by Category" as a Discount basis, while I use "total by Item". . .

Share this post


Link to post
Share on other sites

Well, the only problem is that this function appears to be available only if one is using "Total by Category" as a Discount basis, while I use "total by Item". . .

 

If you use total by item, you will need to call apply_special_item_discount() but deduce the category id from the item number.


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

Yeah, but the only problem with that is that ill have to add all the product id´s in that category(100+) manually, which is quite tedious. Isn´t there a way to add special discount for all items in that category?

Share this post


Link to post
Share on other sites

Response by PM.


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 Software guy

 

Thanks for a great contribution. :thumbsup:

 

Is there some way that its possible to include sub categories, when adding lets say cat_id 145, and that cat. have 30 sub categories.

The idea is, that I want it to be possible to receive discount when you buy across categories.

For example: if you have to buy for 500$ from category id_145 to obtain the discount, and you take for 300$ from one sub cat. and 200$ from another sub. cat.

 

I hope you understand what I mean, despite my miserable English :P

Edited by -Buggi-

Share this post


Link to post
Share on other sites

I understand what you mean - it's just that Quantity Discounts is designed to work at one consistent level only.

 

See your PM for other ideas.

 

Scott


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 Scott,

 

First off, thanks for the great mod!

 

I am curious to the ideas you have given -Buggi-. Basically I am facing the same problem.

 

I have several main categories which consist of subcategories up to three levels deep, e.g.

 

Women

|

----> Clothing

|

----> Nike

|

----> Jackets

----> Shirts

----> Dresses

----> Pants

 

When I assign a discount by category, than it will by default use the deepest level (Jackets, Shirts, Dresses, Pants), however I would love to assign it to the level above, in this case "Nike". Any ideas?

 

Thanks,

John

Share this post


Link to post
Share on other sites

Response by PM.


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

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!

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

×