Search

Change Language

Friday, April 8, 2011

Showing Attributes in Product Browse page (Virtue Mart)

in home/administrator/components/com_virtuemart/html/shop.browse.php

// Add-to-Cart Button
      if (USE_AS_CATALOGUE != '1' && $product_price != ""
         && !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )
         && !ps_product::product_has_attributes( $db_browse->f('product_id'), false )
         && $tpl->get_cfg( 'showAddtocartButtonOnProductList' ) ) {

---> Change 'true' by 'false'

home/components/com_virtuemart/themes/default/templates/browse/includes/addtocart_form.tpl.php

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); [

$button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO');
$button_cls = 'addtocart_button';

require_once(CLASSPATH . 'ps_product_attribute.php' ); //Add this line
$ps_product_attribute = new ps_product_attribute; //Add this one too

if( CHECK_STOCK == '1' && !$product_in_stock ) {
   $button_lbl = $VM_LANG->_('VM_CART_NOTIFY');
   $button_cls = 'notify_button';
}
?>

<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 )) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
    <?php echo $ps_product_attribute->list_advanced_attribute($product_id,$product_id); ?><br />
    <?php echo $ps_product_attribute->show_quantity_box($product_id,$product_id); ?><br />
   <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>


Add the two commented lines on line 6 (as shown above) And add this line

<?php echo $ps_product_attribute->list_advanced_attribute($product_id,$product_id); ?><br />
on line 16, just above

<?php echo $ps_product_attribute->show_quantity_box($product_id,$product_id); ?><br /> 

0 comments:

Post a Comment