If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

VirtueMart. Zero product prices issue

This tutorial is going to show you how to solve a problem with zero product prices when no discount is selected.

On some templates, when in your admin go to Components -> Virtuemart, click on Product list, select a product and in the Product Information tab change Discount Type to 0 (-none-) and click on Apply to save your changes, the price shows like this

To fix this, you need to access the theme files on your server, navigate to components/com_virtuemart/themes/vmtheme(your_theme_number)/templates/common/ and open price.tpl.php to edit. Look for the following code:

in price.tpl.php

  <?php
  if(!empty($discount_info["amount"])) {
  ?>
  <span class="productPrice">
  <?php echo $CURRENCY_DISPLAY->getFullValue($base_price) ?>
  <?php echo $text_including_tax ?>
  </span>
  <?php
  }
  ?>
  <?php
  if( !empty( $price_info["product_price_id"] )) { ?>
  <span class="product-Old-Price">
  <?php echo $CURRENCY_DISPLAY->getFullValue($undiscounted_price); ?>
  </span>
  <?php
  }
  echo $price_table;
  ?>

Where you need to interchange these two lines

if(!empty($discount_info["amount"])) { 
if( !empty( $price_info["product_price_id"] )) { ?>

so that your code would look like this

<?php
  if( !empty( $price_info["product_price_id"] )) {
  ?>
  <span class="productPrice">
  <?php echo $CURRENCY_DISPLAY->getFullValue($base_price) ?>
  <?php echo $text_including_tax ?>
  </span>
  <?php
  }
  ?>
  <?php
  if(!empty($discount_info["amount"])) { ?>
  <span class="product-Old-Price">
  <?php echo $CURRENCY_DISPLAY->getFullValue($undiscounted_price); ?>
  </span>
  <?php
  }
  echo $price_table;
  ?>

Once you have done that, save the changes, re-fresh your product page and you are done.

Please, see the demo below for additional info.

VirtueMart. Zero product prices issue

VirtueMart. Zero product prices issue, 5.0 out of 5 based on 1 rating