Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can Someone Help Me Edit This Code, Please?


Guest

Recommended Posts

I am trying to install "multi attributes" but a change to code will overwrite QPB. I tried a couple of things but I keep getting errors.

 

Installation instructions for multi attibutes:

2. In the includes/application_top.php file

Find the code line:

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

 

Below that you will find the following code:

$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']);

 

Repalce that line with the following piece of code:

// Code segment includes/modified for Multiple product option lines.

// maintainance and Qns : Harishyam :> [email protected]

for($i=0;$i<5;$i++)

{

$qty_str = $i.'_quantity';

$arr = array();

$arr = $HTTP_POST_VARS[$i.'_id'];

$qty = $HTTP_POST_VARS[$i.'_quantity'];

//echo " the quantity and option " . $i . " is: ".. ' and qty is: ' . $qty . 'or ' .$HTTP_POST_VARS[$i.'_quantity'];

$opt = $i.'_id';

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id'], $arr))+$qty, $arr);

}

// End of Code segment includes/modified for Multiple product option lines.

// maintainance and Qns : Harishyam :> [email protected]

 

My application_top has that line already edited:

 

//BOF qpbpp
                               //$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']);
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);
//EOF qpbpp

 

I thought I could do this but keep getting a parsing error that I can't seem to fix:

 

//BOF qpbpp
                               //$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']);
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id'], $arr))+$qty, $arr);
//EOF qpbpp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...