mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-10 11:32:54 +00:00
2.4.5
This commit is contained in:

committed by
Remco Tolsma

parent
37367ac369
commit
721dda6e5c
19
includes/class-wc-product-variable-subscription.php
Executable file → Normal file
19
includes/class-wc-product-variable-subscription.php
Executable file → Normal file
@@ -312,4 +312,23 @@ class WC_Product_Variable_Subscription extends WC_Product_Variable {
|
||||
|
||||
return $prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of available variations for the current product.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_available_variations() {
|
||||
$available_variations_data = parent::get_available_variations();
|
||||
|
||||
foreach ( $available_variations_data as $index => $variation_data ) {
|
||||
|
||||
// Add the product's synced first payment date to the variation data if applicable.
|
||||
if ( isset( $variation_data['variation_id'] ) ) {
|
||||
$available_variations_data[ $index ]['first_payment_html'] = WC_Subscriptions_Synchroniser::get_products_first_payment_date( wc_get_product( $variation_data['variation_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $available_variations_data;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user