sequra_can_display_widget_for_method

Hook Filter

Allow modifying the seQura availability at product page for a certain payment method

Description

Use this to modify the current availability for displaying promotional components on the product page for a certain payment method.

ParameterTypeDescription
$is_availableboolDefine if promotional components are available for the product
$productWC_ProductProduct instance
$payment_methodarrayContains the payment method data

Changelog

VersionDescription
3.0.0Introduced

Usage Example

add_filter('sequra_can_display_widget_for_method', function($is_available, $product, $method){
  if($product->get_id() === 999 && $payment_method['product'] === 'pp3'){
    return true; // Force to show pp3 payment method widget for the product with ID 999.
  }
  return $is_available;
}, 10, 3);