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

Adding bundled product via querystring
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

I am trying to follow the instructions at http://www.magentocommerce.com/wiki/adding_a_product_to_the_cart_via_querystring for adding a bundled product via querystring.

It says the format is:

/path/to/app/checkout/cart/add/product/[id]/bundle_option[[option_id]][]=[selection_id]

which if you decipher the square brackets that are supposed to be tokens, I believe would look like:

http://localhost/magento/checkout/cart/add/product/233/bundle_option[10][]=25

where 233 is the product id, 10 is the option id and 25 is the selection id.

However, that url gives me the error: “Please specify product option(s)”

There is only one option, and these numbers are valid. In the CartController I var_dumped the $params that the controller recieves for the addProduct call and I get this:

array(2{ ["product"]=>  string(3"233" ["bundle_option[10][]=25"]=>  string(0"" }

If I hard code the param: like

$params = array( "bundle_option" => array ( "10"=> "25" ) , "qty"=> );
Then it works fine.

Also, if I add quantity to the querystring, it gets added to the querystring weirdness:

["bundle_option[98][]=888&qty;=1"]

What is the correct format for the bundled options in a query string? (note: all the percentage signs got mashed up in this post and became ampersands and hashes and x’s!)

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

bump’n bump

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

do the bump

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

bump de bump. (is this bad form? i reckon someone knows the answer wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
hexagram
Jr. Member
 
Total Posts:  23
Joined:  2009-01-08
 

The format I was using is:

/magento/checkout/cart/add/product/209/?bundle_option[67][]=157

Perhaps you are missing the question mark?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

You are correct sir! Thanks for that (though, to my credit the ? was also missing from the wiki page wink )

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