[Contribution] Quantity Discounts by That Software Guy
#41
Posted 24 October 2009 - 06:08 PM
function exclude_category($category) {
switch($category) {
case 2:
case 3:
case 4:
return true;
}
return false;
}
or the name of my category............
function exclude_category($category) {
switch($category) {
case Companion products:
case Trigger Point Devices:
case Volume and Professional Packages:
return true;
}
return false;
}
#42
Posted 24 October 2009 - 06:21 PM
#43
Posted 24 October 2009 - 06:27 PM
#44
Posted 24 October 2009 - 06:41 PM
#45
Posted 24 October 2009 - 07:04 PM
#46
Posted 24 October 2009 - 08:22 PM
#47
Posted 24 October 2009 - 08:39 PM
http://www.thatsoftwareguy.com/osc_quantity_discounts.html
and search for "apply_special_item_discount"
#48
Posted 24 October 2009 - 10:33 PM
function apply_special_item_discount($id, $count, &$disc_amount) {
switch($id) {
case 30:
if ($count > 12) {
$disc_amount = $disc_amount * 4.95;
} else if ($count > 3) {
$disc_amount = $disc_amount * 2.95;
}
break;
}
}
got me this............
Parse error: syntax error, unexpected T_DNUMBER in /home/sacrowed/public_html/store1/includes/modules/order_total/ot_quantity_discount.php on line 84
take into count that I have different values set up for a count of 12 and 3 for my main products than I do for this product.
#49
Posted 25 October 2009 - 12:20 AM
#50
Posted 25 October 2009 - 12:59 AM
It kinda looks like this................debug my code.......its not my code its your freakin code I just filled in the blanks.........learn about this here .!..
#51
Posted 26 October 2009 - 03:02 PM
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?
#52
Posted 27 October 2009 - 12:07 AM
$dislist = $discount->get_discount_parms();
That's the only possible cause I can see.
#53
Posted 27 October 2009 - 04:10 AM
<!-- 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.
swguy, on 27 October 2009 - 12:07 AM, said:
$dislist = $discount->get_discount_parms();
That's the only possible cause I can see.
#54
Posted 27 October 2009 - 05:32 AM
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, 27 October 2009 - 05:33 AM.
#55
Posted 27 October 2009 - 06:27 PM
swguy, on 27 October 2009 - 05:32 AM, said:
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 -->
#56
Posted 27 October 2009 - 07:43 PM
Bluecamel, on 27 October 2009 - 06:27 PM, said:
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.
#57
Posted 27 October 2009 - 08:10 PM
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.
swguy, on 27 October 2009 - 07:43 PM, said:
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.
#58
Posted 27 October 2009 - 11:57 PM
Thanks for reporting this issue.
#59
Posted 10 November 2009 - 09:17 PM
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
#60
Posted 10 November 2009 - 09:27 PM
wveinti, on 10 November 2009 - 09:17 PM, said:
Disable If Coupon Used = true
...
There are several Quantity Discounts mods; you're using another one. Mine does not have this setting.









