I'm trying to create an ajax 'quick view' or 'quick cart' type feature on my Magento store. The kind of one where you hover over a product and have the option to 'quick view' it in a lightbox instead of going to the product page.
I'm using a very simple jQuery Ajax call like this:
$j('#ajaxquickviewcontent').load("http://websiteaddress/category/productname.html .product-view").ajaxComplete(function(){alert ('Done');});
With this method I get all of the content I'm after (i.e. product image, description, the configurable attribute options (size) dropdown, qty selector and add to cart buttons) - but the attribute option (size) dropdown isn't populated with any content. I just get the dropdown but with no options in it and obviously can't add any products to the cart.
If I change the call to load the whole product page, eg
$j('#ajaxquickviewcontent').load("http://websiteaddress/category/productname.html").ajaxComplete(function(){alert ('Done');});
Then the drop down does have the sizes. I'm assuming there is possibly some javascript on the page somewhere that I'm supposed to load as well but I can't find it.
Can anyone point me in the right direction for what script I would be missing that would be outside of the product-essential div?
来源:https://stackoverflow.com/questions/13713231/magento-ajax-call-product-page-elements-to-category-page-select-box-not-popul