News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Base Price showing as admin but not shopper

Started by Brody, December 14, 2012, 04:50:24 AM

Previous topic - Next topic

Maxim Pishnyak

Isn't using base price forbidden currently? Did you check recent threads about base price destiny?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Brody

No I just stumbled across my thread that I started last year and noticed there was lots of activity. I am still eager to find a way to show MSRP and OUR Price. I know I can change the language file, but the problem is, the only "other prices" that show up post UNDER the price I want to offer the product at, not above it. It looks silly to have the order of prices that way.

If you know of what the future holds for pricing layouts I would be happy to hear.

Maxim Pishnyak

You can reorder prices in the template overrides.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

spacecadet

ok, something has changed for me now....the price that is displayed on the product page is now the final discounted price.

previously, it would only display the final salesprice.

i guess that upgrading to 2.0.22c has brought this change.

but still, no matter what combination of buttons i click on "show following prices" in configuration, it makes absolutely no difference to the price displayed. whether i click all of the buttons, or some of them, or none of them, it does the same thing: displays the final discounted price.

any suggestions anyone can offer on what i might be doing wrong here would be very much appreciated.

what i would like to happen is to display the base price, and then the discounted price.

any help much appreciated

thanks.

j2.5.14 vm 2.0.22c

jenkinhill

Check the default_showprices.php template file. You may be using an incorrect template override.
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

spacecadet

Thanks for your reply.

I turned off the template....and still the same....cannot get any different configuration of prices to display

When you say "check" the default_showprices.php template file, i'm not quite sure what i should be checking for.

How could I tell if I was using an incorrect template override please?

vm2.0.22c j2.5.14

Thanks

jenkinhill

The default price display template is components/com_virtuemart/views/productdetails/tmpl/default_showprices.php

If you have an override it will be in  templates/yourjoomlatemplate/html/productdetails/  and probably will also be named default_showprices.php

Compare the two.
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

spacecadet

In this current thread, on the previous page, the solution which is being presented for the problem discussed here, is that in the file

components/com_virtuemart/views/productdetails/tmpl/default_showprices.php

one should look around line 164 and there one finds the code:

ORIGINAL CODE (Around line 164):

if ($this->showBasePrice) {
            echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );   
            }

ok, well, for me, when i go to that file, I find that the file is only 58 lines long....and around line 32 I find the following string

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);
      }


clearly the first part of the string corresponds to the target string, but then it differs

i cannot find any string in this file which corresponds to the one which we are supposed to replace....

???

has the file changed since the above post was written? does it now need to be rewritten? or should it be working correctly now?

in regards to my problem, this may or may not be the answer. I've realised now after rereading this thread carefully that these discounts we want to show up are entered in to the Override section of the product, rather than the Taxes and Calculations Rulings section. but i still havent got prices to display how i want them. so first i need to sort out this issue with the default_showprices.php file as per the above. once i understand what that file is supposed to look like, whether it needs the code change, and if so, where that needs to go, then i should be able to figure out the rest. i hope.

thanks..

VM2.0.24
JM 2.5.14




cas

Rather than all of us having to hack the code, why doesn't the VM team simply do what we have all been asking for...  Just have an admin option to display Base Price on the front end.  If you are in a country that should not show the base price, then turn it off, and if you are in the US then turn it on.  Problem solved!

jenkinhill

My biggest client shifts hundreds of thousands pounds worth of furniture a year through their intranet. They use the base price as it is meant to be used - for the price thay pay to their own supplier, ie their cost price. Then they add different profit margins for their various shopper groups to get the selling price and than apply tax. That is all they want to show, price to their customer & Tax. No way do they want their cost price to be shown.

For another client who has a flexible profit margin their selling price is shown as Salesprice without tax (ie their basic price) which is obtained/calculated by entering the selling (final) price at which they want to sell the product and working backwards, deducting tax. They then show that base (for them) price, the tax amount and the final price. They do check the calculated base price just to ensure that it is more than their actual cost price.

Nothing tricky about these two at all. But Milbo has mentioned the possibility of adding the ability to show the cost price (the current base price) in 2.2. Now I don't know about you, but I don't think my clients ever want to display their cost price as it discloses their profit margin!
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

cas

Hi Kelvyn,

I agree there are lots of situations when you would not want to display the Base Price, but as you can see from this post, there are lots of folks who do want to display it, so that's why having an on/off option in the admin, solves the problem for everyone.  Folks can turn it on or off as they wish. 

As far as which price to display on the frontend (base price, cost price, etc), just make all the prices optional to display via the admin, and let each of us set the admin settings based on our needs.   Set us free to choose.  Thanks for your help.

Cheers,
Chuck

Ixelink

And not being in the USA, I only just want to display the normal customers price, WITH the tax. And then, after calculation of more of them, the total tax price and the TOTAL sum (with tax). In the Netherlands that is normal for customers.
But the normal customers price will not appear, the only one that will show is the price WITHOUT tax! But customers don't use that here.

Chainsaw: € 85,00   quantity: 2    Tax (21%): € 29,50   Total: € 170,00

Why is the default way of working for Virtuemart not sufficient?

Regards,
Maarten

Vicky

Hey Guys,
Got solutions for this.
Here you go.

Find this file "components\com_virtuemart\views\productdetails\tmpl\default_showprices.php"
add this code where ever you want
echo "Base Price". $this->product->prices['basePrice'];

Cheers,
VickY  :o

spacecadet

Thanks for that suggestion.

However, it made no difference for me.

I've been trying to make this work for over 6 months now. Over multiple threads. Tried everything. Read everything. Checked everything.

All I want to do is display the normal price, whatever you want to call it, and this month's special discount price.

Like this:

Shampoo: Normal price $14
                 Special Price this month $7

That's it. That's all I want to do.

I set the discount in the Taxes and Discounts area. It works fine. But no matter what combination of prices to display I use, I only ever get the final price, the discounted price. I try to achieve the same effect using the override function in the product itself. Again, this works: it displays the correct final discounted price. but again, no matter what combination of prices I select to appear in the the Configuration/Pricing tab, only the final correct discounted price ever displays.

I am not using a template override for the default show prices.php files.

It may be that i am overlooking something blindingly obvious. It may be that i am doing something wrong. It may be that Virtuemart is not capable of displaying two prices like that, with a line through the first one, indicating that there is a special discount promotion in effect.

Whichever it is, I would really appreciate if someone was able to assist me in thoroughly getting to the bottom of it. Whatever it takes.

Thank you.

hoknight

Quote from: XenoGen on July 09, 2013, 19:45:10 PM
Here`s the solution to getting the Base Price to show up for ALL Shoppers.
This is important for those US Customers who want to display the two prices (OLD PRICE: $150    NEW PRICE: $100):

Milbo already mentioned the solution, but I want to elaborate because it`s not as obvious to many people (myself included).
Here is what you do:

1) Copy the file located here: components/com_virtuemart/views/productdetails/tmpl/default_showprices.php

2) Edit the file on your local computer (see below)

3) Copy the file back to your server at: templates/YOUR_TEMPLATE_NAME/html/com_virtuemart/productdetails/default_showprices.php
(make sure to change "Your_template_Name" with the actual name of the directory where your template files are located.)
The reason you are copying the files to your template directory is becasue this is creating the template override - it doesn't overwrite the base VirtueMart files, so it allows you to update the software and still keep your changes, just in case you were wondering why we copy it there.

4) Test it. It should now work. Celebrate!

5) Still the prices accordingly with CSS until it looks the way you'd like.


Here's the change you need to make to the DEFAULT_SHOWPRICES.PHP file before copying it back:

ORIGINAL CODE (Around line 164):

if ($this->showBasePrice) {
            echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );   
            }


REPLACE WITH:

if ($this->showBasePrice) {
               echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
            }
            echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );   


EXPLANATION:

Basically, the ECHO line displays the BasePrice. Originally, it's inside the IF staement, making it show only to the Admins. So, by moving it outside of the IF statement, it will now show to EVERYONE. Yay!

PS: If you need further help about getting VirtueMart 2 to work showing the two prices, with one scratched out, feel free to message me. I spent weeks with VM, until I finally was able to make it do everything I wanted it to, and it wasn't always easy, so I understand your frustration. :)


Finally,we did it! Thanks to XenoGen help!

[attachment cleanup by admin]