Found something I'm unsure about, if it's something I should fix in the shipping module, or if it's a core bug.

I'm doing a shipping module with several shipping selections (quotes), where some is restricted to company addresses, and thus I have something like this in the catalog model code to only display it when company name is filled:
if (!$address['company'] && $product->ProductId == 'COMPANY_PRODUCT') {
continue;
}


But when I'm on the Checkout/Address page and remove the check-mark on "My billing and delivery addresses are the same." I get "Undefined index: company" - so to me it seems like Arastta is "loosing" some data when doing this. Also if I change the address from dropdown after removing the check-mark , all becomes fine again.

Any inputs are welcome. :)
In General
Tuesday, August 09 2016, 05:53 PM
Share this post:
Responses (3)
  • Accepted Answer

    Tuesday, August 09 2016, 11:05 PM - #Permalink
    Probably not the most elegant way, but for now I use something like (actually more products etc, thus I found this easiest):
    if ($product->ProductId == 'COMPANY_PRODUCT' && (!isset($address['company']) or !$address['company'])) {
    continue;
    }


    But there is something going on at the address checkout page it seems, the data in the "pre-selected" address (default) isn't used directly, and I also got an error when trying to fill a new address.

    Note! Also changed city and postcode (plus added company name) should trigger a reload of shipping, to ensure the correct alternatives and price is displayed before pushing the continue button ...

    Edit! Code fixing.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, August 10 2016, 02:02 PM - #Permalink
    This might be related: https://github.com/arastta/arastta/issues/527
    I wonder if Arastta drops some data, without reloading it (from store/default), on all possible actions in the checkout.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, August 17 2016, 10:50 PM - #Permalink
    A side note! If a customer in cart fill in postcode, state/region and country, those data and selected shipping should be remembered. Especially for guest checkout.
    The reply is currently minimized Show
Your Reply