• Hi,

    I have updated Woocommerce to the latest version and also fr address to the latest version also updated the select-address.php file in theme but still addresses are not showing messed up the whole HTML is showing. I have added the link above too, so please check and I will really appreciate the help asap and fixing of this issue.

    Looking forward for your quick response.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author fahrirusliyadi

    (@fahrirusliyadi)

    Does it work if you don’t override the select-address.php? Also please share the select-address.php file on your theme.

    Thread Starter mayaz2204

    (@mayaz2204)

    Does it work if you don’t override the select-address.php? No, it shows blank boxes.
    Secondly, I have shared below the code of select-address.php.

    `<?php
    /**
    * Select address field.
    *
    * This template can be overridden by copying it to your-theme/fr-address-book-for-woocommerce/select-address.php.
    *
    * However, on occasion we will need to update template files and you (the theme
    * developer) will need to copy the new files to your theme to maintain
    * compatibility.
    *
    * @since 1.0.0
    * @version 1.2.2
    * @author Fahri Rusliyadi <[email protected]>
    */

    /* @var $type string */
    /* @var $addresses array */
    /* @var $saved_address_id int */

    $field_options = array();

    foreach ($addresses as $id => $value) {
    $field_options[$id] = isset($value[‘address_name’]) && $value[‘address_name’]
    ? sprintf(‘<strong class=”fabfw-address-name”>%s<br>’, $value[‘address_name’])
    : ”;
    // $field_options[$id] .= “<table><tr><th>First Name</th><td>Mohammed</td></tr></table>”;
    // $field_options[$id] .= wc()->countries->get_formatted_address($value);
    $field_options[$id] .= “First Name: <span style=’margin-left:10px;’></span>”.$value[“first_name”].”<br>”;
    $field_options[$id] .= “Last Name: <span style=’margin-left:10px;’></span>”.$value[“last_name”].”<br>”;
    // $field_options[$id] .= “Email: <span style=’margin-left:10px;’></span>”.$value[“email”].”<br>”;
    $field_options[$id] .= “Phone: <span style=’margin-left:10px;’></span>”.$value[“phone”].”<br>”;
    $field_options[$id] .= “Country: <span style=’margin-left:10px;’></span>”.$value[“country”].”<br>”;
    $field_options[$id] .= “Area: <span style=’margin-left:10px;’></span>”. $value[“add_1″].”<br>”;
    $field_options[$id] .= “Block: <span style=’margin-left:10px;’></span>”. $value[“add_2″].”<br>”;
    $field_options[$id] .= “Street: <span style=’margin-left:10px;’></span>”. $value[“add_3″].”<br>”;
    $field_options[$id] .= “Avenue: <span style=’margin-left:10px;’></span>”. $value[“avenew”].”<br>”;
    $field_options[$id] .= “House/Flat: <span style=’margin-left:10px;’></span>”. $value[“houseflt”].”<br>”;
    $field_options[$id] .= “Floor: <span style=’margin-left:10px;’></span>”. $value[“floornbr”].”<br>”;
    $field_options[$id] .= “Additional Notes: <span style=’margin-left:10px;’></span>”. $value[“adns”].”<br>”;
    $field_options[$id] .= sprintf(‘<br>%s‘, __(‘Edit’, ‘fr-address-book-for-woocommerce’));
    }

    if (count($addresses) < fr_address_book_for_woocommerce()->max_addresses) {
    $field_options[‘new’] = sprintf(‘%s‘, __(‘Add new address’, ‘fr-address-book-for-woocommerce’));
    }
    ?>

    <div class=”fabfw-select-address-container”>
    <?php if ($addresses) : ?>
    <?php woocommerce_form_field(“fabfw_address_{$type}_id”, array(
    ‘label’ => __(‘Address book’, ‘fr-address-book-for-woocommerce’),
    ‘type’ => ‘radio’,
    ‘options’ => $field_options,
    ), $saved_address_id) ?>
    <address class=”muaaz-butt”>
    <?php echo wc()->countries->get_formatted_address($address); ?>
    </address>
    <?php
    // Hide the field if no addresses saved yet.
    else : ?>
    <input type=”hidden” name=”<?php echo “fabfw_address_{$type}_id” ?>” value=”new”>
    <?php endif ?>
    </div>

    Looking forward for your quick response on this.

    Thanks.

    Plugin Author fahrirusliyadi

    (@fahrirusliyadi)

    Does it work if you don’t override the select-address.php? No, it shows blank boxes.

    In this case, there may be a conflict with one of your plugins or theme. To narrow down the problem, I suggest you try with all plugins disabled except WooCommerce and this plugin; and use the default WordPress theme. If the problem persists, please let me know which version of PHP, WordPress, and plugins.

    Secondly, I have shared below the code of select-address.php.

    Your code is escaped, so I can’t be sure what’s wrong with the code. Please use something like https://pastebin.pl/. But it looks like you haven’t updated the code. You’re still using woocommerce_form_field, that was the source of the problem.

    Thread Starter mayaz2204

    (@mayaz2204)

    Hi,

    I have tried both of your suggestions above but the issue is still there:

    In this case, there may be a conflict with one of your plugins or theme. To narrow down the problem, I suggest you try with all plugins disabled except WooCommerce and this plugin; and use the default WordPress theme. If the problem persists, please let me know which version of PHP, WordPress, and plugins. Below are the versions etc. as per you requested:

    Versions:
    WordPress 5.5.1
    Fr Address Book for Woocommerce Version 1.2.2
    WooCommerce Version 4.4.1
    PHP 7.3.20

    Secondly, here’s the code of the file template: https://pastebin.pl/view/b9974637

    Looking forward for the solution asap.

    TIA,

    • This reply was modified 4 years, 2 months ago by mayaz2204.
    Plugin Author fahrirusliyadi

    (@fahrirusliyadi)

    Versions:
    WordPress 5.5.1
    Fr Address Book for Woocommerce Version 1.2.2
    WooCommerce Version 4.4.1
    PHP 7.3.20

    And which default theme did you use to test?

    Secondly, here’s the code of the file template: https://pastebin.pl/view/b9974637

    Your code is not valid. It’s still escaped. Did you not copy directly from the file? Also as I mentioned before, you haven’t updated the template.

    Thread Starter mayaz2204

    (@mayaz2204)

    https://pastebin.pl/view/c63a5e42 Here’s the new pastebin link

    And which default theme did you use to test? I am using Flatsome child theme but I did try testing as per your instructions with Twenty Twenty default theme and also only 2 plugins active Woocommerce & your plugin.

    If you needed I can give you the user details privately if you wanted to see yourself.

    Just let me know.

    Thanks,

    Plugin Author fahrirusliyadi

    (@fahrirusliyadi)

    https://pastebin.pl/view/c63a5e42 Here’s the new pastebin link

    This code won’t work. Because it’s outdated. Still using woocommerce_form_field which was the source of the problem.

    I am using Flatsome child theme but I did try testing as per your instructions with Twenty Twenty default theme and also only 2 plugins active Woocommerce & your plugin.

    Sorry, I still can’t reproduce the issue.

    If you needed I can give you the user details privately if you wanted to see yourself.

    OK, send me an email to [email protected].

    Thread Starter mayaz2204

    (@mayaz2204)

    https://pastebin.pl/view/c63a5e42 Here’s the new Pastebin link

    This code won’t work. Because it’s outdated. Still using woocommerce_form_field which was the source of the problem. (Okay then please let me know what’ll work)

    OK, send me an email to [email protected]. Secondly, I have sent you the username and password at your email, please check and confirm shortly.

    Please let me know if you get the login details.

    Thanks,

    Plugin Author fahrirusliyadi

    (@fahrirusliyadi)

    Okay then please let me know what’ll work

    You need to update the template.

    Secondly, I have sent you the username and password at your email, please check and confirm shortly.

    I’ve received your email and I’ll look into it.

    Thread Starter mayaz2204

    (@mayaz2204)

    Okay thank you so much. I am waiting for the issue resolution.

    Looking forward to hear positive answer from you.

    Regards,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Saved Addresses Formatting issue on Checkout’ is closed to new replies.