Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've set a pickup service, but when the customer look at the order confirmation the shipping address is still there. Any chance to resolve this issue?
thanks in advance
{ "rules_hide_shipping_address_from_order_when_pickup_method" : {
"LABEL" : "Hide Shipping Address From Order When Pickup Method",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "commerce_shipping", "commerce_rules_extra", "rules", "entity" ],
"ON" : [ "commerce_order_view" ],
"IF" : [
{ "commerce_shipping_compare_shipping_service" : {
"commerce_order" : [ "commerce_order" ],
"service" : "commerce_pickup__node__50"
}
}
],
"DO" : [
{ "commerce_rules_extra_change_pane" : {
"pane_id" : "customer_profile_billing",
"page_id" : "\u003Csame\u003E",
"enabled" : 0
}
},
{ "drupal_message" : { "message" : "test messaggio to check if rule works" } }
]
}
}
Comments
Comment #1
MarcElbichon CreditAttribution: MarcElbichon commentedDoes Drupal message is printed ?
Can you have a look to rules debug trace to see if commerce_rules_extra_change_pane action is fired ?
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedyes the message is printed, how do look at rules debug trace?
thanks
Comment #3
MarcElbichon CreditAttribution: MarcElbichon commentedIn admin/config/workflow/rules/settings, check Log debug and select always in Show debug information
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedRules debug information:
" Reacting on event Commerce Order is viewed.
0 ms Reacting on event Commerce Order is viewed.
9.643 ms Evaluating conditions of rule Hide Shipping Address From Order When Pickup Method. [edit]
12.567 ms The condition commerce_shipping_compare_shipping_service evaluated to TRUE [edit]
12.578 ms AND evaluated to TRUE.
" Rule Hide Shipping Address From Order When Pickup Method fires. [edit]
0 ms Rule Hide Shipping Address From Order When Pickup Method fires.
0.157 ms Evaluating the action commerce_rules_extra_change_pane. [edit]
0.383 ms Evaluating the action drupal_message. [edit]
2.198 ms Rule Hide Shipping Address From Order When Pickup Method has fired.
14.824 ms Finished reacting on event Commerce Order is viewed.
Comment #5
MarcElbichon CreditAttribution: MarcElbichon commentedCan you tried with 1.x version ?
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedhere the log for version 1.x
Rules debug information:
" Reacting on event Commerce Order is viewed.
0 ms Reacting on event Commerce Order is viewed.
9.887 ms Evaluating conditions of rule Hide Shipping Address From Order When Pickup Method. [edit]
12.501 ms The condition commerce_shipping_compare_shipping_service evaluated to TRUE [edit]
12.513 ms AND evaluated to TRUE.
" Rule Hide Shipping Address From Order When Pickup Method fires. [edit]
0 ms Rule Hide Shipping Address From Order When Pickup Method fires.
0.146 ms Evaluating the action commerce_rules_extra_change_pane. [edit]
1.749 ms Evaluating the action drupal_message. [edit]
3.593 ms Rule Hide Shipping Address From Order When Pickup Method has fired.
16.155 ms Finished reacting on event Commerce Order is viewed.
Comment #7
MarcElbichon CreditAttribution: MarcElbichon commentedI haven't seen you used commerce_order_view event.
commerce_rules_extra_change_pane only works with process checkout pane event.
I've tried to do the work, but hooks in commerce_order_view don't have infos for panes.
You can do this by your own by implementing hook_commerce_order_view_alter(&$infos, $entity_type).
Comment #8
MarcElbichon CreditAttribution: MarcElbichon commentedI maybe found a solution.
Can you add these lines at the end of includes/commerce_rules_extra_change_pane.inc
Clear caches and retry
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedyessss, it works!!!
many thanks
grazie mille!!!
Comment #10
MarcElbichon CreditAttribution: MarcElbichon commentedDo you have declare a rule for Process checkout pane event ?
I think this could be interesting to trigger this event when viewing order so you should have to declare rule only one time.
I can add too a parameter to event meaning if this event should be fired when viewing order.
What do you think of that ?
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedsorry I'm not expert, I'm trying to show pickup address into order page. I'll send you rule exports asap.
Comment #12
MarcElbichon CreditAttribution: MarcElbichon commentedIf you want to share rule config for "Process checkout pane" and "Order is viewed" events, create a component (rule type) with your conditions and "change pane properties" action.
Create 2 rules for "process checkout pane" and "order is viewed" events and select the component as action.
Only enabled and weight properties can be used for Order is viewed event.
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedciao Marc, here are the two rules I'm using to show/hide shipping/pickup addresses.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedciao Marc, do you know how to display pickup address into order confirmation at http://example.com/user/[uid]/orders/[orderid]
and also how to show pickup address into the emailed order confirmation?
thanks in advance
Comment #15
MarcElbichon CreditAttribution: MarcElbichon commentedI'm not familar with this, maybe http://www.drupalcommerce.org/questions/3976/how-do-i-override-page-disp... and https://drupal.org/node/1436428 can help you.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedciao Marc, I've a budget to implement this hack. So if you would like to help me in coding I'll be happy to pay you for that. I had a look into panels, pm_existing_pages modules, but I can't override order page with "user/%uid/orders/%order-id". thanks in advance
Comment #17
MarcElbichon CreditAttribution: MarcElbichon commentedSorry, but I do not have time to investigate further. Maybe you can have a look to http://drupal.stackexchange.com/questions/40307/how-to-customize-commerc...
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedsince last update the rule in not honored anymore:
I found you already inserted #8 into module, so didn't hack the module with it.
Comment #19
MarcElbichon CreditAttribution: MarcElbichon commentedCan you clear cache ?
Comment #20
Anonymous (not verified) CreditAttribution: Anonymous commentedI did, but no chance
Comment #21
MarcElbichon CreditAttribution: MarcElbichon commentedCan you have a look to rules debug trace if event is fired, condition is true and action is done ?
Maybe can i have access to your site ?
Comment #22
Anonymous (not verified) CreditAttribution: Anonymous commentedciao Marc,
due to a deadline reason I temporary abandoned the usage of this module. And I'm waiting some custom code from a developer. I'll be back to you in case my needs are going back to this module. thanks for you assistance.
Comment #23
Perignon CreditAttribution: Perignon commentedGoing to mark this closed. If the issue is still needed please reopen the ticket!
Comment #24
fonant CreditAttribution: fonant commentedThis used to work, but doesn't any more, either to hide or show a pane.
I was using it to hide the "Shipping address" and "Shipping method" panes when there weren't any shippable products in the cart. Not essential, but a nice enhancement to the checkout process.
Logging rule execution shows that the "commerce_rules_extra_change_pane" action is being called, it just no longer does anything.
Looks like
hook_commerce_order_view_alter
no longer exists?Do we need to implement
hook_commerce_checkout_pane_info_alter
instead? Would be nice to avoid using global variables, too.Comment #25
Perignon CreditAttribution: Perignon commentedComment #26
mksweet CreditAttribution: mksweet commentedSeconding @fonant's comment #24. The rule to hide shipping doesn't work for me either. Only works with version 1x, not version 2x
Comment #27
Perignon CreditAttribution: Perignon commentedLooks like hook_commerce_order_view_alter doesn't exist anymore, you are right.
Comment #28
ulia CreditAttribution: ulia commentedCan't hide Shipping pane either. Condition for the rule: Shipping line item exists: pick up. CRE 7.x-2.1 Rules 7-2.9. Any updates or some solution? Thanks in advance.
Comment #29
Perignon CreditAttribution: Perignon commentedSorry, I been neck deep in other modules. I need to throw some attention toward this module.
Comment #30
Perignon CreditAttribution: Perignon commentedAs stated in #24, the hook is now gone. I'm working up a solution, should have something posted soon for testing.
Comment #31
jrokisky CreditAttribution: jrokisky commentedAs this no longer is functioning correctly,
can the line under 'Rules Actions':
'Change pane properties : Change visibility, page, weight of a pane'
be removed to avoid confusion.
Thank you!
Comment #32
apaderno