News:

Support the VirtueMart project and become a member

Main Menu

Remove Sales price on select products but leave my price.

Started by bmw2182, April 06, 2015, 01:28:10 AM

Previous topic - Next topic

bmw2182

Running Joomla 3.4.1 & Virtumart 3.0.6  http://www.elceesvintagecloset.com

For most of the products the client wants both Retail Price and My Price to show, but there is one category that she just wants My Price to show. 

I looked at creating artist.php in components/com_virteumart/views/productdetails/tmpl - but it seems to be an all or nothing sort of thing there.  I'm not sure what I can replace the code with to get just the My Price

Also where would I change it for the Product Browse page?

Thanks in advance!

jenkinhill

As a developer you will realise that you can use template overrides for a single category (or even for single products) when required.

In VM3 the sublayout prices.php is used to show the prices, so the method I use to change prices shown is to start with the category, but I work backwards.

Make an override for  components/com_virtuemart/sublayouts/prices.php  - and maybe name it prices2.php - and edit that file just to show the price you wish to display.
Then make an override for  components/com_virtuemart/sublayouts/products.php so that it calls the prices2 sublayout, maybe name this file products2.php
Finally make an override for components/com_virtuemart/views/category/tmpl/default.php to call the products2 sublayout. Name the override file as you wish, eg default2.php

For the product details make an override for components/com_virtuemart/views/productdetails/tmpl/default.php to call the prices2 sublayout instead of the normal prices layout.

http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

bmw2182

Thank you for the information.  I must have something wrong as I lose the information on the product browse page when using the override.  I was successful with the product details page! Thank you!!!

Make an override for  components/com_virtuemart/sublayouts/prices.php
I created artistprices.php and commented out line 36
      //echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);//

Then make an override for components/com_virtuemart/sublayouts/products.php
I created artistproducts.php
on line 102 changed prices to artistprices
<?php //echo $rowsHeight[$row]['price'] ?>
         <div class="vm3pr-<?php echo $rowsHeight[$row]['price'] ?>"> <?php
            echo shopFunctionsF::renderVmSubLayout('artistprices',array('product'=>$product,'currency'=>$currency)); ?>

Finally make an override for components/com_virtuemart/views/category/tmpl/default.php
I created artist.php and changed line 140 from products to artistproducts
   echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('artistproducts'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

What am I doing wrong?

GJC Web Design

this can't be right

echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('artistproducts'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

try

echo shopFunctionsF::renderVmSubLayout('artistproducts',array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

and the single biggest help I find when doing this (esp. if lots of over rides) is adding in the html of each

<!---cat prod - template over ride - artistproducts -->

so simple - ah - but the joy when it appears...
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

bmw2182

Thank you so much!  That did the truck and the COMMENTS are a life safer :)! Some may say I over use them, but they are helpful.

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation