Bluecamel Posted October 26, 2009 Share Posted October 26, 2009 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? Quote Link to comment Share on other sites More sharing options...
swguy Posted October 27, 2009 Author Share Posted October 27, 2009 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. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
Bluecamel Posted October 27, 2009 Share Posted October 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
swguy Posted October 27, 2009 Author Share Posted October 27, 2009 (edited) 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 October 27, 2009 by swguy Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
Bluecamel Posted October 27, 2009 Share Posted October 27, 2009 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 --> Quote Link to comment Share on other sites More sharing options...
swguy Posted October 27, 2009 Author Share Posted October 27, 2009 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. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
Bluecamel Posted October 27, 2009 Share Posted October 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
swguy Posted October 27, 2009 Author Share Posted October 27, 2009 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. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
wveinti Posted November 10, 2009 Share Posted November 10, 2009 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 Quote Link to comment Share on other sites More sharing options...
swguy Posted November 10, 2009 Author Share Posted November 10, 2009 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. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
wveinti Posted November 11, 2009 Share Posted November 11, 2009 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 Quote Link to comment Share on other sites More sharing options...
swguy Posted November 11, 2009 Author Share Posted November 11, 2009 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. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
xino4ever Posted November 22, 2009 Share Posted November 22, 2009 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! Quote Link to comment Share on other sites More sharing options...
swguy Posted November 23, 2009 Author Share Posted November 23, 2009 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 Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
xino4ever Posted November 24, 2009 Share Posted November 24, 2009 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? Quote Link to comment Share on other sites More sharing options...
swguy Posted November 24, 2009 Author Share Posted November 24, 2009 (edited) 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 November 24, 2009 by swguy Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
xino4ever Posted November 24, 2009 Share Posted November 24, 2009 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". . . Quote Link to comment Share on other sites More sharing options...
swguy Posted November 24, 2009 Author Share Posted November 24, 2009 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. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
xino4ever Posted November 27, 2009 Share Posted November 27, 2009 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? Quote Link to comment Share on other sites More sharing options...
swguy Posted November 27, 2009 Author Share Posted November 27, 2009 Response by PM. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
-Buggi- Posted November 29, 2009 Share Posted November 29, 2009 (edited) 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 November 29, 2009 by -Buggi- Quote Link to comment Share on other sites More sharing options...
swguy Posted November 29, 2009 Author Share Posted November 29, 2009 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 Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
JohnSanders Posted February 13, 2010 Share Posted February 13, 2010 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 Quote Link to comment Share on other sites More sharing options...
swguy Posted February 13, 2010 Author Share Posted February 13, 2010 Response by PM. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
TROQUELADO Posted March 6, 2010 Share Posted March 6, 2010 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.