Discounted Price without tax shows twice

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Sep 23, 2014 10:49 pm
Reply with quote
Report this post
Hi,

I have very big problem. I had set up discount for product and one product look all right and the other has Discounted Price without tax twice. Second product has different price but same classes of prices.

First product http://www.toolcarrier.com/frasen/schaftfraesen/saebelsaegeblatt-4031-detail
Discounted Price without tax => Preis inkl. Preisnachlass: => class="PricediscountedPriceWithoutTax"
Salesprice without tax => Netto: => class="PricediscountedPriceWithoutTax" !!!WRONG!!!

Second product http://www.toolcarrier.com/sagen-kategorie/saebelsaegeblaetter/universalschaft/saebelsaegeblatt-4016-detail
Discounted Price without tax => Preis inkl. Preisnachlass: => class="PricediscountedPriceWithoutTax"
Salesprice without tax => Netto: => class="PricepriceWithoutTax"

Products are with the same settings. Nothing is not different.

How I can fix it? It is very bad for me. Thank you for quick advice.

Joomla: 2.5.24
VM: 2.6.10
Template: 3.12
Website: http://www.toolcarrier.com
User avatar
Expert Boarder

teitbite
Wed Sep 24, 2014 11:01 am
Reply with quote
Report this post
Hi

Please send me an access to ftp. I need to make some tests first to find the fix for it.
User avatar
Moderator

teitbite
Thu Sep 25, 2014 8:34 am
Reply with quote
Report this post
Hi

This doesn't look like our code anymore, so I cannot help with it much, but can lead You to right place. Edit file /html/com_virtuemart/productdetails and look into code:

Code: Select all
            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);
               }
         
            }
            echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices);
            if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
            }
            echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
            if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices);
            }            
            if ($this->product->prices['discountedPriceWithoutTax'] != $this->product->prices['priceWithoutTax']) {
               echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
            } else {
               echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
            }
            echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );
            echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices );
            $unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
            echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $this->product->prices);


You have here "discountedPriceWithoutTax" mentioned for couple of times.
User avatar
Moderator

GK User
Thu Sep 25, 2014 12:31 pm
Reply with quote
Report this post
I put your code to file in the same place but it is still the same. I found the other problem....your template not rounded prices, just cut last decimal place from 3 to 2 for example:

Basic template price 4,52 E: http://test.toolcarrier.com/sagen-kateg ... f-5-detail

Instyle template 4,51 E: http://www.toolcarrier.com/sagen-katego ... f-5-detail

Invoices are with 4,52 too.

There are really problems :-(
User avatar
Expert Boarder

GK User
Fri Sep 26, 2014 11:48 am
Reply with quote
Report this post
I update whole template to 3.12 and discounted price class="PricediscountedPriceWithoutTax" is still twice in some products. Prices code is the same like original default.php. I copied original template 3.12 without my changes but is still the same.

Example: http://test.toolcarrier.com/subdom/test/sagen-kategorie/saebelsaegeblaetter/universalschaft/saebelsaegeblatt-4031-detail

Could you help me?
User avatar
Expert Boarder

teitbite
Sat Sep 27, 2014 11:06 am
Reply with quote
Report this post
Hi

Hehe. You have asked me where You can find the code to change it and that's what I answered, it was not the solution. Sorry for missunderstanding. Try with this:

Code: Select all
                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);
                   }
             
                }
                echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices);
                if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
                   echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
                }
                if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
                   echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices);
                }           
                if ($this->product->prices['discountedPriceWithoutTax'] != $this->product->prices['priceWithoutTax']) {
                   echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
                } else {
                   echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
                }
                echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );
                echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices );
                $unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
                echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $this->product->prices);
User avatar
Moderator

GK User
Sat Sep 27, 2014 2:18 pm
Reply with quote
Report this post
Thank you very much, these code solved twice discounted prices class.

Could you help me with wrong rounded prices too? InStyle template rounded price differently than basics templates and VM too.

I tested on my testing site and on final site too. This product http://www.toolcarrier.com/sagen-kategorie/stichsaegeblaetter/stichsaegeblatter-t-schaft-einnockenschaft/stichsaegeblatt-3110-f-5-detail has different price in InStyle template and in the others.
User avatar
Expert Boarder

teitbite
Sun Sep 28, 2014 9:57 am
Reply with quote
Report this post
Hi

Ok. But I need to know what difference is it. Best would be to copy the code for me. It's only possible if a different price were displayed since it's showing price from VM directly.
User avatar
Moderator

GK User
Sun Sep 28, 2014 7:19 pm
Reply with quote
Report this post
Hi,

what code do you need exactly? We are still talking about the same code....prices code in InStyle template. In your template is code from you. In Beez20 is the common code. I wrote you exmaples of products, wrong and good prices.

Here is sample product what I am writing about http://www.toolcarrier.com/sagen-kategorie/stichsaegeblaetter/stichsaegeblatter-t-schaft-einnockenschaft/stichsaegeblatt-3110-f-5-detail

Price in administration is 4.515 (calcuated by rules).
Price in InStyle is 4.51.
Price in Beez20 is 4.52 (rounded).
Price in cart 4.51.
Price in invoice is correctly 4.52.

Whole your template is show wrong rounded price. Virtuemart show it correctly rounded. Why?

What code do you want from me?

teitbite wrote:Hi

Ok. But I need to know what difference is it. Best would be to copy the code for me. It's only possible if a different price were displayed since it's showing price from VM directly.
User avatar
Expert Boarder

teitbite
Mon Sep 29, 2014 5:00 pm
Reply with quote
Report this post
Hi

Now I understand. I thought that a different price was displayed like "priceWithTax" with out template and "priceWithoutTax" with Beez20. Now I know it's something different than I had in mind.

Are You working on this right now ? I cannot see my changes and from test I've done already looks like this price is 4.51 comming directly from VM.

Code: Select all
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);


this is the function used and it's implemented in core VM files which we have not changed in any way, so it's really an interesting. But most interesting is the global value for price:

Code: Select all
$this->product->prices


Dump of this value is showing 4.51 as well.


Anyway I need You to disable all cache, because it's not possible to work on this problem if I have to wait 15min for the changes to show. Please try with a dump Yourself:

Code: Select all
print '<pre>';
var_dump( $this->product->prices );
print '</pre>';


and copy the result displayed.
User avatar
Moderator

GK User
Tue Sep 30, 2014 7:57 pm
Reply with quote
Report this post
Hi,

I am not uderstanding what to do, sorry for that :-) I made copy of site for you and disabled cache. I am going to sent you login information for copy of site.

Thank you,
Tomas
User avatar
Expert Boarder

teitbite
Thu Oct 02, 2014 11:30 am
Reply with quote
Report this post
Hi

Ok. Please send me joomla panel access and ftp to the copy. I hope that You mean that server cache is disabled. Right ?
User avatar
Moderator

GK User
Thu Oct 02, 2014 1:16 pm
Reply with quote
Report this post
Hi,

yes, disabled cache. I send you login via PM.

Thanks,
Tomas
User avatar
Expert Boarder

teitbite
Thu Oct 02, 2014 1:32 pm
Reply with quote
Report this post
Hi

Ok. Got login, it's working. Can You send me FTP as well ?
User avatar
Moderator

GK User
Thu Oct 02, 2014 2:02 pm
Reply with quote
Report this post
I sent you FTP yesterday or day before via PM. Did you recieve it?
User avatar
Expert Boarder

teitbite
Thu Oct 02, 2014 2:41 pm
Reply with quote
Report this post
Hi

Yes I did, but it's not working anymore:

530 Login incorrect. Please contact your web hosting service provider for assistance.


I thought You deleted it so You can make new for this test folder.
User avatar
Moderator

GK User
Thu Oct 02, 2014 3:00 pm
Reply with quote
Report this post
Sorry, I sent it again.
User avatar
Expert Boarder

teitbite
Sat Oct 04, 2014 10:57 am
Reply with quote
Report this post
Hi

Sorry but this is still not working. I think this time You have send an access to joomla panel which was fine, but I need an access to FTP.
User avatar
Moderator

teitbite
Sat Oct 04, 2014 11:50 am
Reply with quote
Report this post
Hi

Ok. Please take a look here: http://test.toolcarrier.com/subdom/test ... f-5-detail

The code on top is showing all prices provided by VM, as You can see the wrong price is there already. This is wrong becauase it's being rounded down instead of up. If You will take a look at for example price: "priceBeforeTax" it's 4.515, so I've added it to price list in product: "Preisnachlass: 4,52 €". I believe this is the price used in cart as well.
User avatar
Moderator

GK User
Sat Oct 04, 2014 12:15 pm
Reply with quote
Report this post
I sent you new one logins to FTP.

teitbite wrote:Hi

Sorry but this is still not working. I think this time You have send an access to joomla panel which was fine, but I need an access to FTP.
User avatar
Expert Boarder

GK User
Sat Oct 04, 2014 12:19 pm
Reply with quote
Report this post
Yes, Preisnachlass is all right. How can I fix it for Netto (class="PricepriceWithoutTax") price?

teitbite wrote:Hi

Ok. Please take a look here: http://test.toolcarrier.com/subdom/test ... f-5-detail

The code on top is showing all prices provided by VM, as You can see the wrong price is there already. This is wrong becauase it's being rounded down instead of up. If You will take a look at for example price: "priceBeforeTax" it's 4.515, so I've added it to price list in product: "Preisnachlass: 4,52 €". I believe this is the price used in cart as well.
User avatar
Expert Boarder

teitbite
Sun Oct 05, 2014 8:48 am
Reply with quote
Report this post
Hi

I believe that You just need to edit file /html/com_virtuemart/productdetails.php and replace every occurence of word "priceWithoutTax" with "priceBeforeTax".
User avatar
Moderator


cron