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

2023-09-10 15:01:13 作者:他是光照亮的却不是我

我试图创建一个Ajax快速查看或在我的Magento商店快速车类型的特征。那种之一,你的收藏夹,而不是去产品页面将鼠标悬停在产品和可以选择快速浏览吧。

我用一个很简单的jQuery Ajax调用是这样的:

  $ J(下'#ajaxquickviewcontent')负载(的http://websiteaddress/category/productname.html。产品视图)。ajaxComplete(函数(){警报( 完成');});
 

通过这种方法我得到我后(即产品形象,描述,配置属性选项(大小)下拉列表中,选择数量,并添加到购物车按钮)我的内容 - 但属性选项(大小)下拉ISN 'T填充任何内容。我刚刚得到的下拉列表,但其中不带选项显然不能添加任何产品到购物车中。

如果我改变调用加载整个产品页面,例如:

$j('#ajaxquickviewcontent').load("http://websiteaddress/category/productname.html").ajaxComplete(function(){alert (完成);}); ajax调用成功的success函数中添加的 span 元素,用jquery选择器获取不到

然后在下拉确实有大小。我假设有可能是在页面的地方,我应该来加载,以及,但我不能找到它一些JavaScript。

任何人都可以点我在正确的方向是什么剧本我会错过这将是该产品必需的div之外?

解决方案

看看@

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/