Hi,
how to hide shipping information pane on checkout for non-shipping product ? and show it on physical product?
thanks

Comments

rszrama’s picture

Project: Commerce Core » Commerce Physical Product
Component: Checkout » Code

This would be a feature request for the Commerce Physical Product or Commerce Shipping modules. I'm not sure which, but let's put it in Physical Product for now since that module isn't technically required for Commerce Shipping but would be required to satisfy this feature request.

artatac’s picture

I would also value this feature

pixhail’s picture

Guys, i have wriiten custome module for this. what it does:
there is a boolean value, in the form of checkbox. if checked, means items are shippable, and during checkout, shipping info pane would be seen. But if not checked, means non-shippable, then during checkout, no shipping info pane would be seen.

Contact me, if you want to see it and the module.

ponies’s picture

Consider yourself contacted pixhail! Do you have a sandbox set up?

artatac’s picture

To save others having to ask this is not free but available for $99

pixhail’s picture

yes, i do have

pixhail’s picture

$99 is much to save the task?

Anonymous’s picture

I'm pretty certain @pixhail that the issue cue is not a place to sell your code. You need to PM someone if they/you're interested in selling/buying.

switch13’s picture

Re-posting comment on the active issue:

I'm also working on this currently. Not by product but rather giving the customer the option of picking up the order or having it delivered.

My idea is to create a module (open to community of course) that will have a radio button field as the top pane on the checkout page with the "Pickup" or "Delivery" options. This would default to Pickup and would have the Shipping information disabled and hidden at the start.

I have two issues currently:

  1. I can't get the pane to be hidden initially. Shouldn't this work?
    • function pickup_or_delivery_commerce_checkout_pane_info_alter(&$checkout_panes) {
      		$checkout_panes['customer_profile_shipping']['enabled'] = 0;
      }
      
    • I got the pane name from here http://drupal.org/node/1285902 but it seems like scoff had to loop through all of the $checkout_panes. Is that necessary?
  2. The next step is to also have the pane on the shipping page (i believe it's called 'commerce_shipping') disabled.
    • I initially was asking around IRC why commerce_checkout_page_info didn't have an 'enabled' property but I was told by Saisai that if there is no pane on a page that page will be skipped…not sure if that means if the pane is disabled or removed. Guess we'll see.

Any one else run into any of this? or care to share any findings?

=>switch13<=
Pete

switch13’s picture

Is there a way to delete posts 3-8 so people will not be deterred by the salesman?

rszrama’s picture

Sadly, no, but we can just work a little faster to get it into the module itself. : D

WorldFallz’s picture

Webmasters can delete/unpublish the posts-- ryan if you'd like me to do that, just say so on this issue.

@pixhail: you've already been asked in another thread-- please don't use the issue queues to sell code.

And to anyone who has the module, all drupal modules must be GPL so feel free to make it available yourself if you want.

WorldFallz’s picture

also, @switch13 if you could post your code as a patch i'll try and help (i have the same pickup vs delivery use case to solve as well).

duaelfr’s picture

I had to do something close to this issue for a project.
Someone asked me to free my sources so you can find something here : #1518034-27: Disabling or Hiding shipping options and line item if no products are shippable?

I have no time to provide support for this but it may work for the common case.

switch13’s picture

Thanks DuaelFr, not quite the functionality I was looking for but that will definitely come in handy!

@WorldFallz check out this thread:
http://www.drupalcommerce.org/questions/3304/how-hide-checkout-panes-bas...
UrmasZ came up with a work around that seems to be working great for me so far.

brephraim’s picture

cvangysel’s picture

Assigned: Unassigned » cvangysel
Status: Active » Needs review
StatusFileSize
new2.38 KB

The attached patch exposes a new setting which hides the shipping services pane if the order is not shippable. Whether or not an order is shippable is determined by
commerce_physical_order_shippable($order) and currently means it has no line item with an associated weight or dimension.

This behaviour could be changed so that a product should be explicitly be made non-shippable, as currently it's quite prone to user error. Does anyone have a good suggestion on how this should work?

brephraim’s picture

I don't have any ideas off the top of my head about that new approach, but I would recommend changing the current approach from checking for associated weight/dimension to testing for weight/dimension > .01, or whatever. This is because some product types may have a weight or dimension field, but individual product entities may have those set to zero, in which case module as patched will think they are shippable when they are not.

rszrama’s picture

Changing the way we determine product shippability can be discussed in a separate issue; the API function itself is still correct for the feature needed in this issue.

elperuanito’s picture

Works very well for me! Added the following in my situation (lines 48&49):
$checkout_panes['customer_profile_shipping']['page'] = 'disabled';
$checkout_panes['customer_profile_shipping']['enabled'] = FALSE;

This to account for the customer shipping info which I had on the same pane as the shipping options. In my solution every shippable product MUST have a weight and so this caters perfectly. Thanks for this. :-) Saved me a headache.

nodecode’s picture

For reference, the following module provides a great rules-based solution http://drupal.org/project/commerce_rules_extra
A relevant implementation example is right there on the project homepage.

torgospizza’s picture

I'm running into issues here now as well. I have also looked at Commerce Rules Extra, which does add a fair amount of flexibility, but I still think the way checkout panes are handled could be improved. The way the Rules Extra implementation works is it disables the shipping pane globally for the user. (In other words, if my Rule is set to disable the Shipping Information pane when no shippable products are in my cart, and I go to the Checkout Settings page with a digital item in my cart, I won't be able to change the weight of the Shipping Information pane in the admin section because the Rule is firing and setting the pane to "Disabled".)

This seems like a general DX problem and I think should be addressed in the Physical Product module. A boolean option for 'enabled' might suffice, or some additional parameters that allow shipping panes (and pages) to be skipped or hidden would be ideal. At the very least, consider merging the rules from Commerce Rules Extra, which allows us to handle some of this using additional Rules reactions to hide the shipping pane (but skipping the shipping page is still somewhat murky).

Related issue and patch: #1344962: Add some helpful rules conditions

bisonbleu’s picture

Issue summary: View changes

Followed @nodecode's advice in #21 and after installing commerce_rules_extra, I was able to create a simple rule that hides Billing & Shipping information panes from the checkout workflow.

Thanks all!