Perch Shop Checkout Addresses

  • Hey Perch-People,

    after developing a lot of websites with perch so far, im struggling with my first perch shop.
    Most of my work is already working pretty fine but i cant get the last two pages of my checkout done.
    Because of the fact that this is a very very simple shop i use the create_passwordless method to register customer with billing and shipping addresses.
    The registration itself works as expected, the customer gets created (with billing and shipping addresses) and the member entry as well.
    But at my order confirmation page the addresses do not show.

    If i log the contents with <perch:showall> everything is set to false except "shipping_perch_first_name" and "shipping_perch_first_name". (same for billing)
    Perch itself and every addon ist updated to the latest version. I have no idea how to solve this problem.


    Any suggestions?

    Thanks in advance,
    Bastian

  • drewm

    Approved the thread.
  • Hey,

    at my checkout.php i got this

    Code
    1. if (perch_shop_addresses_set()) {
    2. perch_shop_order_addresses([
    3. 'template' => 'shop/checkout/addresses.html',
    4. ]);
    5. } else {
    6. perch_shop_order_address_form();
    7. }

    The perch_shop_addresses_set is always true.

    Thats "addresses.html"

    I even copied the IDs from the samle shop templates but the address information still doesnt show up.

  • At the moment I have no idea whether the problem is the customer address data not being saved or whether Perch Shop is not returning the saved addresses.


    I would check the database to see whether all the address fields were saved in the table perch3_shop_addresses. Turning on debug mode and checking the debug messages after submitting the form that handles the customer addresses may be useful too.

  • Hey,
    i made some progress on debugging but i still cant explain what exactly happens.
    Both addresses get saved in my DB with the correct data. But for some reason there are two additional entries without any data except firstname and lastname. (see screenshot)

    Thats my debug:


    EDIT: If i refresh my page and call perch_shop_order_addresses() these two empty entries gets added every single time.

  • Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'countryID' at row 1


    Did you remove the country field from the sign up form? You should be able to find it in the default template:


    HTML
    1. <perch:label for="country">Country</perch:label>
    2. <perch:input type="select" options="<perch:shop id="country_list" />" value="236" id="country" label="Country" />
  • Obvious error :D
    I don't know where i got this ID from but after changing it now works.

    The only thing that still doesn't work is that shippings_list is set to false. I had this issue in the past but thought its related to the wrong addresses. Unfortunately this problem persists.


    I configured 4 shipping zones with 1 default and 3 shipping methods. All are active and all should be available for the country Germany.

    Somehow its always set to false.

    Any suggestions?

    EDIT: If i check for perch_shop_location_selected() its set to true.