JohnW,
You are completely correct! Totally forgot about that little change I made to the application top.
My code looks like this:
Code:
// customer adds a product from the products page
// BOF: MOD - QT Pro
// case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
// $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id']) && ($HTTP_POST_VARS['products_id']==(int)$HTTP_POST_VARS['products_id'])) {
$attributes=array();
if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^d{1,10}-d{1,10}(,d{1,10}-d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
$attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
foreach ($attrlist as $attr) {
list($oid, $oval)=explode('-',$attr);
if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
$attributes[$oid]=$oval;
}
}
if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
$attributes=$attributes + $HTTP_POST_VARS['id'];
}
}
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+$HTTP_POST_VARS['quantity'], $attributes);
// EOF: MOD - QT Pro
Note the +1 in your code has been changed to +$HTTP_POST_VARS['quantity'].
What were the 'glitches' - my html skills stop pretty much at cut and paste - so if you can tell me what to fix it would help. Thanks.
Apologies for that - I really should document my changes properly!!
Regards,
Bookmarks