• Resolved rainsey

    (@rainsey)


    We have enabled the afterpay tag to show on single product pages, but it shows on the product and related products. We use owl carousel for our related products and showing the tag results in significant css issues.

    Our developer suggested adding a function in our theme’s function.php file as below and calling the function as a possible fix. This fix does not work. Could you please advise how to disable the afterpay tag on related products?

    function afterpay-fix() {
    remove_action( ‘woocommerce_single_product_summary’, array($gateway, ‘print_info_for_product_detail_page’), 15, 0 );
    remove_action( ‘woocommerce_after_shop_loop_item_title’, array($gateway, ‘print_info_for_listed_products’), 15, 0 );
    }

    • This topic was modified 6 years, 6 months ago by rainsey.
Viewing 1 replies (of 1 total)
  • Plugin Author Afterpay

    (@afterpayit)

    Hi rainsey,

    Thank you for reporting this behaviour. This has been relayed to the development team and release manager for review and consideration in future plugin releases.

    As soon as a change has been verified and committed to a future release, it will become available for update through the standard plugin manager in the WordPress admin.

    For the time being, please consider attaching a method to one of the following hooks, which are used by the plugin prior to rendering the HTML on the category pages and individual product pages:

    • Filter: ‘afterpay_is_product_supported’ (Passes arguments: WC_Product $product; expects a Boolean return value)
    • Filter: ‘afterpay_html_on_product_thumbnails’ (Passes arguments: WC_Product $product, float $price; expects a String return value)
    • Filter: ‘afterpay_html_on_individual_product_pages’ (Passes arguments: WC_Product $product, float $price; expects a String return value)

    Alternatively, to detach the Afterpay methods from the WooCommerce hooks entirely, perhaps based on some conditional logic, please consider the following:

    remove_action( 'woocommerce_after_shop_loop_item_title', array(WC_Gateway_Afterpay::getInstance(), 'print_info_for_listed_products'), 15, 0 );
    remove_action( 'woocommerce_single_product_summary', array(WC_Gateway_Afterpay::getInstance(), 'print_info_for_product_detail_page'), 15, 0 );

    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘related products remove tag’ is closed to new replies.