且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento的 - Ajax调用产品页面元素分类页。选择框不填充

更新时间:2023-11-30 11:36:52

看看@

Magento的快速查看阿贾克斯装载机

http://ecommercedeveloper.com/articles/1875-create-a-quick-view-for-product-images/

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?

Take a look @

Magento Quick View Ajax Loader

http://ecommercedeveloper.com/articles/1875-create-a-quick-view-for-product-images/