• Resolved da_Mask

    (@da_mask)


    I have a product that is not availble on our website, therefore we have no price in the backend. The Afterpay plugin prints out Installments by Afterpay available between $0.00 – $1,000.00 on the frontend.

    Is the only solution to hide this?

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

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

    (@afterpayit)

    Hi @da_mask,

    Thank you for your message.

    The behaviour described here represents a known challenge that is expected to be addressed in the next release. In the meantime, please consider using the afterpay_html_on_individual_product_pages hook to hide the Afterpay content for either a specified array of Product IDs, or any instance of the “available between” message.

    For example, the following code sample can be added to the active theme’s functions.php file:

    /**
     * @param string     $str_html
     * @param WC_Product $product
     * @param float      $price
     */
    function afterpay_hoipp_callback( $str_html, $product, $price ) {
        # Hide the "Installments by Afterpay available between X - Y" message
        if (preg_match('/available between/m', $str_html)) {
            $str_html = '';
        }
        return $str_html;
    }
    add_filter( 'afterpay_html_on_individual_product_pages', 'afterpay_hoipp_callback', 10, 3 );

    Thank you.

    Thread Starter da_Mask

    (@da_mask)

    Hi,

    Thanks for that. Do you have the Afterpay hooks documented anywhere?

    Plugin Author Afterpay

    (@afterpayit)

    Hi @da_mask,

    Thanks for following up.

    Yes, hooks are described in the Afterpay online documentation under “Advanced Configuration > Hooks”:

    Thank you.

    Thread Starter da_Mask

    (@da_mask)

    Hi,

    I’m just wondering if you are getting close to making an official fix for this? I am trying to work out if I need incorporate this into my sites in a more permanent basis, or am I ok to just leave this in my functions.php for now?

    Plugin Author Afterpay

    (@afterpayit)

    Hi @da_mask,

    Thanks for following up.

    The team can confirm that a resolution for this challenge will be included in the next release. The challenge has been reproduced in an internal environment, and the resolution verified.

    Please expect version 2.1.2 to be released within the next 7 days.

    Thank you for your patience.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Product with no price output’ is closed to new replies.