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.
Метод класса: PaymentsExtensionSuggestions{}
Хуков нет.
Возвращает
array. The modified extension details.
Использование
// private - только в коде основоного (родительского) класса $result = $this->with_store_state_details( $extension_id, $extension_details ): array;
- $extension_id(строка) (обязательный)
- The extension ID.
- $extension_details(массив) (обязательный)
- The extension details.
Код PaymentsExtensionSuggestions::with_store_state_details() PaymentsExtensionSuggestions::with store state details WC 11.3.0
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;
}