Show normal price dan discount price on category view

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Jul 23, 2013 11:52 am
Reply with quote
Report this post
Dear Mate...

Good day :)

Please help me to Show normal price dan discount price on category view as my attachment.

thanks in advance
User avatar
Junior Boarder

GK User
Wed Jul 24, 2013 8:08 am
Reply with quote
Report this post
Please open file
gk_bikestore/html/com_virtuemart/category/default.php
and find this line :

Code: Select all
echo $this->currency->createPriceDiv('salesPrice','',$product->prices);


then, please replace it with :

Code: Select all
echo $this->currency->createPriceDiv('basePrice','',$product->prices);


this should help. You can also try to use 'basePriceWithTax' instead of 'basePrice'
User avatar
Platinum Boarder

GK User
Wed Jul 24, 2013 8:50 am
Reply with quote
Report this post
Hi

Thank you for fast respon :)

sorry but i mean, i'll show the base price + sales price after discount and the discount price as attachment i revised.
User avatar
Junior Boarder

GK User
Wed Jul 24, 2013 10:31 am
Reply with quote
Report this post
So you just need to duplicate this code just paste code with basePrice below the salesPrice.
User avatar
Platinum Boarder

GK User
Fri Jul 26, 2013 4:01 am
Reply with quote
Report this post
Hi

i have follow your tips and add a little script, anyway thank you for fast respon bkrztuk :)
User avatar
Junior Boarder

GK User
Fri Jul 26, 2013 11:05 am
Reply with quote
Report this post
You can paste here your code, maybe some other users want to make exactly the same modification :)
User avatar
Platinum Boarder

GK User
Mon Jul 29, 2013 6:51 am
Reply with quote
Report this post
Hi

Sorry for delay,

the code is on default.php in folder:
templates\gk_bikestore\html\com_virtuemart\category\

around line 193, i delete this code first:

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


then i put the code around line 226 like this:

Code: Select all
<div class="catProductPrice" id="productPrice<?php echo $product->virtuemart_product_id ?>">
                              <?php
               if ($this->show_prices == '1') {
                  if (empty($product->prices['salesPrice']) and VmConfig::get ('askprice', 1) and
                                             !$product->images[0]->file_is_downloadable) {
                     echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                  }
                     //todo add config settings
                     if ($this->showBasePrice) {
                        echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
                        echo $this->currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $product->prices);
                     }
                     echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
                     if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
                        echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</span>";
                     }
                     if (round($product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
                        echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
                     }
                     echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
                     echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
                     echo $this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
                     echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
                     $unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit);
                     echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $product->prices);
                  } ?>

               </div>


finish, with normal price and discount price on bellow of thumbnail product image. thank you.





bkrztuk wrote:You can paste here your code, maybe some other users want to make exactly the same modification :)
User avatar
Junior Boarder


cron