Automattic\WooCommerce\Internal\Admin\Suggestions
PaymentsExtensionSuggestions::with_store_state_details
Apply customizations to the extension details based on the store's state.
The customizations may be general or specific to certain extensions. The store's state refers to various aspects of the store's configuration, collected data, store setup/launch process, onboarding task completion, etc.
Method of the class: PaymentsExtensionSuggestions{}
No Hooks.
Returns
Array. The modified extension details.
Usage
// private - for code of main (parent) class only $result = $this->with_store_state_details( $extension_id, $extension_details ): array;
- $extension_id(string) (required)
- The extension ID.
- $extension_details(array) (required)
- The extension details.
PaymentsExtensionSuggestions::with_store_state_details() PaymentsExtensionSuggestions::with store state details code WC 10.3.3
private function with_store_state_details( string $extension_id, array $extension_details ): array {
// For Square, we add the preferred tags if the merchant self-identified as selling offline via the core profiler.
if ( self::SQUARE === $extension_id && $this->is_merchant_selling_offline() ) {
if ( empty( $extension_details['tags'] ) ) {
$extension_details['tags'] = array();
}
$extension_details['tags'][] = self::TAG_PREFERRED;
$extension_details['tags'][] = self::TAG_PREFERRED_OFFLINE;
}
return $extension_details;
}