No price - ask for price

GK User
Sat Feb 27, 2016 4:38 pm
Hello to all. I have 2 problems with prices.
1) I have enabled the "Show call for price, when the price is empty" option in my site. I am facing the below problem.
I category view it appears the "Ask for price" but below it shows the word "Price:" I need the word price to appear when there is a price but if there is no price i need only the "Ask for Price" to be appeared.
2) The second problem is the in product view. Even if there is a discount or not the word "Discount" appears below the price.
User avatar
Expert Boarder

teitbite
Wed Mar 02, 2016 9:35 am
Hi

Please tell me the url to Your site and if template were modified. Have You tried update it to the latest version ?
User avatar
Moderator

GK User
Wed Mar 02, 2016 7:19 pm
Yes. I do have the last version of the template. I have made some modifications, but I managed to find the solution.
In "templates/gk_storefront/html/com_virtuemart/category/default.php" was missing an "else" value. I do not know if it is my fault due to a modification of if it is a temlate's bug. I add it around line 205

Code: Select all
<div class="catProductPrice" id="productPrice<?php echo $product->virtuemart_product_id ?>">
      <?php
         if ($this->show_prices == '1') {
              if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and !$product->images[0]->file_is_downloadable) {
                        echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                     }
                        else
         echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
                  } ?>
               </div>
User avatar
Expert Boarder

teitbite
Mon Mar 07, 2016 10:04 am
Hi

I think the price should not be constructed by "createPriceDiv" function if askprice if enabled. Anyway Your solution is pretty good, so than You for shearing it. I'm closing this thread since answer is complete.
User avatar
Moderator


cron