Hi,

thank you for the work on this module!

I wrote some custom shipping-service making it possible to customers to select a 'pickup at office'-option.
It would be great if there could be the possibility to remove shipping the information-form or make it not required when this service is selected, saving customers from typing unnecessary information.

Can you help me with some hints?

CommentFileSizeAuthor
#12 pickup_or_delivery.png10.5 KBswitch13

Comments

googletorp’s picture

Status: Active » Fixed
ibot’s picture

Status: Fixed » Active

Sorry to reopen.

I think my question was a little confusing..

My problem is about:
how to remove the 'shipping information form' ("customer_profile_shipping"-pane - where one enters the shipping address) or how to make it not required if a specific shipping service is selected.

Best,
T.

hotciuk’s picture

Hello
I've the same problem..
i need to remove the shipping information form if the customer choose the "take to the shop" shipping method.

Thank you, Claudio

googletorp’s picture

Title: How to remove shipping information-form or make it not required when custom shipping service is selected? » How to remove a pane in the checkout flow if certain conditions are met?
Project: Commerce Shipping » Commerce Core
Version: 7.x-2.0-beta1 » 7.x-1.2
Component: Code » Checkout

This seems like a Drupal Commerce thing.

rszrama’s picture

Project: Commerce Core » Commerce Shipping
Version: 7.x-1.2 » 7.x-2.x-dev
Component: Checkout » Code
Status: Active » Closed (duplicate)

The short answer is hook_form_alter()... the long answer is that this just requires code and can either reside in the Commerce Physical Products module or perhaps even Commerce Shipping at some point in time. For now here's the duplicate issue in the Physical Products queue:

#1390190: hide shipping pane for non-shipping product

googletorp’s picture

Ryan - Maybe we should consider making a is_shippable check on products as part of the shipping flow. That would make it possible for us to remove the shipping pane if there are no shippable products in a sensible way.

By default all products should be shippable, but we could make a hook much like the node access grant system, where modules can say, I don't care, or force the system to say is not shippable or is shippable.

Does that make sense?

rszrama’s picture

Hmm, Commerce Physical Products does have an API function to determine the shippability of an order based on whether or not any line item in the order is shippable. By default, it only considers a line item shippable if it's for a product that has one of the module's own weight fields attached to it, but it leaves a hook open for any other module to specify an alternate method.

I didn't bake this into Shipping 2.x originally because I didn't want to force people to have to use weight fields, for example, if they knew everything on their site shipped for a flat $5. There's no good reason to require the weight field if you aren't doing weight based shipping, though there may be good reasons to make it optional.

However, we could introduce some setting form (perhaps in Commerce Physical Products) that let the administrator opt-in to just assuming everything in the store is shippable by default instead of non-shippable, but in those cases the site would never need to disable the shipping pane. The question then I guess would be how to determine which products weren't shippable.

artatac’s picture

Could there be a tickbox field within Commerce Physical Products that defaults to true but in sites that have a mixture of products (shippable/non-shippable) you can then untick when not required. I seem to remember that was how it worked with ubercart.

savingstrangers’s picture

I definitely need this exact functionality, subscribing!

Trying to get a "In-Store Pickup" shipping option to not make the customer fill out Shipping Info on the following page. Thanks!

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.

Anonymous’s picture

@pixhail
When developers are working on a solution that will benefit themselves and the community, please don't add trash to the conversation by submitted your paid module plug as a solution. It doesn't contribute to the community. I'm sure people would be willing to donate, but don't sell a module in the issue cue of a project like this. It gives false hope.

switch13’s picture

StatusFileSize
new10.5 KB

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

ari-meetai’s picture

ari-meetai’s picture

Issue summary: View changes

refined request