Hi @bantergroupaus,
Again thanks for your message.
To show the Afterpay messaging for only a specific category, the below code can be used. This can be added to the functions.php
file of the active theme. This file can be found by going to Appearance > Theme Editor
in the dashboard and selecting the active theme to edit. When pasting this snippet into the file, replace Your Category Name
with the name of the category you would like to use.
function afterpay_hoipp_callback( $str_html, $product, $price ) {
$categories = get_the_terms( $product->get_id(), 'product_cat' );
$show_message = false;
foreach($categories AS $category) {
if (property_exists($category, 'name') && $category->name == 'Your Category Name') {
$show_message = true;
break;
}
}
if (!$show_message) {
$str_html = "";
}
return $str_html;
}
add_filter( 'afterpay_html_on_individual_product_pages', 'afterpay_hoipp_callback', 10, 3 );
This will remove the messaging unless the products are in the category that you would like displayed.
If the site theme is updated, the code *may* need to be added back to functions.php
file.
Please note that as always when making modifications like this, the Afterpay team recommend testing this in a staging environment first and making sure to take a backup of the site files and database beforehand.
Thank you.