News:

Looking for documentation? Take a look on our wiki

Main Menu

(SOLVED) Base Price Issue

Started by datalab, July 15, 2014, 11:17:20 AM

Previous topic - Next topic

datalab

Hello.

I can see that the base price shown only when the admin is logged in. How to make it visible to Guests and default users? VM 2.6.6, Default template.

Thanks!

jenkinhill

The base price is what a product costs you, ie it does not include your profit margin or other markups and does not include tax. Now, why would you want you customers to know how much profit you make on a product?
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

datalab

Because im using the whole system in a different way that people mostly do!

And in that field i wanna have the price i sell!

Anyway, how can i do it? can i?


GJC Web Design

select show base price in config->prices

then in the price template either (if your using standard templates)

$this->showBasePrice = 1;

or add

echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices);
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

AH

#4
Hmm..

It really depends how your business realtionships with suppliers are structured.  Base price is whatever you chose it to be and is not as prescriptive as saying

Quote
The base price is what a product costs you, ie it does not include your profit margin or other markups and does not include tax. Now, why would you want you customers to know how much profit you make on a product?

It certainly can be used in such a manner and has been structured to facilitate such an approach

However some users have supplier agreements where discounts vary widely across product ranges and even within product ranges. 
Trying to get VM to automate pricing uplift outside of a simple set of scenarios may prove too much of a headache.

As a consequence some users chose the base price to store ex-tax price and manage margins away form VM

As GJC states it is the "if"  that is preventing baseprice being shown for non admin users

You will have to create template overrides in category and product views


if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices);
if (round($this->product->prices['basePrice'],$this->currency->_priceConfig['basePriceVariant'][1]) != $this->product->prices['basePriceVariant']) {
echo $this->currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices);
}

}
Regards
A

Joomla 3.10.11
php 8.0

datalab

Where do i do this????

which File??

Quote from: GJC Web Design on July 15, 2014, 12:16:58 PM
select show base price in config->prices

then in the price template either (if your using standard templates)

$this->showBasePrice = 1;

or add

echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices);



GJC Web Design

Hmm - if your going to build a VM site I would suggest you have a bit of a look around what it is and what it does..

the file naming is very logical, following normal Joomla practice

so ->  over ride  components/com_virtuemart/views/productdetails/tmpl/default_showprices.php
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

datalab

Thanks for your help dudes, i did it!

Nice one!

cbabino

Hello I have the same problem and I would like an idea for the views in category and wirtuemart. Because I tried to use the above solution but blank my website.

Any suggestion will be welcome

GJC Web Design

just checked the code in components/com_virtuemart/views/category/tmpl/default.php

looks the same to me

see no reason why adding $this->showBasePrice = 1;  won't work



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