Products     Magento Extension     PCI-Shopping-Carts     Templates       CRELoaded     WordPress Modules     osCommerce Modules       osCommerce Addons       osCommerce Features       osCommerce Management       Payment Modules     CRELoaded Modules       CRE Loaded Addons       CRE Loaded Features       CRE Loaded Management       Payment Modules       CRELoaded Services
Free Stuff
Customization
Templates
Compare Products
You have no items to compare.
Affiliate Info
Affiliate Program FAQ
Affiliate Log In
Recent Orders
Hot Keywords: Order Notification, Order Search, Coupon, Flash Board, Compare, Floating Message, Tracking, Moneris, RSS, Visitor Filter

  Quantity Price Breaks Per Product

The following osCommerce contribution is a free Opensource code originated from official osCommerce website and provided for your reference only, you may download the original contribution file(s) and install it on your own; or you may request a Paid Installation Service from Agents Of Power; Agents Of Power does the "AS IS" installation on your website, we do not guarantee it will work properly on your website. Extra Paid service is available for repairing the problem from the original contribution or from your website.
English______

Added Spanish language
Bugs added to catalog/includes/classes/shopping_cart.php by "Sugarsnappy"


Español______

Añadido lenguaje español
Añadidos Bugs en catalog/includes/classes/shopping_cart.php por "Sugarsnappy"
Hi,

In addition:

Also needed to change lines from 122:

// BOF qpbpp
if ($this->in_cart($products_id_string)) {
$this->update_quantity($products_id_string, $qty, $attributes, $discount_category);
} else {
$this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $discount_category);
// EOF qpbpp

to include $discount_category_id instead of $discount_category thus:

// BOF qpbpp
if ($this->in_cart($products_id_string)) {
$this->update_quantity($products_id_string, $qty, $attributes, $discount_category_id);
} else {
$this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $discount_category_id);
// EOF qpbpp


Following is correct file

The regular expression pattern for the catalog/includes/classes/shopping_cart.php file was Improved.

Autoinstaller 2.14 for Quantity Price Breaks Per Product 1.3.5 by Jan Zonjee (7 Sep 2008)


The Auto Installer script requires PHP 5.2.0
The "Edit Manually" button fixed


Autoinstaller 2.14 for Quantity Price Breaks Per Product 1.3.5 by Jan Zonjee (7 Sep 2008)


The Auto Installer script requires PHP 5.2.0 !

Few lines of code were added to list all the files that should have 777 permissions.

Autoinstaller 2.13 for Quantity Price Breaks Per Product 1.3.5 by Jan Zonjee (7 Sep 2008)


The Auto Installer script requires PHP5 !

Autoinstaller 2.12 for Quantity Price Breaks Per Product 1.3.5 by Jan Zonjee (7 Sep 2008)

The script automatically install the contribution: copy files, edit files, alter database tables.
It saves a backup before any action.

The aim of the script is to speed up the contribution installation.
And to make possible to uninstall it.

You will need to do manually only what the script cannot.


The Auto Installer script requires PHP5 !
There is an error in the install instructions for catalogincludesclassesshopping_cart.php:

Find (around line 110 [around line 119 in edited file]):
if ($this->in_cart($products_id_string)) {
$this->update_quantity($products_id_string, $qty, $attributes);
} else {
$this->contents[$products_id_string] = array('qty' => (int)$qty);

Replace with:

// BOF qpbpp
$products_query = tep_db_query("select cb.products_id, ptdc.discount_categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " cb left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc using(products_id) where customers_id = '" . (int)$customer_id . "'");
while ($products = tep_db_fetch_array($products_query)) {
$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']);
// EOF qpbpp


This is wrong, it SHOULD BE:

// BOF qpbpp
if ($this->in_cart($products_id_string)) {
$this->update_quantity($products_id_string, $qty, $attributes, $discount_categories_id);
} else {
$this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $discount_categories_id);
// EOF qpbpp

The change: $products['discount_categories_id'] => $discount_categories_id

This caused different items in same categories not to qualify for quantity price breaks.

The premodified catalogincludesclassesshopping_cart.php (for fresh installs) in the full package is correct and is modified as above--just the instructions file was incorrect.

Nothing attached, just blank file

Sorry for double post, somehow my post was truncated.
No new functionality, just an update of the install.html that had a faulty instruction in admin/categories.php (a Replace with: should have been "Add:") which seems to have caused a lot of confusion.

Also added a bit of explanation on the use of Discount categories.
in the install.html it says
...
Open: catalogadmincategories.php
...
After (around line 384):
} elseif (tep_not_null($HTTP_POST_VARS)) {
$pInfo->objectInfo($HTTP_POST_VARS);

Replace with:
// BOF qpbpp
$price_breaks_array = array();
for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
if(isset($HTTP_POST_VARS['products_price' . $count]) && tep_not_null($HTTP_POST_VARS['products_price' . $count]) &&
isset($HTTP_POST_VARS['products_qty' . $count]) && tep_not_null($HTTP_POST_VARS['products_qty' . $count])) {
$price_breaks_array[] = array(
'products_price' => $HTTP_POST_VARS['products_price' . $count],
'products_qty' => $HTTP_POST_VARS['products_qty' . $count],
'products_delete' => (isset($HTTP_POST_VARS['products_delete' . $count]) && tep_not_null($HTTP_POST_VARS['products_delete' . $count])));
}
}
// EOF qpbpp



acutally it should be
// BOF qpbpp
} elseif (tep_not_null($HTTP_POST_VARS)) {
$price_breaks_array = array();
for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
if(isset($HTTP_POST_VARS['products_price' . $count]) && tep_not_null($HTTP_POST_VARS['products_price' . $count]) &&
isset($HTTP_POST_VARS['products_qty' . $count]) && tep_not_null($HTTP_POST_VARS['products_qty' . $count])) {
$price_breaks_array[] = array(
'products_price' => $HTTP_POST_VARS['products_price' . $count],
'products_qty' => $HTTP_POST_VARS['products_qty' . $count],
'products_delete' => (isset($HTTP_POST_VARS['products_delete' . $count]) && tep_not_null($HTTP_POST_VARS['products_delete' . $count])));
}
}
// EOF qpbpp

that is, the following line should not be delete
} elseif (tep_not_null($HTTP_POST_VARS)) {

otherwise when you EDIT an existing product with price break, the existing price break will be gone :)
   Posted on: 09/06/2008     See contribution details Request Installation with Paid service