Php 在检查页面magento上更新产品数量

Php 在检查页面magento上更新产品数量,php,magento,magento-1.7,Php,Magento,Magento 1.7,我想在magento的结帐页面上提供更新产品数量的功能。因此,如果用户想要更新产品数量,他可以在结账页面上更新,而不是回到购物车页面。您可以通过编辑item.phtml(template/checkout/onepage/review/item.phtml)和第47行后面的这些行来更新 这不是一个好主意。您只能在查看步骤中查看产品,更改其中的数量可能会导致其他错误。例如,装运方法可能不适用于所选数量。否则运费会改变。我建议使用现有的许多单步签出扩展之一。我推荐这个:。它内置了你需要的东西。相信

我想在magento的结帐页面上提供更新产品数量的功能。因此,如果用户想要更新产品数量,他可以在结账页面上更新,而不是回到购物车页面。

您可以通过编辑
item.phtml(template/checkout/onepage/review/item.phtml)
和第47行后面的这些行来更新



这不是一个好主意。您只能在查看步骤中查看产品,更改其中的数量可能会导致其他错误。例如,装运方法可能不适用于所选数量。否则运费会改变。我建议使用现有的许多单步签出扩展之一。我推荐这个:。它内置了你需要的东西。相信我,这是值得的。我们可以通过加载页面和使用upadte cart的默认mangeto功能来管理运费和其他事项。我为此开发了代码,但我面临的唯一问题是购物车没有呈现在结帐页面上。您可以使用cart表单更新数量,并覆盖cartcontroller。
    <td class="a-center"><?php echo $_item->getQty() ?></td>   
        <td class="a-center">
            <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" name="update_cart_action" id="cup_<?php echo $_item->getId() ?>"  class="input-text qty" maxlength="12" />
        </td>
       <td> <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('shopping-cart-table'); ?>" id="up_<?php echo $_item->getId() ?>" class="button btn-update"><span><span><?php echo $this->__('Update'); ?></span></span></button><td>

and put Jquery code at the end 

    <script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery(".btn-update").click(function(){


            var id = "#c"+this.id;
            var quan = jQuery(id).val();
            var lastChar = id.substr(id.length - 1);

            jQuery.ajax({
                url: "<?php echo Mage::getBaseUrl(); ?>checkout/cart/updatePosts/",
                data: "cart["+lastChar+"][qty]="+quan,
                async: false,
                    success: function(html){

                        location.reload();

                    }
            })
        })
    })
    </script>