Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.4
Component:
Line item
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2012 at 16:16 UTC
Updated:
28 Jul 2017 at 08:42 UTC
Jump to comment: Most recent
Comments
Comment #1
rszrama commentedHey zmove, good to see ya! If you're fine with a simple alter hook, you can use hook_commerce_price_formatted_components_alter() to move them around after the list has been built. Otherwise use hook_commerce_price_component_type_info_alter() to adjust the weights used to establish the initial sorting. : )
Comment #2
zmove commentedHello Ryan,
As you can see, I'm returning to drupal and I'm testing Drupal commerce that seems to be awesome.
I have to work on a small ecommerce website that needs to be online really soon, and I don't have time to look into the code at the moment (that's why I ask some stupid questions ^^), but I created a special testing install for the learning, so you will see me more and more.
My first reflex was to look into the order entity, under the display options of the order total field. But when I saw that the field didn't have any display options (yet ? ^^) I was pretty sure that the salvation would be into a theme function or a hook.
Thank you for your answer. For my experience in Ecommerce, customers often want to tweak that order total lines, especially in Europe where the taxes are a nightmare to understand (for sellers and for buyers ^^). It would be a real added value to make it possible to order it in the UI. In all case, I will keep that hook on my bedside book as I will probably use it on all my future project.
Comment #3
rszrama commentedYeah, I thought there was a UI module for this but I didn't find it on a quick search. The hook is easy enough for devs, but I agree a UI would be nice. The main challenge is sites with a lot of taxes or shipping services could end up with a looot of price component types, making it hard (or impossible) to manage through the UI. A small contrib could probably catch a majority of the use cases, though. I'm sure it'll show up eventually if I don't get to it before anyone else does. : P
Comment #4
pyxio commentedhi ryan,
i just came across this need and was curious if such a module or hook code example exists yet. thanks!
Comment #5
kenorb commentedComment #6
pyxio commentedThanks kenorb!
Comment #7
oncreative commentedat #3 - Well five years later and this is still an issue. Has anyone got an example of fixing this?
Comment #8
romdouze commentedHi oncreative,
as mentionned in https://www.drupal.org/node/1473312,
i used this module https://www.drupal.org/project/commerce_price_extra
so i can change the display of order price components in order total (in checkout or "tunnel d'achat" comme on dit en français!)
Hope this will be helpfull,
Have a nice day !
Romain