Php Joomla 1.5和Virtuemart 1.1.9
我想在分类页面上添加更改,我自定义页面Php Joomla 1.5和Virtuemart 1.1.9,php,joomla,content-management-system,joomla1.5,virtuemart,Php,Joomla,Content Management System,Joomla1.5,Virtuemart,我想在分类页面上添加更改,我自定义页面websitelink.com/components\com\u virtuemart\themes\default\templates\browse\browse\u 3.php 我添加代码 <div class="addtocart_buttonList"> <?php $button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO'); $button_cls = 'addtocart_b
websitelink.com/components\com\u virtuemart\themes\default\templates\browse\browse\u 3.php
我添加代码
<div class="addtocart_buttonList">
<?php
$button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO');
$button_cls = 'addtocart_button';
if( CHECK_STOCK == '1' && ( $product_in_stock < 1 ) ) {
$button_lbl = $VM_LANG->_('VM_CART_NOTIFY');
$button_cls = 'notify_button';
$notify = true;
} else {
$notify = false;
}
?>
<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $i ?>" class="addtocart_form" <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
<input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
<input type="hidden" name="category_id" value="<?php echo @$_REQUEST['category_id'] ?>" />
<input type="hidden" name="product_id" value="<?php echo $product_id ?>" />
<input type="hidden" name="prod_id[]" value="<?php echo $product_id ?>" />
<input type="hidden" name="page" value="shop.cart" />
<input type="hidden" name="func" value="cartadd" />
<input type="hidden" name="Itemid" value="<?php echo $sess->getShopItemid() ?>" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="set_price[]" value="" />
<input type="hidden" name="adjust_price[]" value="" />
<input type="hidden" name="master_product[]" value="" />
</form>
</div>
如何解决此问题?您需要指定一个数量作为输入字段,隐藏或其他方式。我们只希望客户能够订购其中一个项目,因此添加了以下代码:
<input type="hidden" value="1" name="quantity">
使该命名输入字段满足Virtuemart验证
<input type="hidden" value="1" name="quantity">