{"id":13487,"date":"2011-12-26T06:34:37","date_gmt":"2011-12-26T11:34:37","guid":{"rendered":"http:\/\/info.template-help.com\/?p=13487"},"modified":"2017-02-22T05:03:18","modified_gmt":"2017-02-22T10:03:18","slug":"virtuemart-zero-product-prices-issue","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/virtuemart-zero-product-prices-issue.html","title":{"rendered":"VirtueMart. Zero product prices issue"},"content":{"rendered":"<p>This tutorial is going to show you how to solve a problem with zero product prices when no discount is selected. <\/p>\r\n\r\n<p>On some templates, when in your admin go to Components -&gt; 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 <\/p>\r\n\r\n<a href=\"http:\/\/info.template-help.com\/wp-content\/uploads\/2011\/12\/zero_price_1.jpg\"><img loading=\"lazy\" src=\"http:\/\/info.template-help.com\/wp-content\/uploads\/2011\/12\/zero_price_1-300x250.jpg\" alt=\"\" title=\"zero_price_1\" width=\"300\" height=\"250\" class=\"aligncenter size-medium wp-image-13488\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/12\/zero_price_1-300x250.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/12\/zero_price_1.jpg 396w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<p>To fix this, you need to access the theme files on your server, navigate to <strong>components\/com_virtuemart\/themes\/vmtheme(your_theme_number)\/templates\/common\/<\/strong>  and open <strong>price.tpl.php<\/strong> to edit.  Look for the  following code:<\/p>\r\n\r\n<p>in price.tpl.php<\/p>\r\n\r\n<pre class=\"brush:php\">\r\n  &lt;?php\r\n  if(!empty($discount_info[&quot;amount&quot;])) {\r\n  ?&gt;\r\n  &lt;span class=&quot;productPrice&quot;&gt;\r\n  &lt;?php echo $CURRENCY_DISPLAY-&gt;getFullValue($base_price) ?&gt;\r\n  &lt;?php echo $text_including_tax ?&gt;\r\n  &lt;\/span&gt;\r\n  &lt;?php\r\n  }\r\n  ?&gt;\r\n  &lt;?php\r\n  if( !empty( $price_info[&quot;product_price_id&quot;] )) { ?&gt;\r\n  &lt;span class=&quot;product-Old-Price&quot;&gt;\r\n  &lt;?php echo $CURRENCY_DISPLAY-&gt;getFullValue($undiscounted_price); ?&gt;\r\n  &lt;\/span&gt;\r\n  &lt;?php\r\n  }\r\n  echo $price_table;\r\n  ?&gt;<\/pre>\r\n  \r\n<p>Where you need to interchange these two lines <\/p>\r\n\r\n<pre class=\"brush:php\">\r\nif(!empty($discount_info[&quot;amount&quot;])) { \r\nif( !empty( $price_info[&quot;product_price_id&quot;] )) { ?&gt;\r\n<\/pre>\r\n\r\n<p>so that your code would look like this<\/p>\r\n\r\n<pre class=\"brush:php\">\r\n&lt;?php\r\n  if( !empty( $price_info[&quot;product_price_id&quot;] )) {\r\n  ?&gt;\r\n  &lt;span class=&quot;productPrice&quot;&gt;\r\n  &lt;?php echo $CURRENCY_DISPLAY-&gt;getFullValue($base_price) ?&gt;\r\n  &lt;?php echo $text_including_tax ?&gt;\r\n  &lt;\/span&gt;\r\n  &lt;?php\r\n  }\r\n  ?&gt;\r\n  &lt;?php\r\n  if(!empty($discount_info[&quot;amount&quot;])) { ?&gt;\r\n  &lt;span class=&quot;product-Old-Price&quot;&gt;\r\n  &lt;?php echo $CURRENCY_DISPLAY-&gt;getFullValue($undiscounted_price); ?&gt;\r\n  &lt;\/span&gt;\r\n  &lt;?php\r\n  }\r\n  echo $price_table;\r\n  ?&gt;<\/pre>\r\n  \r\n<p>Once you have done that, save the changes, re-fresh your product page and you are done.<\/p>\r\n<p>Please, see the demo below for additional info.<\/p>\r\n\r\n<a href=\"\/help\/files\/virtuemart\/zero_prices_issue_virtuemart.htm\" target=\"blank\">VirtueMart. Zero product prices issue<\/a>","protected":false},"excerpt":{"rendered":"<p>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 -&gt; Virtuemart, click on Product list, select a product and in the Product Information tab change Discount Type to 0 (-none-) and click on [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":13490,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[733],"tags":[2564,544,542,2404,1122],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/13487"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=13487"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/13487\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/13490"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=13487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=13487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=13487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}