The tax should be visible in the cart. In the cart-box, too. Actually it isn't.

I'm posting this bug-report from the drupal commerce training at the drupalcon london. So ryan and the others from the commerce guys should know about this bug. I've attached a screenshot.

Comments

rszrama’s picture

Was this from the test involving the anonymous user role condition?

jepster_’s picture

No.

rszrama’s picture

Priority: Critical » Major

Ahh! I remember. I was thinking the tax was just missing, not not being displayed. I remember what you're talking about now. : )

(I am going to demote it to major, but we're going to try and address this in the 1.0 BoF real quick.)

rszrama’s picture

Title: Tax isn't displayed - tax should be included in the price » Fix the display of the order total area handler in the Cart form
Priority: Major » Normal
StatusFileSize
new38.83 KB

Ahh, you know, as it turns out, you can simply do this in Views. Remove the "Line item summary" area handler and add in an "Order total" area handler. There is an ordering problem, though... the order total isn't being rendered into the HTML of the View for some reason while the line item summary is. I can't see what would make the one appear in the proper place and not the other. See attached.

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new5.72 KB

Reverted the changes to the line item summary handler that were done by the "move to views form" patch, and added preprocess code that affects both summary and order total.

Also fixes the problem where the cart block had a views form generated around it for no good reason.

This change requires the latest Views (dereine committed a part of the fix just over an hour ago).

jepster_’s picture

I've tryed this patch, but I get the following git-error:

noname:commerce jepster$ git apply -v bojanz_cart_tax.patch
fatal: corrupt patch at line 144

I'm in the root of the commerce-folder.

---
Another question: does this patch affect the tax inside of the block-cart? because in germany it's very important, that you display the tax in EVERY cart.

bojanz’s picture

Try "patch -p1". It doesn't affect tax. I guess you need the Order Total field for that (which this patch makes work)

jepster_’s picture

When I type this in, my command line freezes..

bojanz’s picture

"patch -p1 < bojanz.patch".

jepster_’s picture

jepster$ patch -p1 < bojanz_cart_tax.patch patching file modules/line_item/includes/views/handlers/commerce_line_item_handler_area_line_item_summary.inc
patching file modules/order/commerce_order.module
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 143:

bojanz’s picture

StatusFileSize
new5.72 KB

Reuploading the same patch. Just tried to get the latest git version of Commerce, patch applies with both git apply and patch -p1. Try redownloading it.

jepster_’s picture

The patching worked now. I've downloaded it directly, without copying the contents of that file into another file (can't do it different before with google chrome). I've got the actual dev-version of views 3 and runned update.php.

But I still have the same problem. I've the »Commerce Order: Order total« field in the footer of my view already. No tax in my cart. See my screenshot.

jepster_’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Status changed.

bojanz’s picture

Status: Needs work » Needs review

You'll have to wait for Ryan's reply for that matter.
My patch actually had no intention of fixing anything tax related. It does two things:
1) Prevent Views Form from getting rendered around the cart block, when that block has no form elements.
2) Allow the Order Total handler to be added, and look the same as the Summary handler (above the buttons, not below).
Ryan told me to post the patch here.
How Order Total and Summary handle taxes is another question.

jepster_’s picture

I've now looked into the code. Even in the

commerce-line-item-summary.tpl.php

file, theres no entry for tax. So there was not intended to display tax at the carts. But that's a huge problem for european shops. Because the tax must be displayed there. It would be great, if the tax could be displayed like on the checkout-page (screenshot attached).

So the tax-depending code from the checkout-page could be simply moved into the commerce-line-item-summary files.

A question: should the tpl-files be copied out from the commerce module-folder and moved into the theme-folder for themeing?

rszrama’s picture

@jepSter - I think the patch is what you need. The idea is for people who need tax broken out on the Cart form, all you have to do is edit the View, remove the line item summary area handler, and add the Order total area handler. The same could possibly work on the Cart block, too, but you'd likely want to leave the line item summary handler (without displaying the order total in it) to include the View cart / Checkout links.

jepster_’s picture

Status: Needs review » Needs work

Ryan, I don't understand what you mean. I've already posted a screenshot at http://drupal.org/files/issues/Shopping%20cart%20summary%20(Commerce%20Order)%20%7C%20Commerce%20Kickstart.jpg -> here you can definitly see, that I already have the »Order total area handler« in my view.

I found out, that the tax-variable can be setted up in the commerce_line_item_handler_area_line_item_summery.inc file. When I define it in line 127 to the render-function, it goes into the template-file.

rszrama’s picture

The only thing I can guess is you didn't save it or something. The output you're showing is only for the Line Item Summary area handler. It could be you replaced it on the wrong View. Once I get home I can edit it and make an export for you to import. I fly soon, though. ; )

jepster_’s picture

Or please tell me the exact name of the view, I have to edit. Maybe I'm really in the wrong view. :-/

bojanz’s picture

Status: Needs work » Needs review

Time for the patch to get committed, it's been two months.
It will break Commerce on all Views versions older than Aug 28th or so, but that's okay, especially if Views 7.x-3.0-RC2 gets released soon.

Status: Needs review » Needs work

The last submitted patch, 1256302.patch, failed testing.

bojanz’s picture

Status: Needs work » Needs review

Views has an RC3 release now, so this patch can go in.

rszrama’s picture

w00t w00t! Just saw that on Twitter. Also means I don't have to add backwards compatibility to a patch Damien integrated earlier. : )

jepster_’s picture

@ bojanz:
Saw that at #21, that the patch failed testing. So why it should go in? o_O

bojanz’s picture

@24
The point of my comment was that the patch was no longer blocked, since there's now a Views version we can require.
The test fails (exceptions) are actually one single notice which I'm looking into.

jepster_’s picture

@25
so is this issue now solved?

bojanz’s picture

Can someone try to reproduce the notice locally?
I've been unable to. Might just be that the test bot is using a wrong views version.

bojanz’s picture

#11: 1256302.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1256302.patch, failed testing.

bojanz’s picture

Status: Needs work » Needs review

#11: 1256302.patch queued for re-testing.

The testbot might just hate me. The patch applies normally for me on my local machine.

The last submitted patch, 1256302.patch, failed testing.

jepster_’s picture

Status: Needs review » Needs work

So your patch seems to be still buggy.. or may you contact the maintainer of the test-bot?

bojanz’s picture

Status: Needs review » Needs work
StatusFileSize
new5.95 KB

Here we go again.

I've renamed the issue to reflect the main goal of this patch. It obviously wasn't showing up in search correctly in its current form, leading to duplicate efforts.
Of course, the additional change in this patch is that it also fixes the positioning of the order total area handler.
That should be noted in the commit message.

edmund.kwok wrote the duplicate patch, so he should be noted as the co-author of this one.

bojanz’s picture

Title: Fix the display of the order total area handler in the Cart form » The line item summary handler should not use the Views Form API
Status: Needs work » Needs review
rszrama’s picture

Status: Needs work » Fixed

Happy to finally commit this. Sorry it took so long, jepSter, but better late than never. : )

fwiw, I did test the configuration of changing the cart form View so it uses the order total breakdown instead of the line item summary area handler, and it works as you need it to. Hooray!

Commit: http://drupalcode.org/project/commerce.git/commitdiff/3bc3967

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rtrebu’s picture

StatusFileSize
new40.82 KB
new88.95 KB

Hi, I think I have the same symptoms like jepSter. Price components missing on checkout page. Commerce Order: Order total enabled in Shopping cart summary view, but does not display. I know that It worked before, now it doesn't. Any ideas? Thank you four your truble

rtrebu’s picture

Issue summary: View changes

Edit