Jump to content

[Solved] Is shipping to multiple addresses from one cart possible?


kram

Recommended Posts

I know that it's possible to have multiple addresses saved in your address book.

My question is if its possible to allow your customers to ship one order to multiple addresses.

If it isn't, how complicated would it be to program such a feature?

Thank you!

Link to comment
Share on other sites

I now realize that it doesn't even need to be that complicated, because in my application there is no difference in terms of shipping and tax. All I need is a drop down form on the product page that is populated by the aliases of the address in the customers address book, which they can then choose, and I can see as static text.

Any one out there that knows how that can be done?

Link to comment
Share on other sites

Here's something you can try. Add the following before line 317 of product.php (the $smarty->display line):

if ($cookie->logged)
{
   $customer = new Customer($cookie->id_customer);
   $addresses = $customer->getAddresses($cookie->id_lang);
   $smarty->assign('addresses', $addresses);
}



and change line 426 of product.tpl in your theme's directory from:

{if !empty($field.name)}{$field.name}{/if}<input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" class="customization_block_input" />{if $field.required}*{/if}



to:

{if !empty($field.name)}{$field.name}{/if}{if !empty($field.name) && $field.name == 'Shipping Address' && $addresses}

   {foreach from=$addresses item=address}
{$address.alias}
   {/foreach}

{else}
   <input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" class="customization_block_input" />{/if}{if $field.required}*
{/if}



Then go to the "Customization" tab of the product editor and add a Text field called "Shipping Address". This code should replace the "Shipping Address" text field with a dropdown of the currently-logged-in-customer's address aliases. You can choose one, click Save, then when you check out, the chosen alias will appear as the customization. I hope this helps.

Link to comment
Share on other sites

  • 10 months later...

Does this make each item in the cart its own order? We are also looking for a way to allow one customer to input shipping addresses for each item in their cart. However in order to work correctly with UPS I think it needs to make each of those Items its own order so they show up as a single item with its shipping costs etc.

Is there a way to do this - or anyone interested in making this a plugin?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...