BlockHooksTrait.php
4 weeks ago
BlockTemplateUtils.php
2 months ago
BlocksSharedState.php
3 months ago
BlocksWpQuery.php
2 years ago
CartCheckoutUtils.php
4 weeks ago
MiniCartUtils.php
1 year ago
ProductAvailabilityUtils.php
11 months ago
ProductDataUtils.php
1 year ago
ProductGalleryUtils.php
4 weeks ago
StyleAttributesUtils.php
1 year ago
Utils.php
2 years ago
ProductDataUtils.php
23 lines
| 1 | <?php |
| 2 | declare(strict_types=1); |
| 3 | namespace Automattic\WooCommerce\Blocks\Utils; |
| 4 | |
| 5 | /** |
| 6 | * Utility class to get product data consumable by the blocks. |
| 7 | * |
| 8 | * @internal |
| 9 | */ |
| 10 | class ProductDataUtils { |
| 11 | /** |
| 12 | * Get the product data. |
| 13 | * |
| 14 | * @param \WC_Product $product Product object. |
| 15 | * @return array The product data. |
| 16 | */ |
| 17 | public static function get_product_data( \WC_Product $product ) { |
| 18 | return array( |
| 19 | 'price_html' => $product->get_price_html(), |
| 20 | ); |
| 21 | } |
| 22 | } |
| 23 |