Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Add multiple products to cart - example
 
Prayas S
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2011-09-26
Kathmandu
 

Hello,

I am also trying multiadd on magento, I used same Perpetual_MultiAdd but no luck, one product on the top is only added to cart.

Any solutions?

Please Help.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeoITCS
Jr. Member
 
Total Posts:  4
Joined:  2011-12-30
 

Anybody tried this on magento 1.7?

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeoITCS
Jr. Member
 
Total Posts:  4
Joined:  2011-12-30
 

anybody please??

 
Magento Community Magento Community
Magento Community
Magento Community
 
MetizsoftShop
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2011-08-11
 

How to set this on version magento 1.7 ?
Please help me.
Thanks advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
stepan_stepanov
Jr. Member
 
Total Posts:  1
Joined:  2012-06-28
 

Hello.

Thanks everyone for such an amazing topic. Everything works like a charm even on ver. 1.7.+

If you want to implement this feature on your web-site, just read CAREFULLY and analyse every message in this topic from the beginning to the end, you’ll succeed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukgoods
Member
 
Avatar
Total Posts:  44
Joined:  2008-07-20
 

I have Nexus’ Perpetual Multiadd working on 1.7.1.  There is a slight problem in that it does not recalculate the number of items in the cart correctly.  For example, if I add one each of two items to the cart, the “My Cart” link will show only 1 item added, even though two items were actually added to the cart.

For example,

Cadbury Bournville- 1
Cadbury Caramel - 1

I get the message:

“Cadbury Bournville Bar was successfully added to your shopping cart.
Cadbury Caramel Chocolate was successfully added to your shopping cart.

However, the My Cart box and header say “There is 1 item in your cart.” It is also not calculating the subtotal properly. 

Can anyone tell me how to fix this?

Thanks,

Donna

 
Magento Community Magento Community
Magento Community
Magento Community
 
sonicwong
Jr. Member
 
Total Posts:  4
Joined:  2011-05-11
 

I have test on Magento ver. 1.7.0.2,
but the only first item is added to the cart.

I just use a clean install and paste over the file in zip of this post
http://www.magentocommerce.com/boards/viewthread/9797/P30/#t136047

Anyone can help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kajal
Member
 
Total Posts:  60
Joined:  2010-06-27
 

Hi,

This is an old thread but the same issue is still there for the config products.
I have created a module to add multiple config products to cart having two attributes used. Code is easy to managable you may add code it more to add 3*3 matrix in more if you want 2*2 matrix on category listing page, You can do the same.

Kindly download the attachment for a module to add multiple products to cart.

and following is code for list.phtml file :

<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper(\'catalog/output\');
?>
<?php if(!$_productCollection->count()): ?>
<p class=\"note-msg\"><?php echo $this->__(\'There are no products matching the selection.\') ?></p>
<?php else: ?>
<?php echo \"custom code starts here\";
foreach ($_productCollection as $_product): ?>
<li>
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<b><?php echo $_helper->productAttribute($_product, $_product->getName() , \'name\'); ?></b>
<?php echo $this->getPriceHtml($_product, true) ?>

<?php if($_product->isSaleable()): ?>
<form action=\"<?php echo Mage::getBaseUrl(); ?>multiadd/add\” method=\"post\" id=\"<?php echo $_product->getId()?>\">
<?php
$product = Mage::getModel(\’catalog/product\’);
Mage::getSingleton(\’catalog/product_visibility\’)->addVisibleInCatalogFilterToCollection($_productCollection);
$product->load($_product->getId());
$xml = \’\’;
$hasAtts = 0;
$hasAttsIn = 0;
$productType = $product->getTypeId();
if($productType == \"configurable\") {
$attValConfig = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
$childIds = Mage::getModel(\’catalog/product_type_configurable\’)->getChildrenIds($_product->getId());
$k=0;
foreach($childIds as $val_m) :
foreach($val_m as $val) :
$main_child_id[$k]=$val;
$k++;
endforeach;
endforeach;
$c=0;
$xml .= \’<table><tr><td width=\"300\"> </td>\’;
if(sizeof($attValConfig)) {
foreach($attValConfig as $attValConfigSingle) {
$name = $attValConfigSingle[\"attribute_id\"].$_product->getId();
$xml .= \’<input type=\"hidden\" name=\"super_attribute[\’.$attValConfigSingle[\"attribute_id\"].\’]\" id=\"attribute\’.$name.\’\" />\’;

foreach($attValConfigSingle[\’values\’] as $attValConfigSingleVal) {
$attribute_id=$attValConfigSingle[\"attribute_id\"];
$collection = Mage::getModel(\’catalog/product\’)->getCollection();
$collection->addAttributeToFilter(\’status\’, 1);
$collection->addFieldToFilter(array(
array(\’attribute\’=>$attValConfigSingle[\’attribute_code\’],\’eq\’=>$attValConfigSingleVal[\’value_index\’]),
));
foreach ($collection as $product_my) {
$pro_id=$product_my->getId();
if(in_array($pro_id,$main_child_id))
{ $flg= 1; break; }
else
{ $flg= 0;}
}

File Attachments
app.zip  (File Size: 3KB - Downloads: 96)
 
Magento Community Magento Community
Magento Community
Magento Community
 
kajal
Member
 
Total Posts:  60
Joined:  2010-06-27
 
kajal - 26 November 2012 08:02 AM

Hi,

This is an old thread but the same issue is still there for the config products.
I have created a module to add multiple config products to cart having two attributes used. Code is easy to managable you may add code it more to add 3*3 matrix in more if you want 2*2 matrix on category listing page, You can do the same.

Kindly download the attachment for a module to add multiple products to cart.

and following is code for list.phtml file :


<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper(\'catalog/output\');
?>
<?php if(!$_productCollection->count()): ?>
<p class=\"note-msg\"><?php echo $this->__(\'There are no products matching the selection.\') ?></p>
<?php else: ?>
<?php echo \"custom code starts here\";
foreach ($_productCollection as $_product): ?>
<li>
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<b><?php echo $_helper->productAttribute($_product, $_product->getName() , \'name\'); ?></b>
<?php echo $this->getPriceHtml($_product, true) ?>

<?php if($_product->isSaleable()): ?>
<form action=\"<?php echo Mage::getBaseUrl(); ?>multiadd/add\” method=\"post\" id=\"<?php echo $_product->getId()?>\">
<?php
$product = Mage::getModel(\’catalog/product\’);
Mage::getSingleton(\’catalog/product_visibility\’)->addVisibleInCatalogFilterToCollection($_productCollection);
$product->load($_product->getId());
$xml = \’\’;
$hasAtts = 0;
$hasAttsIn = 0;
$productType = $product->getTypeId();
if($productType == \"configurable\") {
$attValConfig = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
$childIds = Mage::getModel(\’catalog/product_type_configurable\’)->getChildrenIds($_product->getId());
$k=0;
foreach($childIds as $val_m) :
foreach($val_m as $val) :
$main_child_id[$k]=$val;
$k++;
endforeach;
endforeach;
$c=0;
$xml .= \’<table><tr><td width=\"300\"> </td>\’;
if(sizeof($attValConfig)) {
foreach($attValConfig as $attValConfigSingle) {
$name = $attValConfigSingle[\"attribute_id\"].$_product->getId();
$xml .= \’<input type=\"hidden\" name=\"super_attribute[\’.$attValConfigSingle[\"attribute_id\"].\’]\" id=\"attribute\’.$name.\’\" />\’;

foreach($attValConfigSingle[\’values\’] as $attValConfigSingleVal) {
$attribute_id=$attValConfigSingle[\"attribute_id\"];
$collection = Mage::getModel(\’catalog/product\’)->getCollection();
$collection->addAttributeToFilter(\’status\’, 1);
$collection->addFieldToFilter(array(
array(\’attribute\’=>$attValConfigSingle[\’attribute_code\’],\’eq\’=>$attValConfigSingleVal[\’value_index\’]),
));
foreach ($collection as $product_my) {
$pro_id=$product_my->getId();
if(in_array($pro_id,$main_child_id))
{ $flg= 1; break; }
else
{ $flg= 0;}
}

Guess won’t be able to upload a full code here it will take 4 posts. So attaching my list.php file as well. You will just need to replace list.php file with mine and add the attached extension.

Hope this helps someone!

Image Attachments
multi_config.PNGadded_cart.PNG
File Attachments
list.phtml  (File Size: 21KB - Downloads: 84)
 
Magento Community Magento Community
Magento Community
Magento Community
 
unfeasible
Sr. Member
 
Avatar
Total Posts:  94
Joined:  2008-03-03
New Zealand
 

Works with 1.7 once all the thread ideas are followed. Then make sure to combine it with your chosen theme layout for good times!

Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jqs08
Jr. Member
 
Total Posts:  8
Joined:  2008-02-04
 

I’m interested in the configurable product multi add.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iloveugly
Jr. Member
 
Total Posts:  6
Joined:  2012-10-29
 

Anyone have luck with Kajals solution???

I have done the following:

Installed correctly and the list.phtml is working - however I keep getting 404 Page Not Found when the add to cart button is pressed.

Any ideas?

The module is installed correctly and showing as enabled in the config menu.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentotalk
Jr. Member
 
Total Posts:  11
Joined:  2013-01-03
 

In response to the last 2 posts:

Call

$cart->init();
right after
$cart $this->_getCart();
I hope this will help someone.

Its for me in magento 1.7.2.........
Thank you maceo..............This works for me..........Awesome............
Life saver..............Thanx a lot.............

 
Magento Community Magento Community
Magento Community
Magento Community
 
aaronwallace09
Jr. Member
 
Total Posts:  11
Joined:  2013-08-07
 

Try this Free Extension-
http://www.magentocommerce.com/magento-connect/catalog/product/view/id/20255/

Good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ali_waseemali
Jr. Member
 
Total Posts:  4
Joined:  2013-03-13
 
maceo - 13 August 2010 12:21 PM

In response to the last 2 posts:

Call

$cart->init();
right after
$cart $this->_getCart();

I hope this will help someone.

Thanks man you are too good. It make it work.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top