Scripts to customize your product page

Product fields that are not listed here can be used like this
<?php echo $product->COLUMN_NAME ?>

The difference between category and product page is $this
$this->product      is for product page
$product->   is for product fields on the category page.

SO, to add weight to the category page. You can do
<?php echo $product->product_weight ?>

Category Name
<?php echo $this->category->category_name; ?>

Category Description
<?php echo $this->category->category_description ; ?>

Product Name with Link
<?php echo JHTML::link($product->link, $product->product_name) ?>

Product Details Link with anchor “Product Details”
<?php echo JHTML::link($product->link, JText::_(‘COM_VIRTUEMART_PRODUCT_DETAILS’), array(‘title’ => $product->product_name,’class’ =>
‘product-details’));?>

Order by list
<?php echo $this->orderByList; ?>

Manufacturer Dropdown

<?php echo $this->orderByList; ?>

Pages/Links/Pagination
<?php echo $this->vmPagination->getResultsCounter();?>
<?php echo $this->vmPagination->getLimitBox(); ?>
<?php echo $this->vmPagination->getPagesLinks(); ?>
<?php echo $this->vmPagination->getPagesCounter(); ?>

Short Description
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, ‘…’) ?>

^^ Notice the 40 above. limitStringByWord strips the text to 40 characters. You can change the “40”
For full short desc

<?php echo $product->product_s_desc ?>

POP UP Product Image

<?php echo $product->images[0]->displayMediaThumb(‘class=”browseProductImage” border=”0″ title=”‘.$product->product_name.'”
‘,true,’class=”modal”‘); ?>

Link Image to product page

<?php echo JHTML::_(‘link’, JRoute::_(‘index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=’.$product->virtuemart_product_id.’&virtuemart_category_id=’.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb(‘class=”catImage” border=”0″‘,false));
?>

Stock Level
<?php echo $product->stock->stock_level ?>

# Products in Stock
<?php echo $product->product_in_stock ?>

Pasted from forum.virtuemart.net/index.php?topic=97744.0

Last Update: October 30, 2017  

32    Virtuemart Issues    
Total 0 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Add A Knowledge Base Question !

You will get a notification email when Knowledgebase answerd/updated!

+ = Verify Human or Spambot ?