简体   繁体   English

Magento数量框,在list.phtml上带有JQUERY

[英]Magento Quantity box with JQUERY on list.phtml

I want to add a quantity box on magento's list.phtml. 我想在magento的list.phtml上添加一个数量框。 Currently the code for the box is: 当前该框的代码是:

<div>
       <button type="button" style=" margin-left:185px; min-height:48px;"title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button><br /><br/>
       </div>

Now that works for adding just 1 product , but there is NO qty box. 现在仅添加1种产品即可使用,但是没有数量盒。 how can i get that to work without reloading the page? 如何在不重新加载页面的情况下使它正常工作?

These are my scripts loaded on the bottom of that page. 这些是我在该页面底部加载的脚本。 http://pastebin.com/0bdey92h http://pastebin.com/0bdey92h

Hope that somebody is here to rescue me! 希望有人来救我!

尝试这个:

jQuery('button.btn-cart').parent().append('<input type="text" name="qty">');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM