0

I have a bundle product with a number of bundled items all with default amount 1.

For some reason, Magento is only showing 1 (the first one) of my bundled items in the cart!

I have a local Magento installation with the exact same files though not the same database, and the products show fine on my local installation?

Why won't Magento show all my products? I tried Disabling/Re-enabling, in-stock/out-of-stock, refreshing index and cache...

  • Can you narrow it down? What's the difference between the two databases? – Fabian Schmengler Nov 5 '14 at 21:06
  • One is a production site with live orders, and one is a local site for testing, therefore the main differences are customers. However, there may be differences in how administrators have set up products. Which tables should I look in for differences in terms of product attributes/options, and any commands I can use to aid in this search? – blisstdev Nov 7 '14 at 2:14
2

If you want to dig into the database to find out the difference in product configuration between the two systems, these tables are relevant for bundle products:

  • catalog_product_bundle_option (configuration of bundle options)
  • catalog_product_bundle_selection (selections, i.e. products associated to the options)

But what probably makes more sense is to do it like this:

  • dump the production db and import it on your local installation (backup the local db first!)
  • change as much as you need to be able to test (base URLs, cookie domain...)
  • flush cache

Now you should have exactly the same behavior locally than on the production system. If not, the problem was not in the database.

Other things to consider:

  • Different PHP versions
  • Different operating systems
  • Caching layers outside of Magento, like APC opcode cache

Also, if you didn't already, look into the log files on both systems (Magento logs in var/log as well as webserver logs to check for PHP errors). Make sure that error logging is enabled in Magento (system configuration) and in PHP (php.ini)

  • Yes! This is a great answer! It seems that it must be a different version of PHP issue, since I don't have the problem even with the same database imported on my local machine. The URLs are getting generated differently: The correct URL: qty/1/?bundle_option[4][]=11&bundle_option[4][]=12&bundle_option[4][]=13&bundle_option[4][]=14&bundle_option[4][]=15&bundle_option[4][]=16& What I'm getting: qty/1/?%23038%3B=&%23038%3Bbundle_option%5B4%5D%5B%5D=16&bundle_option%5B4%5D%5B%5D=11 – blisstdev Nov 10 '14 at 3:11
  • This means the whole query string has been URL encoded (instead of just the single parameters, which is done by default in HTML forms) - maybe this information helps you, I am not sure which settings could cause such behavior. – Fabian Schmengler Nov 10 '14 at 9:44
0

Found the problem! Thanks to fschmengler for putting me on the right track.

It was an caching/SID issue!

Symptoms to reproduce: Magento Blocks HTML caching is turned on (only when turned on)

An SID parameter was being added to the URL that I couldn't see, and was being added in between query parameters in a way that messed everything up.

How to fix, add '_nosid' => true to URL params:

$params = array('_query'=> $query,'qty' => 1, '_nosid' => true);

Then the add to cart URL can be retrieved by

Mage::helper('checkout/cart')->getAddUrl($_product, $params)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.