5
Lexter
4y

Do you prefer:

$order->getShippingAddressCountry();

or

$order->getShippingCountry();

Fuck me, being a perfectionist slows me down.

Beign stuck on: Save that shit as address_shipping_country or shipping_country is purely stupid, i know.

Comments
  • 2
    field: shipping_address_country
    Method: getShippingAddressCountry()

    But that's just me 🤷‍♂️
  • 4
    order.getShippingDestinationCountry();

    Shipping usually has a source and destination addresses. And possibly some intermediate ones. Making a clear and verbose distinction there feels only natural (at least to me).

    Or, you know..
    order.getShippingDestinationAddress().getCountry()
  • 0
    You are right guys. Write code like a human.
  • 0
    The fun part about adresses: They're different in every part of the world.

    Having a general adress object is a good idea.

    Country is very unspecific. Usually it's an ISO 3166 code - 2 or 3 digits, dependent on country / preference.

    A general object makes sense.

    getShippingInformation()->
    getAddress()->
    getCountry()->
    getName()

    Shipping Information can consist of many things.

    Weight Information, Packaging Information , ...
  • 1
    $o -> a();

    And no, there's no comments explaining it either.

    My email is included at the top on the Author line tho... :)
  • 0
    @HiFiWiFiSciFi Paypal link/bitcoin address as well. Ain't giving away my secrets for free
Add Comment