woocommerce_sequra_add_service_end_date

Hook Filter

Filter the service end date.

Description

This filter allows modifying the service end date value for a given product. It is only triggered for products that are services and when the merchant configuration allows selling services.

ParameterTypeDescription
$end_datestringService end date using ISO 8601 to represent fixed time or duration
$productWC_ProductThe WooCommerce product instance
$itemarray or WC_Order_Item_ProductAn array representing the WooCommerce Cart Item or an instance of Order Item

Changelog

VersionDescription
2.0.0Introduced

Usage Example

add_filter('sequra_create_order_request_gui_options', function($end_date, $product, $item){
  $end_date = 'P2Y'; // Set your custom value
  return $end_date;
},10, 3);