PluginProbe
seQura / 4.0.0
seQura v4.0.0
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / src / Services / Widgets / interface-widgets-service.php

interface-widgets-service.php in seQura 4.0.0, at src/Services/Widgets/interface-widgets-service.php

73 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Widgets Service Interface
4 *
5 * @package SeQura/WC
6 * @subpackage SeQura/WC/Services
7 */
8
9 namespace SeQura\WC\Services\Widgets;
10
11 /**
12 * Widgets Service Interface
13 *
14 * @phpstan-type WidgetDataArray array{
15 * product: string,
16 * dest: string,
17 * theme: string,
18 * reverse: string,
19 * campaign: string,
20 * priceSel: string,
21 * altPriceSel: string,
22 * altTriggerSelector: string,
23 * minAmount: int,
24 * maxAmount: int,
25 * miniWidgetMessage: string,
26 * miniWidgetBelowLimitMessage: string
27 * }
28 *
29 * @phpstan-type WidgetConfigParamsDataArray array{
30 * assetKey: string,
31 * merchantId: string,
32 * products: string[],
33 * scriptUri: string,
34 * locale: string,
35 * currency: string,
36 * decimalSeparator: string,
37 * thousandSeparator: string,
38 * isProductListingEnabled: bool,
39 * isProductEnabled: bool,
40 * widgetConfig: string
41 * }
42 */
43 interface Interface_Widgets_Service {
44
45 /**
46 * Get available widget for cart page
47 *
48 * @return WidgetDataArray|null The available widget, or null if cannot be determined
49 */
50 public function get_widget_for_cart_page(): ?array;
51
52 /**
53 * Get available widget for product listing page
54 *
55 * @return WidgetDataArray|null The available widget, or null if cannot be determined
56 */
57 public function get_widget_for_product_listing_page(): ?array;
58
59 /**
60 * Get available widgets for product page
61 *
62 * @return WidgetDataArray[]|null The available widgets, or null if cannot be determined
63 */
64 public function get_widgets_for_product_page( string $product_id ): ?array;
65
66 /**
67 * Get widget configuration parameters required in the frontend
68 *
69 * @return WidgetConfigParamsDataArray|null The configuration parameters, or null if cannot be determined
70 */
71 public function get_widget_config_params(): ?array;
72 }
73