Discounted price with tax and total product price amount STILL missing in 3.0.2

Started by SteP[IT], November 14, 2014, 11:10:42 AM

Previous topic - Next topic

SteP[IT]

I have found spare time to get further details about this issue (still unfixed....)

To recognize the problem, in default_pricelist.php I have commented out the "if" function that makes the crossed baseprice be displayed or not, and added some output debug, as hereafter detailed:

// if (VmConfig::get ('checkout_show_origprice', 1) && $prow->prices['discountedPriceWithoutTax'] != $prow->prices['priceWithoutTax']) {
echo '<span class="line-through">a-' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $prow->prices, TRUE, FALSE) . '</span><br />';
echo '<br />VmConfig::get (\'checkout_show_origprice\',1)='.VmConfig::get ('checkout_show_origprice',1);
echo '<br />$prow->prices[\'discountedPriceWithoutTax\']='.$prow->prices['discountedPriceWithoutTax'];
echo '<br />$prow->prices[\'priceWithoutTax\']='.$prow->prices['priceWithoutTax'];
// }


Doing that, I finally (obviously) get displayed the crossed base price but also found the probable reason of (my?) issue.

In fact, in the output dump I have found this (calculated for a product that has the base price set to 389.00, and setting a rule that apply a 3% discount to the customer group the current user belongs to):

$prow->prices['discountedPriceWithoutTax']=381.22
$prow->prices['priceWithoutTax']=381.22

So I finally understood that the reason why the crossed baseprice is NOT dispalyed is that the 'discountedPriceWithoutTax' and the 'priceWithoutTax' are identical: is this correct? I presume I should have them NOT identical, due to the fact that I have set a 3% discount rule.

Any hint about that?
Waiting for you kindly reply asap.
Regards

J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

SteP[IT]

It's a -DBTax type, see the picture.
It seems that the $prow->prices['priceWithoutTax'] is wrongly calculated: it takes in account the -DBTax type discount, it shouldn't...

Edit: to show the values in the cart (right side of picture) I have commented out the "if" mentioned in my previous post; the "a" char before the crossed base price is simply a tag to recognize the row inside the cart :).


[attachment cleanup by admin]
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

SteP[IT]

It doesn't work for the problem I have found.

I would underline again that this one is a core bug you should fix soon: having a correct cart view is a basic needing in any e-commerce, it's not a cosmetic issue. I don't understand why  (and can't believe that  :o ) it's still there... in this situation, any product having a discount is wrongly displayed in cart (and also in order confirmation, invoice, shipping docs and all other order-related documents). This is not a new-feature request, neither a cosmetic adjust: it should have a better priority in scheduled fixing table...

To further check if my installation was faulty, I have downloaded the latest VM3.0.2+J2.5.27 sample installation, but the problem does not disappear: to test it, simply install the "complete" installation with sample data, create a DBTax ( -% ) discount rule (to be applied to any product), publish it, pick one product for the sample database and put it in cart: the result is a wrong cart view, missing the original undiscounted product price and also missing the "products price total amount" in the "Product prices result" and in "Total" rows. In that way you get (in my opinion) a confused cart view, and customers will not enjoy it at all.

See the attached picture, taken from the standard installation, it's self-explaining!
For each product, you have a line not showing the original price but the discounted one only, so you can verify the price consistency only adding "by mind" the discounted price to the applied discount, and verify if the sum match with the base undicsounted price.
More, if you add a product in a >1 quantity, for the related product line you get the total discount in the discount column, so you have a totally not consistent view: you see the UNIT discounted price (but NOT the undiscounted one) and the TOTAL discount amount (and NOT the unit one). More, in the TOTAL row you don't get the total amount (before tax, shipping and payment fee)

Waiting for a final fix, one of this days...
To avoid any misunderstanding of this post, please note I really think you are doing a very good work, and most of it for free: but in this case the fix is taking too time to be executed.
Thank you again for your efforts up today, but please fix this issue very soon.

[attachment cleanup by admin]
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

SteP[IT]

Hi again: is there a way to get a final fix for this very annoing bug? The basic template is wrong, and the cart view is wrong too... I don't want to undervalue the VM Team work, but is out of dubt that an e-commerce module should at least have a correct cart view and working "price show" logic before being defined as "stable" :) The same issues is obviously present en each order/invoice/email view involving the same price model calculation!
Before adding new features, I please ask you to make available a working price logic!
Waiting for a final fix
btw, the same happens on vm 2.6.14: the cart view (and invoice and order email and so on) are missing the" total products amount before tax" and the "unit product price before discount", as the 3.x version
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo

SteP[IT] you maybe noticed that you are the only one who write here.

The reason is that it seems that you have another idea of the price logic. The column "Price", shows always the price without tax, the netto price.

So lets assume your net price is 10 euro and your VAT is 20% and you give a discount AFTER VAT of 2 euro, then you get

stroken through the 10 euro and below 8,33 euro, because

10 euro net with 20% tax is 12 euro, minus 2 euro is 10 euro,... and now we must recalculate the VAT => 8.33, because 8.33 * 1.2 = 10!

It is not a bug, you have another idea how the price should be shown, then adjust the layout as you want. Imagine I change it now,.. suddenly you do not scream anylonger, but all the others.

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

SteP[IT]

Milbo, may be I have another idea on how to show a cart, but why my idea fit the one I see in many others e-commerce products? I'm on the internet market since 1994, I have built tons of carts using both virtuemart and many other systems (magento, prestashop, OSC and also custom cart made by muself), and this is the first time I see this way to show a cart :)
If I have a product view, in which I see both the list price (crossed), the discount (per item) and the net price (list price less discount), I presume I would read the same things in cart, and not another thing :)

In VM right now I have an (in my opinon) ambiguos behaviour.

Let say I add a 100 euros (list price) product, having a 10% discount.
I want to add 2 units of this item: so in you current setup i have
PRICE column: 90 € (and NO CROSSED list price, that should be shown)
TAX column: 40 €
Discount column: 20 €
etc etc

In this situation I have NO REFERER to the original price, that should be shown as CROSSED in the Price colum, just above the net price: what's strange in my idea of showing the crossed orginal price? In this way you'll get the same prcie vie you have in product view

And now again on the TOTAL row question: why there is NO TOTAL NET PRICE both in "Product price result" and in "Total" rows? Why showing there tax, discount, total amount, without showing the total net price? Did you have ever compiled an Invoice? In my Country (Italy) you MUST specify the total net price somewhere in the invoice, and also in cart, bill, shipping documents. In current VM setup the total net price is totally missing, this is not correct: emitting such a invoice will result in wrong fiscal document!!

Before criticize me, you should consider that probably I'm a professional like you, and before posting something here I "think twice and more"... this is not to blame you, but simply to make clear that what I'm asking for is not the Moon, but a cart condition required by any e-commerce system and by any fiscal rule. Sure, I can do it by myself, investing a bit more time than you (due to the fact that I'm not a VM builder), but I was thinking that suggesting something that can make VM a better product could be appreciated instead of being blamed...

And the fact that I'm the only one asking for something do not exclude I'm right :)

Please, do not consider my reply as an attach or a way to despise you and you work (very appreciated): I do not intend to continue this tread to blame VM and the VM team, but only to be propositive.


J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo

You write so many text, instead of adjusting the cart to your needs.

There are soo many different ideas and habits to create an invoice/cart. The view of vm is generic, that means you see usually more than most people want.

Actually a correct invoice has only net prices... the tax for all products as sum and one brutto price. Is it better? a lot people would scream, but actually it is all the tax authorities want. It depends on soo many habits..... there is no error, you just want to see it different than most others, so adjust it for your case.

OR do a poll, activate people. create a "price display" team. Do a vmdebug of the existing prices and add the one you want to have there. or write an layout of your way, we could add it as alternative.

and finally, I dont get it I see this prices in your cart (crossed one and so).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

SteP[IT]

I did not make it due to the fact that I shoul have to find time to take a look to the code and look for the existing functions and variables, to find what can be used and what must be modified: if I'm not wrong, there is no documentation covering that... but (as you all) I have to work to survive :) and find time for solving such a problem is not at the top of my priority scheduling. I'll try to do it soon, but having a more flexible cart view could be a plus for VM, in any case.

BTW: where do you get the crossed list price in the first column? I have installed the FULL VM install, applied the discount to a product and added it to the cart, checking ALL price config switches to ON, but I can't get the first colum showing the crossed undiscounted baseprice...
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it