In the product page cross-sell products are showing with checkboxes.
When I check some checkboxes and then click "add to cart" then the product along with the checked cross-sell products should added to the cart.
But only the product is getting added to the cart except the checked crosssell product.
I found that the code for adding product is written in
app/code/core/Mage/Checkout/cotrollers/CartController.php -->addAction()
Inside it some code is as follows..
$cart = $this->_getCart();
$params = $this->getRequest()->getParams();
echo "<pre>";print_r($params);echo "</pre>";exit;
$cart->addProduct($product, $params);
$cart->save();
when I tried to print the $params then following parameters came..
Array
(
[uenc] => aHR0cDovL2Frc2hheWEuYWZpehyuSDepYS5jb20vcG9zdGJveGVzL3N0yu76ygEtbWljcm8tcG93ZXJsb2NrLTNtLTEwZnQtMC0zMy01MjM,
[product] => 19
[checkboxes] => Array
(
[0] => 534
[1] => 222
)
[qty] => 1
[related_product] =>
)
Is it a wrong format of $params ?
If no, then why only 19 is getting saved and 534 and 222 is not getting added ?
i.e. it is getting the crosssell product ids but not adding it.
Could anyone suggest what should be the right way to add $params ?
Thank you.