Author Topic: Base Price showing as admin but not shopper  (Read 28986 times)

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2656
Re: Base Price showing as admin but not shopper
« Reply #30 on: September 12, 2013, 17:26:20 pm »
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

  • Beginner
  • *
  • Posts: 41
Re: Base Price showing as admin but not shopper
« Reply #31 on: September 12, 2013, 18:40:38 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2656
Re: Base Price showing as admin but not shopper
« Reply #32 on: September 15, 2013, 12:30:29 pm »
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

  • Beginner
  • *
  • Posts: 41
  • VirtueMart Version: 2.0.26d
Re: Base Price showing as admin but not shopper
« Reply #33 on: September 23, 2013, 10:49:38 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28336
  • Always on vacation
    • Jenkin Hill Internet
Re: Base Price showing as admin but not shopper
« Reply #34 on: September 23, 2013, 13:11:33 pm »
Check the default_showprices.php template file. You may be using an incorrect template override.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

spacecadet

  • Beginner
  • *
  • Posts: 41
  • VirtueMart Version: 2.0.26d
Re: Base Price showing as admin but not shopper
« Reply #35 on: September 26, 2013, 16:57:23 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28336
  • Always on vacation
    • Jenkin Hill Internet
Re: Base Price showing as admin but not shopper
« Reply #36 on: September 27, 2013, 10:47:31 am »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

spacecadet

  • Beginner
  • *
  • Posts: 41
  • VirtueMart Version: 2.0.26d
Re: Base Price showing as admin but not shopper
« Reply #37 on: October 09, 2013, 14:53:23 pm »
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

  • Jr. Member
  • **
  • Posts: 487
Re: Base Price showing as admin but not shopper
« Reply #38 on: October 09, 2013, 20:21:21 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28336
  • Always on vacation
    • Jenkin Hill Internet
Re: Base Price showing as admin but not shopper
« Reply #39 on: October 09, 2013, 23:58:58 pm »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Base Price showing as admin but not shopper
« Reply #40 on: October 10, 2013, 03:47:06 am »
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

  • Beginner
  • *
  • Posts: 18
Re: Base Price showing as admin but not shopper
« Reply #41 on: October 28, 2013, 23:48:49 pm »
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

  • Beginner
  • *
  • Posts: 1
Re: Base Price showing as admin but not shopper
« Reply #42 on: January 29, 2014, 06:41:21 am »
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

  • Beginner
  • *
  • Posts: 41
  • VirtueMart Version: 2.0.26d
Re: Base Price showing as admin but not shopper
« Reply #43 on: February 03, 2014, 08:28:20 am »
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

  • Jr. Member
  • **
  • Posts: 54
Re: Base Price showing as admin but not shopper
« Reply #44 on: February 07, 2014, 10:40:03 am »
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]