You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,120 +76,7 @@ public static function get_public_item_schema() {
76
76
'type' => 'array',
77
77
'context' => [ 'view' ],
78
78
'readonly' => true,
79
-
'properties' => [
80
-
[
81
-
'key' => [
82
-
'description' => esc_html__( 'Unique WooCommerce-generated key identifying the cart in the database. This differs from the parent-level cart_hash property.', 'cc-woo' ),
83
-
'type' => 'string',
84
-
'context' => [ 'view' ],
85
-
'readonly' => true,
86
-
],
87
-
'product_id' => [
88
-
'description' => esc_html__( 'The WooCommerce product ID.', 'cc-woo' ),
89
-
'type' => 'integer',
90
-
'context' => [ 'view' ],
91
-
'readonly' => true,
92
-
],
93
-
'variation_id' => [
94
-
'description' => esc_html__( 'The WooCommerce product variation ID, if applicable.', 'cc-woo' ),
95
-
'type' => 'integer',
96
-
'context' => [ 'view' ],
97
-
'readonly' => true,
98
-
],
99
-
'variation' => [
100
-
'description' => esc_html__( 'Object representation of any applicable variations, where keys are variation names and values are the actual variation selection.', 'cc-woo' ),
'description' => esc_html__( 'Line total tax.', 'cc-woo' ),
157
-
'type' => 'string',
158
-
'context' => [ 'view' ],
159
-
'readonly' => true,
160
-
],
161
-
'data' => [
162
-
'description' => esc_html__( 'Misc. product data in key-value pairs.', 'cc-woo' ),
163
-
'type' => 'object',
164
-
'context' => [ 'view' ],
165
-
'readonly' => true,
166
-
],
167
-
'product_title' => [
168
-
'description' => esc_html__( 'The product title.', 'cc-woo' ),
169
-
'type' => 'string',
170
-
'context' => [ 'view' ],
171
-
'readonly' => true,
172
-
],
173
-
'product_sku' => [
174
-
'description' => esc_html__( 'The product SKU.', 'cc-woo' ),
175
-
'type' => 'string',
176
-
'context' => [ 'view' ],
177
-
'readonly' => true,
178
-
],
179
-
'product_permalink' => [
180
-
'description' => esc_html__( 'Permalink to the product page.', 'cc-woo' ),
181
-
'type' => 'string',
182
-
'context' => [ 'view' ],
183
-
'readonly' => true,
184
-
],
185
-
'product_image_url' => [
186
-
'description' => esc_html__( 'URL to the full-size featured image for the product if one exists.', 'cc-woo' ),
187
-
'type' => 'string',
188
-
'context' => [ 'view' ],
189
-
'readonly' => true,
190
-
]
191
-
]
192
-
]
79
+
'properties' => self::get_products_properties(),
193
80
],
194
81
'coupons' => [
195
82
'description' => esc_html__( '', 'cc-woo' ),
@@ -263,4 +150,119 @@ public static function get_public_item_schema() {
263
150
];
264
151
}
265
152
153
+
publicstaticfunctionget_products_properties() {
154
+
return [
155
+
'key' => [
156
+
'description' => esc_html__( 'Unique WooCommerce-generated key identifying the cart in the database. This differs from the parent-level cart_hash property.', 'cc-woo' ),
157
+
'type' => 'string',
158
+
'context' => [ 'view' ],
159
+
'readonly' => true,
160
+
],
161
+
'product_id' => [
162
+
'description' => esc_html__( 'The WooCommerce product ID.', 'cc-woo' ),
163
+
'type' => 'integer',
164
+
'context' => [ 'view' ],
165
+
'readonly' => true,
166
+
],
167
+
'variation_id' => [
168
+
'description' => esc_html__( 'The WooCommerce product variation ID, if applicable.', 'cc-woo' ),
169
+
'type' => 'integer',
170
+
'context' => [ 'view' ],
171
+
'readonly' => true,
172
+
],
173
+
'variation' => [
174
+
'description' => esc_html__( 'Object representation of any applicable variations, where keys are variation names and values are the actual variation selection.', 'cc-woo' ),
0 commit comments