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 and Discounted Price Display

Started by RFreund, January 01, 2012, 00:21:10 AM

Previous topic - Next topic

RFreund

Scenario:

I create a product and enter the cost price then I enter a discount price and discount rule=no rule.
The discount amount is displayed and the final price is displayed. Is there a way to show the original price or cost price?

I believe the same question applies if I set a rule as well, say 50% off. There are three things that prices that show: Price with discount, sales price and discount.
Also I have the box checked for baseprice checked in the shopper group and in configuration checkout.

Thanks!

TonyG

Hi

Go to the backend of VM and under Configuration click on the "Pricing" tab. From the Pricing page untick the pricing options you don't want to show, leaving the ones you want to show tick. Save and test.

I hope this help.


bunglehaze

This is not working for me in VM2 stable either, it worked fine in RC2 and 3 though. odd.

RFreund

So I tried all different combinations in VM - configuration - pricing and I could not get the base price to display.
Is there a way to display the base price? Are others able to display a base price and then the sales price? I did have a couple issues when upgrading...

RFreund

To add to this. It seems on checkout in the cart there are a couple lines that are not labeled but have $0.00's in them. Not a huge deal but could be confusing to the shopper.

If anyone has any ideas on displaying base price please comment.

Thanks again.

notanothernumber

I've recently upgraded to vm2 and having the same problem. I've set up the following options in the back end:

Baseprice - Show Price & Show Label
Final salesprice - Show Price & Show Label
Discount amount - Show Price & Show Label

But all that showing up in the front end is:

Sales price: 65,00 $
Discount: 5,00 $

What I want it to show is:

Original Price: 70,00 $ (Base price option from back end)
Discount: 5,00 $ (Discount amount option from back end)
Sales price: 65,00 $ (Final salesprice option from back end)

seagul


seagul

I think I found out now:
The problem is that there is no tax rate setup. If the system does not find a tax rate then it does not calculate the price without tax.

I added one tax rate (per produkt) modifier "+" and value "0".
Now the prices are shown as in the configuration saved.

At least it solved my problem with basePriceWithTax was always 0.

RFreund

This seems to work but now it displays:

Base Price with Tax:
Sales Price without Tax:
Discount:

or

Base Price with Tax:
(Blank but should read final price):
Discount:

This is sorta confusing to the shopper, furthermore It then displays all the products that don't have discounts with two prices that are the same.
Let me know if I'm missing something. I will keep playing the configuration and post if I find a solution.

Idealy I would like:

Base Price:
Sales Price:
Discount (optional);

For all products that do not have a discount:
Base Price:

I can't seem to display only base price.

Thanks Again!

notanothernumber

#9
Still no joy for me, can anyone advise where I'm going wrong? Set up as follows

Tax & Calculation Rule Details
calculation kind: Tax per product
Math operation: +
Value: 0
Visible for Shopper: Yes
Visible for Vender: Yes

PRODUCT INFORMATION
Pricing rules overrides
Tax: I selected the rate I set up above

Refreshed Product nothing happened or changed!! Site now live at www.costumeglitz.com.au if you want to look over and see what I mean

seagul

Quote from: notanothernumber on January 16, 2012, 07:50:58 AM
Visible for Shopper: Yes
Visible for Vender: Yes

PRODUCT INFORMATION
Pricing rules overrides
Tax: I selected the rate I set up above

I would set :
Visible for Shopper: No
Visible for Vender: No

I don't think you have to select the rule. It should be selected automatically as you would use it for all your products.

But what exactly do you want?

RFreund

I think we are looking for the same (similar) thing:

Base Price:
Discount:
Final Price:

However I can't display a base price.


seagul

I will show you my setup that made it work, see the attachments for setup.

in my template override for productdetails
"components/com_virtuemart/views/productdetails/default.php"
--> copy this to your template in the correct place (if you don't know, google how template overrides work in joomla).

I have added after the following code around line 144:
if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
}

add the following outside the if-statement.
echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
somehow the "showBaseprice" does not give the value from the setup. So I added it again without the if. Not a very clean way, but it works. Or you could comment out the if-statement on line 144 and and the bracket on line 147.
It would look like this then (I did not test it!)
//if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
//}


The following lines after line 144 you have to bring in the right order. As you want to show the discount amount before the final sales price, you have to move it a few lines upwards. i.e. like this:
echo $this->currency->createPriceDiv ( 'variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices );
echo $this->currency->createPriceDiv ( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices );
echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );
echo $this->currency->createPriceDiv ( 'salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices );
echo $this->currency->createPriceDiv ( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices );
echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices ); ?>


it worked for me this way.

[attachment cleanup by admin]

RFreund

I will give it a try.

Thanks for you effort!!  +1

notanothernumber

Hi Seagul and thanks for your help. I changed the code from line 139 to as below:

<?php
            if($this->showRating){
                $maxrating = VmConfig::get('vm_maximum_rating_scale',5);
               $rating = empty($this->rating)? JText::_('COM_VIRTUEMART_RATING').' '.JText::_('COM_VIRTUEMART_UNRATED'):JText::_('COM_VIRTUEMART_RATING') . round($this->rating->rating, 2) . '/'. $maxrating;
               echo   $rating;
            }
            if ($this->showBasePrice) {
               echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
               echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
            }


            // Product Price
            if ($this->show_prices) { ?>
            <div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
            <?php
            if ($this->product->product_unit && VmConfig::get ( 'price_show_packaging_pricelabel' )) {
               echo "<strong>" . JText::_ ( 'COM_VIRTUEMART_CART_PRICE_PER_UNIT' ) . ' (' . $this->product->product_unit . "):</strong>";
            } else {
               echo "<strong>" . JText::_ ( 'COM_VIRTUEMART_CART_PRICE' ) . "</strong>";
            }

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

            echo $this->currency->createPriceDiv ( 'variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices ); ?>
            </div>
            <?php } ?>

and this is definately getting closer to where I want to be (see http://costumeglitz.com.au/index.php/jazz-cabaret-costumes/shirley-temple-detail ). The only other thing that would be good to crack would that if the product has no discount then it only shows the Sales Price & the Base price is hidden. Any ideas?