Home
Virtuemart change price layout

Question:  I don't like the way the suggested retail price and discount price are shown in VM 1.1.2.  I would like the discounted price and the retail price to shown on the same line.  I also want the You Save line to have space after the price and to be in bold.

Answer: Easy as pie.  Just open price.tpl.php which is located in components > com_virtuemart > themes > default > templates > common.

Around line 19 find the <br /> and remove it.

<span class="product-Old-Price">
            <?php echo $CURRENCY_DISPLAY->getFullValue($undiscounted_price); ?></span>
     
      <br/>
      <?php

Just remove the <br /> from the code above, save and upload.

For the "You Save issue", change this bit of code starting at line 37 in price.tpl.php

if(!empty($discount_info["amount"])) {
      echo "<br />";
      echo $VM_LANG->_('PHPSHOP_PRODUCT_DISCOUNT_SAVE').": ";
      if($discount_info["is_percent"]==1) {
            echo $discount_info["amount"]."%";
      }

Change to:

if(!empty($discount_info["amount"])) {
      echo "<br /><br /><strong>";
      echo $VM_LANG->_('PHPSHOP_PRODUCT_DISCOUNT_SAVE').": ";
      if($discount_info["is_percent"]==1) {
            echo $discount_info["amount"]."%";
            echo "</strong>";
      }

Notice we added and extra <br /> and <strong>, then added an echo "</strong>";

Of course, you can play with this and adjusted as needed.

 


Request Services
 
First Name
Last Name
E-mail
Phone
Domain
Service needed
Budget
  
Watch video overview


+ Suggested tags