数量框未更新PHP

数量框未更新PHP,php,joomla,virtuemart,Php,Joomla,Virtuemart,这是我为virtuemart定制的代码的一部分。问题在于数量框。基本上,用户可以更新购物车中第一个项目的值,但之后的任何项目由于某种原因都无法更改。它只是抛出了数字“1”:我如何才能修复它 <?php $i = 1; // vmdebug('$this->cart->products',$this->cart->products); foreach ($this->cart->products as $pkey => $prow) {

这是我为virtuemart定制的代码的一部分。问题在于数量框。基本上,用户可以更新购物车中第一个项目的值,但之后的任何项目由于某种原因都无法更改。它只是抛出了数字“1”:我如何才能修复它

<?php
$i = 1;
//      vmdebug('$this->cart->products',$this->cart->products);
foreach ($this->cart->products as $pkey => $prow) {
    ?>

<div>
<div style="border-bottom:1px solid #f2f2f2;padding-top:12px;padding-bottom:12px;">
<div style="display:table-cell;width:345px;">
<?php if ($prow->virtuemart_media_id) { ?>
        <span class="cart-images">
                         <?php
            if (!empty($prow->image)) {
                echo $prow->image->displayMediaThumb ('', FALSE);
            }
            ?>
                        </span>
        <?php } ?>
        <?php echo JHTML::link ($prow->url, $prow->product_name) . $prow->customfields; ?>
</div>

<div style="display:table-cell;width:75px;text-align:center;">
    <?php
        //                  vmdebug('$this->cart->pricesUnformatted[$pkey]',$this->cart->pricesUnformatted[$pkey]['priceBeforeTax']);
        echo $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $this->cart->pricesUnformatted[$pkey], FALSE);
        //                  echo $prow->salesPrice ;
        ?>
</div>
<div style="display:table-cell;width:95px;text-align:center;">
        <div style="display:inline-block;"><form action="<?php echo JRoute::_ ('index.php'); ?>" method="post" class="inline" id="quantity-update">
            <input type="hidden" name="option" value="com_virtuemart"/>
            <input type="text" autocomplete="off" class="quantity-input-checkout" size="2" maxlength="2" name="quantity" value="<?php echo $prow->quantity ?>"/>
            <input type="hidden" name="view" value="cart"/>
            <input type="hidden" name="task" value="update"/>
            <input type="hidden" name="cart_virtuemart_product_id" value="<?php echo $prow->cart_item_id  ?>"/></div>
            <div style="display:inline-block;vertical-align:middle;margin-left:6px;"><a href="javascript:{}" onclick="document.getElementById('quantity-update').submit(); return false;" class="tip" title="Update the product quantity in the cart." id="store_cart_refresh" style="margin-right:7px;"><span class="alt"></span></a>
        </form>
        <a class="tip" title="Remove this product from the cart." href="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=cart&task=delete&cart_virtuemart_product_id=' . $prow->cart_item_id) ?>" id="store_cart_delete"><span class="alt"></span></a></div>
</div>


<div style="display:table-cell;width:100px;text-align:center;">
<?php echo "<span class='priceColor2'>" . $this->currencyDisplay->createPriceDiv ('taxAmount', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE, $prow->quantity) . "</span>" ?>



        <?php
        if (VmConfig::get ('checkout_show_origprice', 1) && !empty($this->cart->pricesUnformatted[$pkey]['basePriceWithTax']) && $this->cart->pricesUnformatted[$pkey]['basePriceWithTax'] != $this->cart->pricesUnformatted[$pkey]['salesPrice']) {
            echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceWithTax', '', $this->cart->pricesUnformatted[$pkey], TRUE, FALSE, $prow->quantity) . '</span><br />';
        }
        echo $this->currencyDisplay->createPriceDiv ('salesPrice', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE, $prow->quantity) ?>
</div>
</div>


</div>
<?php } ?>
<?php
    $i = ($i==1) ? 2 : 1;
 ?>


输入名称为quantity。。。它应该类似于quantity\u id,因此quantity\u 1、quantity\u 2等,否则可能很难在后端以正确的顺序获取值