• Resolved uniquegrouplimited

    (@uniquegrouplimited)


    Hi, we use Apply Pay for the payment method, we found that the shipping address will not captured by Apple Pay and we need to input the address again the Apple Pay side.

    Shall I know whether there is any soultion that the shipping address can be captured automatically by Apple Pay ?

    Looking forwards to your reply.

    Thanks & Regards,
    Andrew

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

Viewing 10 replies - 16 through 25 (of 25 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @uniquegrouplimited,

    As of version 3.1.8, I have added a new filter which makes it possible for you to determine if the shipping option should be available in the Apple Wallet. Here is an example where the needs_shipping property is updated to false if the customer is logged in. You could write whatever logic you want to replace it.

    https://docs.paymentplugins.com/wc-stripe/api/source-class-WC_Payment_Gateway_Stripe.html#1461

    function maybe_show_shipping_address_in_wallet($data, $page, $gateway){
        // user is logged in so there is an existing shipping address
        if(is_user_logged_in()){
            $data['needs_shipping'] = false;
        }
        return $data;
    }
    
    add_filters('wc_stripe_output_display_items', 'maybe_show_shipping_address_in_wallet', 10, 3);

    Kind Regards,

    Thread Starter uniquegrouplimited

    (@uniquegrouplimited)

    Do you mean that we follow the following code and add into functions.php of the theme ?

    function maybe_show_shipping_address_in_wallet($data, $page, $gateway){
    // user is logged in so there is an existing shipping address
    if(is_user_logged_in()){
    $data[‘needs_shipping’] = false;
    }
    return $data;
    }

    add_filters(‘wc_stripe_output_display_items’, ‘maybe_show_shipping_address_in_wallet’, 10, 3);

    I have tired, but it returns error.

    Thanks & Regards,
    Andrew

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @uniquegrouplimited

    What I provided was a generic example that has not been code checked. The purpose of that example was to show you how you could use the plug-in’s filters to accomplish the behavior that you are wanting to achieve.

    You would want to write your own logic in the functions.php of your child theme.

    Kind regards,

    Dear Mr.Clayton,

    We have tried our best effort in the last few days, including a bit of code editing but without succeed. Allow us to come back to you to seek for further advise with thanks.

    A) ApplePay shipping requirement remain in force. our version is 3.2.0
    we see the default value should already be $data[‘needs_shipping’] = false, but the ApplePay popup remains persistent to have a shipping address to proceed. Is our interpretation wrong or is it a problem?

    B) about the coding, we tried putting the below code in the functions.php of the theme in use

    // in the final class OCEANWP_Theme_Class --> __contruct
    add_filter('wc_stripe_output_display_items', 'maybe_show_shipping_address_in_wallet', 10, 3);
    // in the final class OCEANWP_Theme_Class
    public static function maybe_show_shipping_address_in_wallet($data, $page, $gateway){
            $data['needs_shipping'] = false;
    return $data;
    }

    but we are getting a error “null is not an object (evaluating ‘this.get_gateway_data().currency’). can you advise what the problem would be in our code and how we can correct it?

    Thank you very much Clayton.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @martinuniquegl,

    You should upgrade to version 3.2.1. of the plugin which was recently released.

    Are you able to share your website url? Please make sure to upgrade first so I can test using the latest version.

    Kind Regards,

    we would have to share with you privately since the development site is password protected. would you mind to send me an email at [email protected]? Thank you very much.

    Plugin Author Payment Plugins

    (@mrclayton)

    @martinuniquegl

    You shouldn’t share your contact info on this forum. It’s better that you contact me via the Help button located on the plugin settings page.

    Dear Mr.Clayton,

    Thanks and we confirm the 3.2.1 has the shipping address in the applepay removed if the user is logged in with a shipping address.

    We would let you know if we have further questions in the customization.

    Thank you very much for your help Clayton.

    Thread Starter uniquegrouplimited

    (@uniquegrouplimited)

    Hi, mr.clayton

    I updated your plugin to 3.2.1…..

    But it is very strange that I found Shipping Adddress is sill here in my site….but the shipping address has not been shown in my another site.

    1) https://cafe.iwoosystem.com/. –> The shipping address is still here.
    2) https://www.iwoosystem.com/payme/. –> The shipping address is hidden.

    Shall I know whether there any special setup I need in order to get the shipping address hidden ?

    Looking forwards to your reply.

    Thanks & Regards,
    Andrew

    Plugin Author Payment Plugins

    (@mrclayton)

    @uniquegrouplimited,

    Your checkout page is requiring shipping because your products are shippable. Notice on your checkout page that the shipping address fields render. That’s because the cart requires shipping.

    Apple Pay looks to see if your cart requires shipping and if it does, it requires it in the Apple Wallet. If you want to deviate from that behavior you can use the provided filters to prevent shipping from being required in the Apple Wallet.

    WooCommerce always requires shipping for non-virtual products.

    Kind Regards,

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Apple Pay & Shipping Address Issue’ is closed to new replies.