• Resolved marcovega

    (@marcovega)


    Hey, Dan!

    I’m working on a project that requires a different price for PO Boxes based on weight, which is slightly higher than the standard shipping to the same areas. I was messing around dangoodman/* vendor directories and I’m not quite sure where to get started. Wanted to reach if there’s a better way to do it.

    Basically, I need to search for pobox substring within shipping_address_1, billing_address_1, or postcode, and then do my logic from there.

    I’d appreciate any lights you can give to me here.

Viewing 1 replies (of 1 total)
  • Plugin Author Dan

    (@dangoodman)

    Hi,

    I see it done in the following way:

    1. Set up your shipping, so it produces a pair of shipping options: a) regular and b) regular + PO Boxes surcharge. Make sure they appear with distinguishable labels, e.g., ‘2-day shipping’ and ‘2-day shipping (PO Box)’.

    2. Hide the regular option if the customer’s shipping address is referencing a PO Box. Or, hide the PO Box option in the other case.

    For the second part, check this custom code snippet. You would need to slightly modify it by adding an else branch to if (strstr($check_address, 'pobox')).

Viewing 1 replies (of 1 total)
  • The topic ‘Best way to programmatically asign DestinationConditions’ is closed to new replies.