• Hi, we are going to enable afterpay depending on the location of the user. Is there a filter or hook that would enable us to add a condition for when to display the afterpay badge /?info on product pages? Thank-you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Afterpay

    (@afterpayit)

    Hi @kokomoweb,

    Thanks for your message.

    The filter hook afterpay_is_product_supported can be used to achieve this. This hook will not only hide the messaging, but also disable the Afterpay Payment Gateway if those products are included in the customers cart. To hide text only on PDP the afterpay_html_on_individual_product_pages hook can be used. Examples of both can be found here: https://developers.afterpay.com/afterpay-online/docs/woocommerce-hooks

    Thank you

    Thread Starter Kokomo

    (@kokomoweb)

    @afterpayit thanks for the info! That is very helpful. One issue I am seeing is that if we do this in PHP, since the pages are cached, it won’t work properly with geolocation. Is there any way to do this via js?

    Plugin Author Afterpay

    (@afterpayit)

    Hi @kokomoweb,

    Thank you for the follow up question.

    The Afterpay messaging is rendered on the server side. There is no existing JavaScript feature for conditionally rendering it.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditionally showing the afterpay info on single products’ is closed to new replies.