Multiship address issue

jingarijingari Member
Hi - we need some help figuring out what is going wrong with our setup. We have a cases where customers will add products to their cart that will each be shipped to a different address, which is fine, but then if they also add an additional donation at the checkout (see https://forum.foxycart.com/discussion/9516/adding-variably-priced-donation-on-checkout) then the shipping addresses get messed up. For example, Gift One going to Address One, Gift Two going to Address Two, Additional Gift going to the customer (has Ship To: Me, even though is a no shipping category - another issue for another day), but when we look in the transactions, we see that Ship To Me is now Address One, Ship To Gift One is now Address Two and Ship to Gift Two is now blank. We're using some custom footer code, which we had some help with through the above mentioned discussion. This has previously not been an issue, so not sure if something has changed? Maybe around this:
var shipping_results = FC.json.shipping_address.shipping_results,
shipping_service_description = FC.json.shipping_address.shipping_service_description,
shipping_service_id = FC.json.shipping_address.shipping_service_id;


I will also whisper the FC.json from a sample transaction with this issue.

Any help or direction on where to debug would be appreciated.

Thanks!
Jessica
Comments
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    Sorry to hear you're having troubles. I'm a little unclear on how this is replicated - would it be possible for you to please detail some steps to allow us to experience this issue? We'll jump in and see if we can see what's going on.
  • Hi - You'll actually be able to test live on our development setup, I'll whisper the details.
  • I meant to just whisper the store details. These are the steps:
    1. From homepage click on one of the products -
    2. From product page, choose Mailed card. Fill message info.
    3. For Send this card to: "Add new recipient" - Any name that starts with a letter after "M" (because of the ship to Me issue), eg "Random One"
    4. Add to cart. (the side cart is not working correctly on the dev environment on product pages, so while the product is added, the cart won't slide out).
    5. So, click Oxfam Gifts logo at top to go back to home page - here you should have access to sidecart - click pink cart button on top right - slide cart comes out, click Proceed to checkout. (this is just an issue because of other things we're working on on the development environment, not a concern).
    6. On checkout page, can use dummy visa card, and add shipping address for Random One.
    7. In the Increase your impact section, choose and amount to round up donation, click Add donation.
    8. Click confirm your order.
    9. When you review the order in the transaction history in admin.foxycart.com, you'll see that the address you input for Random One has been moved to Ship To: Me address and the Address for Ship To: Random one is blank.


    After more investigation, I'm also seeing an issue with the way that we're adding non-shipping gifts to the cart after a shipping gift has already been added. But this seems to be separate because for the above, we're actually seeing the correct addresses in the FC.json.

    For this new issue, it seems to be related to the way multiship shipto_names are stored in session storage and still applying the stored name even when a non-shipping gift is added. For example:
    1. add any mail card gift to cart.
    2. continue shopping.
    3. add any non-shipping card gift (NO card, eCard, PDF card) and it will be sorted under the previous Ship To name instead of being added under "Ship to: me".
    I think the above could be related to the way we handle it multiship with FoxyShop, but this hasn't always been an issue.
  • It seems like the checkout page issue could be related to having an SVG at the top of our checkout template? I have moved it lower and it seems to have resolved the issue.

    I am still working on the other issue.
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    Thanks for detailing the replication steps. I couldn't replicate the addresses getting mixed up, but I guess that's the one you were meaning the SVG moving fixed? If that is the case, could you put the SVG back how it was so we could replicate? If that is the way to fix it, I'd love to dig into how that's the issue.

    For the non-shipping gift ending up on the shipto, that appears to be because the gift is being added to the shipto. The mutliship fields are still a part of the form, just hidden from view. When the form is submitted, those fields are still getting submitted with the form. By default it's selecting the last used shipto address, so as that was the product added in step 1, it's just using whatever shipto was used then. You'll need to stop the shipto fields from being part of the form when you don't want them to apply, or dynamically prepend the field name with an x: to tell our code to ignore it.
  • I can't get it to repeat now, so maybe the SVG thing was not an issue, but maybe something else in the cache of the checkout template.
  • brettbrett FoxyCart Team
    @jingari Huh. Phantom issues are never fun. If it happens again, let us know.
Sign In or Register to comment.