If you need to show something for which there is no appropriate Themler control you can use CMS Code control with native joomla or Vistuemart functions. Simply add the provided code into the CMS Code editor (#1) and configure the appearance of the text inside this control using Styles options under #2:

Add "Products in Stock"

<?php echo jtext::_('COM_VIRTUEMART_STOCK_AMOUNT');?>: <?php echo $this->product->product_in_stock; ?>

Add Product SKU

<?php echo $this->product->product_sku; ?>

Add Product Description (not product short description) to the Products template

By Default Themler shows Product Short Description in the Product Description control on the Products Template.
To show full description please use CMS Code control with the following code:

<?php echo $product->product_desc ?>

Product Description or Short Product Description on the Featured Products slider (VM Front Page)

Short Product Description:

<?php echo $product->product_s_desc ?>

Short Product Description with limited characters:

<?php
if (!empty($product->product_s_desc)) {
echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 60, ' ...') ?>
<?php } ?>

Full Product Description:

<?php echo $product->product_desc ?>

Show Custom Fields on the Products template.

By default, Themler outputs VM custom fields on the Product Details template using Product Variation control. This control can be added on the Product Details Template only.
In case if you need to output it on the Products template you can add CMS Code control into the Product Grid Item control and insert the following code:

<?php
$position = 'addtocart';
$class = 'product-fields';

if (!empty($product->customfieldsSorted[$position])) {
?>
<div class="<?php echo $class?>">
<?php
$custom_title = null;
foreach ($product->customfieldsSorted[$position] as $field) {
if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0
continue;
?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title and $field->show_title) { ?>
<span class="product-fields-title-wrapper"><span class="product-fields-title"><strong><?php echo vmText::_ ($field->custom_title) ?></strong></span>
<?php if ($field->custom_tip) {
echo JHtml::tooltip ($field->custom_tip, vmText::_ ($field->custom_title), 'tooltip.png');
} ?></span>
<?php }
if (!empty($field->display)){
?><span class="product-field-display"><?php echo $field->display ?></span><?php
}
if (!empty($field->display)){
?><span class="product-field-desc"><?php echo vmText::_($field->custom_desc) ?></span> <?php
}
?>
</div>
<?php
$custom_title = $field->custom_title;
} ?>

</div><div class="clear"></div>
<?php
} ?>

Please find the following line in the provided code:
$position = 'addtocart';

Here addtocart is a Layout Position name of the custom field.

Category Name and Description on the product Details:

Category Name:
<div><?php echo $this->category->category_name; ?></div>
Category Description:
<div><?php echo $this->category->category_description ; ?></div>

"Product Details" button for Products template

<a href='<?php echo $productItems->productTitle->link; ?>' class="bd-button">View Details</a>

This is the code for original VM button:

<?php // Product Details Button
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 , FALSE), vmText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name, 'class' => 'product-details' ) );
?>

Product Prices

Here is a list of all prices that can be outputted by Virtuemart (for product Details template):

Base Price:
echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );

Base price for variant:
echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );

Variant price modification:
echo $this->currency->createPriceDiv ( 'variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices );

Base prive with Tax:
echo $this->currency->createPriceDiv ( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices );

Sales price without Tax:
echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );

Sales Prive with Discount
echo $this->currency->createPriceDiv ( 'salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices );

Sales Price:
echo $this->currency->createPriceDiv ( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices );

Sales prive without Tax:
echo $this->currency->createPriceDiv ( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices );

Product Discount Amount:
echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );

Product Tax Amount:
echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices );

Please note that all php code inside CMS Code control should be wrapped into the php tags: <?php ... ?>.

For example:
<?php echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices); ?>

Sometimes we need to display additional price basing on some condition, for example, for discounted products only.
Here are a few simple conditions:

  • if the product has discount:
    if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
    // your price here
    }

  • if the product does not have discount:
    if ($product->prices['discountedPriceWithoutTax'] == $product->prices['priceWithoutTax']) {
    // your price here
    }

For example:

Base Price with Tax for products with discount:

<?php if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv('basePriceWithTax','COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX',$product->prices);
} ?>

Sales price without tax:

<?php if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
} else {
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
} ?>

These all works on Product Details template only. For Products template please try a little different code:

<?php
if(!(isset($currency))){
$currency = CurrencyDisplay::getInstance ();
}
echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
?>

Base Price for products with discount only:

<?php
if(!(isset($currency))){
$currency = CurrencyDisplay::getInstance ();
}
if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
}
?>

or use this condition to check if there is discount of any type:

if ($product->prices['product_discount_id'] !="0"){
// show something here
}

How to show Product Image subtitle

<?php
echo $product->images[0]->file_description;
?>

- [Add "Products in Stock"](#t_1) - [Add Product SKU](#t_2) - [Add Product Description (not product short description) to the Products template](#t_3) - [Product Description or Short Product Description on the Featured Products slider (VM Front Page)](#t_4) - [Show Custom Fields on the Products template.](#t_5) - [Category Name and Description on the product Details](#t_10) - ["Product Details" button for Products template](#t_11) - [Product prices](#t_price) - [How to show product Image subtitle](image_subtitle) <div class="alert alert-warning"> <p>If you need to show something for which there is no appropriate Themler control you can use <b>CMS Code</b> control with native joomla or Vistuemart functions. Simply add the provided code into the CMS Code editor (#1) and configure the appearance of the text inside this control using Styles options under #2: </p> <img src="http://attachments.answers.billiondigital.com/819/11819/cms-code-settings-2.png"> </div> <a id="t_1"></a> #### Add "Products in Stock" `<?php echo jtext::_('COM_VIRTUEMART_STOCK_AMOUNT');?>: <?php echo $this->product->product_in_stock; ?>` <a id="t_2"></a> #### Add Product SKU `<?php echo $this->product->product_sku; ?>` <a id="t_3"></a> #### Add Product Description (not product short description) to the Products template By Default Themler shows Product Short Description in the Product Description control on the Products Template. To show full description please use CMS Code control with the following code: `<?php echo $product->product_desc ?>` <a id="t_4"></a> #### Product Description or Short Product Description on the Featured Products slider (VM Front Page) Short Product Description: `<?php echo $product->product_s_desc ?>` Short Product Description with limited characters: `<?php if (!empty($product->product_s_desc)) { echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 60, ' ...') ?> <?php } ?>` Full Product Description: `<?php echo $product->product_desc ?>` <a id="t_5"></a> #### Show Custom Fields on the Products template. By default, Themler outputs VM custom fields on the Product Details template using [Product Variation](page:9441) control. This control can be added on the Product Details Template only. In case if you need to output it on the Products template you can add CMS Code control into the Product Grid Item control and insert the following code: `<?php $position = 'addtocart'; $class = 'product-fields';` `if (!empty($product->customfieldsSorted[$position])) { ?> <div class="<?php echo $class?>"> <?php $custom_title = null; foreach ($product->customfieldsSorted[$position] as $field) { if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0 continue; ?><div class="product-field product-field-type-<?php echo $field->field_type ?>"> <?php if ($field->custom_title != $custom_title and $field->show_title) { ?> <span class="product-fields-title-wrapper"><span class="product-fields-title"><strong><?php echo vmText::_ ($field->custom_title) ?></strong></span> <?php if ($field->custom_tip) { echo JHtml::tooltip ($field->custom_tip, vmText::_ ($field->custom_title), 'tooltip.png'); } ?></span> <?php } if (!empty($field->display)){ ?><span class="product-field-display"><?php echo $field->display ?></span><?php } if (!empty($field->display)){ ?><span class="product-field-desc"><?php echo vmText::_($field->custom_desc) ?></span> <?php } ?> </div> <?php $custom_title = $field->custom_title; } ?>` ` </div><div class="clear"></div> <?php } ?>` Please find the following line in the provided code: `$position = 'addtocart';` Here `addtocart` is a **Layout Position** name of the custom field. <a id="t_10"></a> #### Category Name and Description on the product Details: Category Name: `<div><?php echo $this->category->category_name; ?></div>` Category Description: `<div><?php echo $this->category->category_description ; ?></div>` <a id="t_11"></a> #### "Product Details" button for Products template `<a href='<?php echo $productItems->productTitle->link; ?>' class="bd-button">View Details</a>` This is the code for original VM button: `<?php // Product Details Button 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 , FALSE), vmText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name, 'class' => 'product-details' ) ); ?>` <a id="t_price"></a> #### Product Prices Here is a list of all prices that can be outputted by Virtuemart (for product Details template): Base Price: `echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );` Base price for variant: `echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );` Variant price modification: `echo $this->currency->createPriceDiv ( 'variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices );` Base prive with Tax: `echo $this->currency->createPriceDiv ( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices );` Sales price without Tax: `echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );` Sales Prive with Discount `echo $this->currency->createPriceDiv ( 'salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices );` Sales Price: `echo $this->currency->createPriceDiv ( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices );` Sales prive without Tax: `echo $this->currency->createPriceDiv ( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices );` Product Discount Amount: `echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );` Product Tax Amount: `echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices );` Please note that all php code inside CMS Code control should be wrapped into the php tags: `<?php ... ?>`. **For example:** `<?php echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices); ?>` Sometimes we need to display additional price basing on some condition, for example, for discounted products only. Here are a few simple conditions: - if the product has discount: `if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) { // your price here }` - if the product does not have discount: `if ($product->prices['discountedPriceWithoutTax'] == $product->prices['priceWithoutTax']) { // your price here }` **For example:** **Base Price with Tax for products with discount:** `<?php if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) { echo $this->currency->createPriceDiv('basePriceWithTax','COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX',$product->prices); } ?>` **Sales price without tax:** `<?php if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) { echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices); } else { echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices); } ?>` These all works on **Product Details template only**. For **Products template** please try a little different code: `<?php if(!(isset($currency))){ $currency = CurrencyDisplay::getInstance (); } echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices); ?>` **Base Price for products with discount only:** `<?php if(!(isset($currency))){ $currency = CurrencyDisplay::getInstance (); } if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) { echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices); } ?>` or use this condition to check if there is discount of any type: `if ($product->prices['product_discount_id'] !="0"){ // show something here }` <a id="image_subtitle"></a> #### How to show Product Image subtitle `<?php echo $product->images[0]->file_description; ?>`