VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: datalab on July 15, 2014, 11:17:20 AM

Title: (SOLVED) Base Price Issue
Post by: datalab on July 15, 2014, 11:17:20 AM
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!
Title: Re: Base Price Issue
Post by: jenkinhill on July 15, 2014, 11:22:43 AM
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?
Title: Re: Base Price Issue
Post by: datalab on July 15, 2014, 11:36:02 AM
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?

Title: Re: Base Price Issue
Post by: 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);
Title: Re: Base Price Issue
Post by: AH on July 15, 2014, 12:20:45 PM
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);
}

}
Title: Re: Base Price Issue
Post by: datalab on July 15, 2014, 22:10:52 PM
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);


Title: Re: Base Price Issue
Post by: GJC Web Design on July 15, 2014, 23:35:28 PM
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
Title: Re: Base Price Issue
Post by: datalab on July 16, 2014, 00:54:12 AM
Thanks for your help dudes, i did it!

Nice one!
Title: Re: (SOLVED) Base Price Issue
Post by: cbabino on July 16, 2014, 16:20:53 PM
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
Title: Re: (SOLVED) Base Price Issue
Post by: GJC Web Design on July 17, 2014, 10:50:45 AM
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