0

我想在 magento 的 list.phtml 上添加一个数量框。目前盒子的代码是:

<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>

现在这适用于仅添加 1 个产品,但没有数量框。我怎样才能在不重新加载页面的情况下让它工作?

这些是我在该页面底部加载的脚本。 http://pastebin.com/0bdey92h

希望有人来救我!

4

1 回答 1

0

尝试这个:

jQuery('button.btn-cart').parent().append('<input type="text" name="qty">');
于 2013-01-30T17:52:01.707 回答