e_plat 1.0.0 → 1.1.0.pre.rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +467 -413
  3. data/lib/e_plat/client.rb +9 -5
  4. data/lib/e_plat/mapping/base.rb +22 -3
  5. data/lib/e_plat/mapping/bigcommerce/v_3/order.rb +156 -156
  6. data/lib/e_plat/mapping/woocommerce/v_3/metafield.rb +39 -0
  7. data/lib/e_plat/mapping/woocommerce/v_3/order/billing_address.rb +79 -0
  8. data/lib/e_plat/mapping/woocommerce/v_3/order/line_item.rb +85 -0
  9. data/lib/e_plat/mapping/woocommerce/v_3/order/shipping_address.rb +71 -0
  10. data/lib/e_plat/mapping/woocommerce/v_3/order/shipping_line.rb +54 -0
  11. data/lib/e_plat/mapping/woocommerce/v_3/order.rb +189 -0
  12. data/lib/e_plat/mapping/woocommerce/v_3/product/image.rb +43 -0
  13. data/lib/e_plat/mapping/woocommerce/v_3/product/option.rb +45 -0
  14. data/lib/e_plat/mapping/woocommerce/v_3/product/variant/option_value.rb +40 -0
  15. data/lib/e_plat/mapping/woocommerce/v_3/product/variant.rb +188 -0
  16. data/lib/e_plat/mapping/woocommerce/v_3/product.rb +168 -0
  17. data/lib/e_plat/mapping/woocommerce/v_3/script_tag.rb +22 -0
  18. data/lib/e_plat/mapping/woocommerce/v_3/shop.rb +142 -0
  19. data/lib/e_plat/mapping/woocommerce/v_3/webhook.rb +52 -0
  20. data/lib/e_plat/paginated/woocommerce_pagination.rb +45 -0
  21. data/lib/e_plat/resource/attribute_interface.rb +7 -4
  22. data/lib/e_plat/resource/base.rb +12 -3
  23. data/lib/e_plat/resource/collection.rb +19 -2
  24. data/lib/e_plat/resource/concerns/aliases.rb +14 -6
  25. data/lib/e_plat/resource/concerns/metafieldable.rb +31 -10
  26. data/lib/e_plat/resource/concerns/overwrite_instance_methods.rb +1 -1
  27. data/lib/e_plat/resource/concerns/overwrite_request_methods.rb +12 -1
  28. data/lib/e_plat/resource/countable.rb +7 -0
  29. data/lib/e_plat/resource/order.rb +5 -0
  30. data/lib/e_plat/resource/paginated/link_headers.rb +1 -1
  31. data/lib/e_plat/resource/platform_specific/woocommerce/metafield.rb +41 -0
  32. data/lib/e_plat/resource/platform_specific/woocommerce/order/billing_address.rb +8 -0
  33. data/lib/e_plat/resource/platform_specific/woocommerce/order/line_item.rb +2 -0
  34. data/lib/e_plat/resource/platform_specific/woocommerce/order/shipping_address.rb +8 -0
  35. data/lib/e_plat/resource/platform_specific/woocommerce/order/shipping_line.rb +2 -0
  36. data/lib/e_plat/resource/platform_specific/woocommerce/order.rb +8 -0
  37. data/lib/e_plat/resource/platform_specific/woocommerce/product/image.rb +8 -0
  38. data/lib/e_plat/resource/platform_specific/woocommerce/product/option.rb +8 -0
  39. data/lib/e_plat/resource/platform_specific/woocommerce/product/variant/option_value.rb +10 -0
  40. data/lib/e_plat/resource/platform_specific/woocommerce/product/variant.rb +53 -0
  41. data/lib/e_plat/resource/platform_specific/woocommerce/product.rb +75 -0
  42. data/lib/e_plat/resource/platform_specific/woocommerce/script_tag.rb +5 -0
  43. data/lib/e_plat/resource/platform_specific/woocommerce/shop.rb +36 -0
  44. data/lib/e_plat/resource/platform_specific/woocommerce/webhook.rb +8 -0
  45. data/lib/e_plat/resource/product/variant.rb +2 -0
  46. data/lib/e_plat/utils/money.rb +32 -0
  47. data/lib/e_plat/version.rb +1 -1
  48. data/lib/e_plat.rb +9 -3
  49. metadata +32 -2
data/README.md CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  <strong>EPlat <small>(E-commerce Platform)</small> </br></strong>
4
4
  A single interface for interacting with E-commerce platform APIs.
5
-
5
+ <br>
6
+ <p> supported platforms: </p>
7
+ <ul>
8
+ <li> Shopify </li>
9
+ <li> BigCommerce </li>
10
+ <li> WooCommerce </li>
11
+ </ul>
12
+ <br>
6
13
  Goals:
7
14
  <ul>
8
15
  <li>
@@ -43,6 +50,7 @@ You can configure which platform APIs are used by updating the EPlat config: <br
43
50
  #initializers/e_plat.rb
44
51
  EPlat.config.shopify_api_version = "2024-07"
45
52
  EPlat.config.bigcommerce_api_version = "v3"
53
+ EPlat.config.woocommerce_api_version = "v3"
46
54
 
47
55
  # EPlat.api_display_name.shopify #=> "2024-07" # presents as the platform would display in URL paths
48
56
  # EPlat.config.shopify_api_version #=> "2024_07" # coerced interally for creating constants
@@ -69,17 +77,19 @@ EPLAT_PRINT_GRAPHQL_REQUESTS=true rails test
69
77
 
70
78
  We have a guide on upgrading the gem to a new Shopify API version here: [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md)
71
79
 
80
+ <br>
81
+
72
82
  ### In the console ###
73
83
  You can run `rails c` then `Dotenv.load` to load the environment variables.
74
84
  You can then add to your .env file and run the following to setup your session:
75
- ```
85
+ ```ruby
76
86
  EPlat::Session.new(
77
87
  platform: :shopify,
78
88
  store_url: ENV["SHOPIFY_TEST_STORE_URL"],
79
89
  api_token: ENV["SHOPIFY_TEST_API_KEY"]
80
90
  )
81
91
 
82
- # or...
92
+ # or...
83
93
 
84
94
  EPlat::Session.new(
85
95
  platform: :bigcommerce,
@@ -87,6 +97,14 @@ You can then add to your .env file and run the following to setup your session:
87
97
  api_token: ENV["BIGCOMMERCE_TEST_API_KEY"],
88
98
  store_hash: ENV["BIGCOMMERCE_TEST_STORE_HASH"]
89
99
  )
100
+
101
+ # or...
102
+
103
+ EPlat::Session.new(
104
+ platform: :woocommerce,
105
+ store_url: ENV["WOOCOMMERCE_TEST_STORE_URL"],
106
+ api_token: ENV["WOOCOMMERCE_TEST_API_KEY"]
107
+ )
90
108
  ```
91
109
 
92
110
  <br>
@@ -144,7 +162,7 @@ EPlat is designed to let you mostly use it's universal interface, but then easil
144
162
 
145
163
  <ol>
146
164
  <li>
147
- Request/Resources follow this format: <strong>EPlat::ResourceName</strong>. Requests are called on the class, which then return an instance.
165
+ Request/Resources follow this format: <strong>EPlat::ResourceName</strong>. Requests are called on the class, which then return a plaform specific resource instance.
148
166
  </li>
149
167
  <li>
150
168
  EPlat resources will return their platform's native attributes, alongside a universal alias interface for viewing/editing via the EPlat schema.
@@ -158,7 +176,7 @@ EPlat is designed to let you mostly use it's universal interface, but then easil
158
176
  </li>
159
177
  <li>
160
178
  The EPlat alias interface is just a set of dynamically created getter/setter/predicate methods with types that control the native attributes of the resource.
161
- You can check if an attribute has been mapped by calling `resource.mapped? "attribute_name"`
179
+ You can check if an attribute has been mapped by calling `resource.mapped? 'attribute_name'`
162
180
  </li>
163
181
  </ul>
164
182
  </ol>
@@ -171,72 +189,75 @@ EPlat is designed to let you mostly use it's universal interface, but then easil
171
189
  <details>
172
190
  <summary>Shop</summary>
173
191
 
174
- ### EPlat::Shop
192
+ ### EPlat::Shop (read-only)
175
193
 
176
- | Alias | Type | Shopify | BigCommerce| Etc |
177
- | ------------------------------------ | --------- | ------- | -----------| ------------|
178
- | id | integer | * | nil | nil |
179
- | name | string | * | name | nil |
180
- | email | string | * | admin_email| nil |
181
- | domain | string | * | domain | nil |
182
- | province | string | * | nil | nil |
183
- | country | string | * | country | nil |
184
- | address1 | string | * | nil | nil |
185
- | zip | string | * | nil | nil |
186
- | city | string | * | nil | nil |
187
- | source | string | * | nil | nil |
188
- | phone | string | * | nil | nil |
189
- | latitude | float | * | nil | nil |
190
- | longitude | float | * | nil | nil |
191
- | primary_locale | string | * | nil | nil |
192
- | address2 | string | * | nil | nil |
193
- | created_at | datetime | * | nil | nil |
194
- | updated_at | datetime | * | nil | nil |
195
- | country_code | string | * | country_code | nil |
196
- | country_name | string | * | nil | nil |
197
- | currency | string | * | currency | nil |
198
- | customer_email | string | * | nil | nil |
199
- | timezone | string | * | nil | nil |
200
- | iana_timezone | string | * | nil | nil |
201
- | shop_owner | string | * | nil | nil |
202
- | money_format | string | * | nil | nil |
203
- | money_with_currency_format | string | * | nil | nil |
204
- | weight_unit | string | * | weight_units| nil |
205
- | province_code | string | * | nil | nil |
206
- | taxes_included | boolean | * | nil | nil |
207
- | auto_configure_tax_inclusivity | boolean | * | nil | nil |
208
- | tax_shipping | boolean | * | nil | nil |
209
- | county_taxes | boolean | * | nil | nil |
210
- | plan_display_name | string | * | nil | nil |
211
- | plan_name | string | * | plan_name | nil |
212
- | has_discounts | boolean | * | nil | nil |
213
- | has_gift_cards | boolean | * | nil | nil |
214
- | myshopify_domain | string | * | control_panel_base_url | nil |
215
- | google_apps_domain | string | * | nil | nil |
216
- | google_apps_login_enabled | boolean | * | nil | nil |
217
- | money_in_emails_format | string | * | nil | nil |
218
- | money_with_currency_in_emails_format | string | * | nil | nil |
219
- | eligible_for_payments | boolean | * | nil | nil |
220
- | requires_extra_payments_agreement | boolean | * | nil | nil |
221
- | password_enabled | boolean | * | nil | nil |
222
- | has_storefront | boolean | * | nil | nil |
223
- | eligible_for_card_reader_giveaway | boolean | * | nil | nil |
224
- | finances | boolean | * | nil | nil |
225
- | primary_location_id | integer | * | nil | nil |
226
- | cookie_consent_level | string | * | nil | nil |
227
- | visitor_tracking_consent_preference | string | * | nil | nil |
228
- | checkout_api_supported | boolean | * | nil | nil |
229
- | multi_location_enabled | boolean | * | nil | nil |
230
- | setup_required | boolean | * | nil | nil |
231
- | pre_launch_enabled | boolean | * | nil | nil |
232
- | enabled_presentment_currencies | array | * | nil | nil |
233
- | transactional_sms_disabled | boolean | * | nil | nil |
234
- | marketing_sms_consent_enabled_at_checkout | boolean | * | nil | nil |
235
-
236
- ```ruby
194
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
195
+ | -------------------------------------- | --------- | ------- | ----------------------| ---------------------------------- |
196
+ | id | integer | * | nil | nil |
197
+ | name | string | * | name | nil |
198
+ | email | string | * | admin_email | nil |
199
+ | domain | string | * | domain | `client.store_url` |
200
+ | province | string | * | nil | woocommerce_default_country['value'].split(":").second |
201
+ | country | string | * | country | woocommerce_default_country['value'].split(":").first |
202
+ | address1 | string | * | nil | woocommerce_store_address['value'] |
203
+ | zip | string | * | nil | woocommerce_store_postcode['value'] |
204
+ | city | string | * | nil | woocommerce_store_city['value'] |
205
+ | source | string | * | nil | nil |
206
+ | phone | string | * | nil | nil |
207
+ | latitude | float | * | nil | nil |
208
+ | longitude | float | * | nil | nil |
209
+ | primary_locale | string | * | nil | nil |
210
+ | address2 | string | * | nil | woocommerce_store_address_2['value'] |
211
+ | created_at | datetime | * | nil | nil |
212
+ | updated_at | datetime | * | nil | nil |
213
+ | country_code | string | * | country_code | woocommerce_default_country['value'].split(":").first |
214
+ | country_name | string | * | nil | nil |
215
+ | currency | string | * | currency | woocommerce_currency['default'] |
216
+ | customer_email | string | * | nil | nil |
217
+ | timezone | string | * | nil | nil |
218
+ | iana_timezone | string | * | nil | nil |
219
+ | shop_owner | string | * | nil | nil |
220
+ | money_format | string | * | nil | nil |
221
+ | money_with_currency_format | string | * | nil | nil |
222
+ | weight_unit | string | * | weight_units | *lazy: `/settings/products/woocommerce_weight_unit` ['value']|
223
+ | province_code | string | * | nil | nil |
224
+ | taxes_included | boolean | * | nil | nil |
225
+ | auto_configure_tax_inclusivity | boolean | * | nil | nil |
226
+ | tax_shipping | boolean | * | nil | nil |
227
+ | county_taxes | boolean | * | nil | nil |
228
+ | plan_display_name | string | * | nil | nil |
229
+ | plan_name | string | * | plan_name | nil |
230
+ | has_discounts | boolean | * | nil | nil |
231
+ | has_gift_cards | boolean | * | nil | nil |
232
+ | myshopify_domain | string | * | control_panel_base_url| nil |
233
+ | google_apps_domain | string | * | nil | nil |
234
+ | google_apps_login_enabled | boolean | * | nil | nil |
235
+ | money_in_emails_format | string | * | nil | nil |
236
+ | money_with_currency_in_emails_format | string | * | nil | nil |
237
+ | eligible_for_payments | boolean | * | nil | nil |
238
+ | requires_extra_payments_agreement | boolean | * | nil | nil |
239
+ | password_enabled | boolean | * | nil | nil |
240
+ | has_storefront | boolean | * | nil | true |
241
+ | eligible_for_card_reader_giveaway | boolean | * | nil | nil |
242
+ | finances | boolean | * | nil | nil |
243
+ | primary_location_id | integer | * | nil | nil |
244
+ | cookie_consent_level | string | * | nil | nil |
245
+ | visitor_tracking_consent_preference | string | * | nil | nil |
246
+ | checkout_api_supported | boolean | * | nil | nil |
247
+ | multi_location_enabled | boolean | * | nil | nil |
248
+ | setup_required | boolean | * | nil | nil |
249
+ | pre_launch_enabled | boolean | * | nil | nil |
250
+ | enabled_presentment_currencies | array | * | nil | nil |
251
+ | transactional_sms_disabled | boolean | * | nil | nil |
252
+ | marketing_sms_consent_enabled_at_checkout | boolean | * | nil | nil |
253
+
254
+ ```ruby
237
255
  # Bigcommerce translation. myshopify_domain is a permanent
238
256
  shop.myshopify_domain #"store-#{ store_hash }.mybigcommerce.com"
239
257
  shop.domain # custom_domain.com
258
+
259
+ # WooCommerce uses the `/settings/general` endpoint to get the shop details.
260
+ ¸*lazy: lazy request to `/settings/products/woocommerce_weight_unit` to get the weight unit.
240
261
  ```
241
262
 
242
263
  </details>
@@ -244,268 +265,291 @@ EPlat is designed to let you mostly use it's universal interface, but then easil
244
265
  <details>
245
266
  <summary>Product</summary>
246
267
 
268
+
247
269
  ### EPlat::Product
270
+ Prices in poundage strings i.e. $10.99 is represented as "10.99"
248
271
 
249
- | Alias | Type | Shopify | BigCommerce | Etc |
250
- | ------------------------ | -------- | ------- | -------------| ------------|
251
- | body_html | string | * | description | nil |
252
- | created_at | datetime | * | date_created | nil |
253
- | handle | string | * | name | nil |
254
- | id | integer | * | id | nil |
255
- | images | array | * | * | nil |
256
- | options | array | * | * | nil |
257
- | product_type | string | * | type | nil |
258
- | published_at | datetime | * | nil | nil |
259
- | status | string | * | availability | nil |
260
- | tags | string | * | nil | nil |
261
- | template_suffix | string | * | nil | nil |
262
- | title | string | * | name | nil |
263
- | updated_at | datetime | * | date_modified| nil |
264
- | variants | array | * | * | nil |
265
- | vendor | string | * | nil | nil |
272
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
273
+ | -------------- | -------- | ------- | ------------- | --------------------- |
274
+ | body_html | string | * | description | description |
275
+ | created_at | datetime | * | date_created | date_created |
276
+ | handle | string | * | name | slug |
277
+ | id | integer | * | id | id |
278
+ | images | array | * | * | images |
279
+ | options | array | * | * | attributes |
280
+ | product_type | string | * | type | nil |
281
+ | published_at | datetime | * | nil | date_created |
282
+ | status | string | * | availability | status |
283
+ | tags | string | * | nil | tags[*]['name'] |
284
+ | template_suffix| string | * | nil | nil |
285
+ | title | string | * | name | name |
286
+ | updated_at | datetime | * | date_modified | date_modified |
287
+ | variants | array | * | * | lazy loaded from `variations` IDs array |
288
+ | vendor | string image_src => String | * | nil | nil |
266
289
 
290
+ ```
291
+ * status enums maps to shopify values. e.g. Woo has tags of draft, pending, private and publish. Default is publish.
292
+ ** which maps to the shopify tag values of active, archived and draft
293
+ ```
267
294
 
268
295
  ### EPlat::Product::Variant
269
296
 
297
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
298
+ |----------------------|----------|------------------------------------------|------------------------------------|-----------------------------------|
299
+ | id | integer | * | id | id |
300
+ | title | string | * | option_values&.map(&:label)&.join(' ') | attributes.map(&:option).join(' ') |
301
+ | price | string | * | calculated_price | sale_price |
302
+ | sku | string | * | sku | sku |
303
+ | position | integer | * | nil | menu_order |
304
+ | inventory_policy | string | * | nil | backorders |
305
+ | compare_at_price | string | * | retail_price | regular_price |
306
+ | inventory_management | boolean | inventoryItem[tracked] | nil | nil |
307
+ | created_at | datetime | * | nil | date_created |
308
+ | updated_at | datetime | * | nil | date_modified |
309
+ | taxable | boolean | * | nil | tax_status == "taxable" |
310
+ | barcode | string | * | nil | nil |
311
+ | grams | integer | inventoryItem[measurement][weight][value] | nil | nil |
312
+ | weight | float | node.inventoryItem[measurement][weight][value] | weight | weight |
313
+ | weight_unit | string | node.inventoryItem[measurement][weight][unit] | nil | nil |
314
+ | inventory_item_id | integer | node.inventoryItem[id] | nil | nil |
315
+ | inventory_quantity | integer | node.inventoryQuantity | inventory_level | stock_quantity |
316
+ | tax_code | string | * | nil | tax_class |
317
+ | requires_shipping | boolean | InventoryItem[requiresShipping] | nil | !virtual |
318
+ | option_values | array | * | * | *generated |
270
319
 
271
- | Alias | Type | Shopify | BigCommerce | Etc |
272
- |-----------------------|----------|---------|--------------------------------------|-----|
273
- | id | integer | * | id | nil |
274
- | title | string | * | option_values&.map(&:label)&.join(' ') | nil |
275
- | price | string | * | calculated_price | nil |
276
- | sku | string | * | sku | nil |
277
- | position | integer | * | nil | nil |
278
- | inventory_policy | string | * | nil | nil |
279
- | compare_at_price | string | * | retail_price | nil |
280
- | inventory_management | boolean | inventoryItem[tracked] | nil | nil |
281
- | created_at | datetime | * | nil | nil |
282
- | updated_at | datetime | * | nil | nil |
283
- | taxable | boolean | * | nil | nil |
284
- | barcode | string | * | nil | nil |
285
- | grams | integer | getter only: converted node.inventoryItem[measurement][weight][value] | nil | nil |
286
- | weight | float | getter only: node.inventoryItem[measurement][weight][value] | weight |
287
- | weight_unit | string | getter only: node.inventoryItem[measurement][weight][unit] | nil |
288
- | inventory_item_id | integer | getter only: node.inventoryItem[id]| nil | nil |
289
- | inventory_quantity | integer | getter only: node.inventoryQuantity | inventory_level | nil |
290
- | tax_code | string | * | nil | nil |
291
- | requires_shipping | boolean | InventoryItem[requiresShipping] | nil | nil |
320
+ ```
321
+ * Bigcommerce variant.title= and variant.price= setters are not supported. They're a result of the option values instead.
322
+ * WooCommerce variant.title= setter is not supported. It's result of the option values instead.
323
+ ** WooCommerce calls variants 'variations', EPlat refers to them as variants.
324
+ *** It's possible for Woo products to have 0 variants, in this situation we generate a virtual one.
325
+ ```
292
326
 
293
327
  helper methods: <br>
294
- `image_src` => `String | nil`, platforms supported: Shopify, Bigcommerce
295
-
296
- *Bigcommerce variant.title= and variant.price= setters are not supported
297
-
298
-
299
- ### EPlat::Product::Option
328
+ `variant.image_src` => `String | nil` get a variant's specific image
300
329
 
301
- | Alias | Type | Shopify | BigCommerce | Etc |
302
- | ---------- | -------- | ------- | ---------------------------- | --- |
303
- | id | integer | * | id | nil |
304
- | name | string | * | display_name | nil |
305
- | position | integer | * | sort_order | nil |
306
- | values | array | * | option_values[i][label] | nil |
330
+ ### EPlat::Product::Option
307
331
 
332
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
333
+ |----------|----------|---------|------------------------------|-----------------------------------|
334
+ | id | integer | * | id | attributes[i][id] |
335
+ | name | string | * | display_name | attributes[i][name] |
336
+ | position | integer | * | sort_order | attributes[i][position] |
337
+ | values | array | * | option_values[i][label] | attributes[i][options] |
308
338
 
309
- ### EPlat::Product::Image
310
-
311
- | Alias | Type | Shopify | BigCommerce | Etc |
312
- | -------------------- | -------- | ------- | ----------- | ------------|
313
- | id | integer | * | id | nil |
314
- | position | integer | * | nil | nil |
315
- | alt | string | * | nil | nil |
316
- | width | integer | * | nil | nil |
317
- | height | integer | * | nil | nil |
318
- | src | string | * | url_standard | nil |
319
-
320
-
321
- ### EPlat::Product::Variant::OptionValue
322
- (not supported for Shopify API v2024_01)
323
-
324
- | Alias | Type | Shopify | BigCommerce | Etc |
325
- | -------------------- | -------- | ------------------------------------------ | ------------------ | --- |
326
- | id | integer | [selected_options][option_value][id] | id | nil |
327
- | name | string | [selected_options][name] | option_display_name| nil |
328
- | value | string | [selected_options][value] | label | nil |
329
- </details>
339
+ * We use WooCommerce `product.attributes` for product `options`. They vary from variant.attributes as they have an `options` attribute that contains all possible option values.
330
340
 
341
+ ### EPlat::Product::Image
342
+
343
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
344
+ |----------|----------|---------|-------------|-----------------|
345
+ | id | integer | * | id | id |
346
+ | position | integer | * | nil | nil |
347
+ | alt | string | * | nil | alt |
348
+ | width | integer | * | nil | nil |
349
+ | height | integer | * | nil | nil |
350
+ | src | string | * | url_standard| src |
351
+
352
+
353
+ ### EPlat::Product::Variant::OptionValue
354
+ (not supported for Shopify API v2024_01)
355
+
356
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
357
+ |-------|----------|------------------------------------------|---------------------|----------------------------------------------|
358
+ | id | integer | [selected_options][option_value][id] | id | attributes[i][id] |
359
+ | name | string | [selected_options][name] | option_display_name | attributes[i][name] |
360
+ | value | string | [selected_options][value] | label | attributes[i][option] |
361
+
362
+ * We use WooCommerce variant `attributes`, `variant.attributes` have an `option` attribute (as opposed to the `options` attribute of `product.attributes`)
363
+
364
+
365
+ </details>
331
366
  <details>
332
367
  <summary>Order</summary>
333
368
 
334
- ### EPlat::Order
335
-
336
- | attribute_name | type | Shopify | BigCommerce | Etc |
337
- |--------------------------------------|----------|---------|-------------|-------------|
338
- | id | integer | * | id | nil |
339
- | app_id | integer | * | nil | nil |
340
- | billing_address_address1 | string | * | nil | nil |
341
- | billing_address_address2 | string | * | nil | nil |
342
- | billing_address_city | string | * | nil | nil |
343
- | billing_address_company | string | * | nil | nil |
344
- | billing_address_country | string | * | nil | nil |
345
- | billing_address_first_name | string | * | nil | nil |
346
- | billing_address_last_name | string | * | nil | nil |
347
- | billing_address_phone | string | * | nil | nil |
348
- | billing_address_province | string | * | nil | nil |
349
- | billing_address_zip | string | * | nil | nil |
350
- | billing_address_name | string | * | nil | nil |
351
- | billing_address_province_code | string | * | nil | nil |
352
- | billing_address_country_code | string | * | nil | nil |
353
- | billing_address_latitude | string | * | nil | nil |
354
- | billing_address_longitude | string | * | nil | nil |
355
- | browser_ip | string | * | nil | nil |
356
- | buyer_accepts_marketing | boolean | * | nil | nil |
357
- | cancel_reason | string | * | nil | nil |
358
- | cancelled_at | datetime | * | nil | nil |
359
- | cart_token | string | * | nil | nil |
360
- | checkout_token | string | * | nil | nil |
361
- | client_details | hash | * | nil | nil |
362
- | closed_at | datetime | * | nil | nil |
363
- | created_at | datetime | * | date_created | nil |
364
- | currency | string | * | currency_code | nil |
365
- | current_total_discounts | string | * | discount_amount | nil |
366
- | current_total_discounts_set | hash | * | nil | nil |
367
- | current_total_duties_set | hash | * | nil | nil |
368
- | current_total_price | string | * | nil | nil |
369
- | current_total_price_set | hash | * | nil | nil |
370
- | current_subtotal_price | string | * | nil | nil |
371
- | current_subtotal_price_set | hash | * | nil | nil |
372
- | current_total_tax | string | * | nil | nil |
373
- | current_total_tax_set | hash | * | nil | nil |
374
- | customer_locale | string | * | customer_locale | nil |
375
- | device_id | integer | * | nil | nil |
376
- | discount_codes | array | * | nil | nil |
377
- | email | string | * | billing_address[email]| nil |
378
- | estimated_taxes | boolean | * | nil | nil |
379
- | financial_status | string | * | status_id | nil |
380
- | fulfillment_status | string | * | nil | nil |
381
- | gateway | string | * | nil | nil |
382
- | landing_site | string | * | nil | nil |
383
- | landing_site_ref | string | * | nil | nil |
384
- | location_id | integer | * | nil | nil |
385
- | merchant_of_record_app_id | integer | * | nil | nil |
386
- | name | string | * | nil | nil |
387
- | note | string | * | staff_notes | nil |
388
- | note_attributes | array | * | nil | nil |
389
- | number | integer | * | nil | nil |
390
- | order_number | integer | * | id | nil |
391
- | order_status_url | string | * | nil | nil |
392
- | original_total_duties_set | hash | * | nil | nil |
393
- | payment_gateway_names | array | * | nil | nil |
394
- | phone | string | * | nil | nil |
395
- | presentment_currency | string | * | nil | nil |
396
- | processed_at | string | * | nil | nil |
397
- | processing_method | string | * | nil | nil |
398
- | reference | string | * | nil | nil |
399
- | referring_site | string | * | nil | nil |
400
- | source_identifier | string | * | nil | nil |
401
- | source_name | string | * | nil | nil |
402
- | source_url | string | * | nil | nil |
403
- | subtotal_price | string | * | subtotal_ex_tax | nil |
404
- | subtotal_price_set | hash | * | nil | nil |
405
- | tags | string | * | nil | nil |
406
- | tax_lines | array | * | nil | nil |
407
- | taxes_included | boolean | * | nil | nil |
408
- | test | boolean | * | nil | nil |
409
- | token | string | * | nil | nil |
410
- | total_discounts | string | * | nil | nil |
411
- | total_discounts_set | hash | * | nil | nil |
412
- | total_line_items_price | string | * | nil | nil |
413
- | total_line_items_price_set | hash | * | nil | nil |
414
- | total_outstanding | string | * | nil | nil |
415
- | total_price | string | * | total_inc_tax | nil |
416
- | total_price_set | hash | * | nil | nil |
417
- | total_shipping_price_set | hash | * | nil | nil |
418
- | total_tax | string | * | total_tax | nil |
419
- | total_tax_set | hash | * | nil | nil |
420
- | total_tip_received | string | * | nil | nil |
421
- | total_weight | integer | * | nil | nil |
422
- | updated_at | datetime | * | date_modified | nil |
423
- | billing_address | hash | * | billing_address | nil |
424
- | customer | hash | * | nil | nil |
425
- | discount_applications | array | * | nil | nil |
426
- | fulfillments | array | * | nil | nil |
427
- | line_items | array | * | nil | nil |
428
- | payment_details | hash | * | nil | nil |
429
- | payment_terms | hash | * | nil | nil |
430
- | refunds | array | * | nil | nil |
431
- | shipping_address | hash | * | nil | nil |
432
- | shipping_lines | array | * | nil | nil |
369
+ ### EPlat::Order
370
+
371
+ | attribute_name | type | Shopify | BigCommerce | WooCommerce |
372
+ |--------------------------------------|----------|---------|---------------------------|-----------------------------------|
373
+ | id | integer | * | id | id |
374
+ | app_id | integer | * | nil | nil |
375
+ | browser_ip | string | * | nil | customer_ip_address |
376
+ | buyer_accepts_marketing | boolean | * | nil | nil |
377
+ | cancel_reason | string | * | nil | nil |
378
+ | cancelled_at | datetime | * | nil | nil |
379
+ | cart_token | string | * | nil | cart_hash |
380
+ | checkout_token | string | * | nil | nil |
381
+ | client_details | hash | * | nil | nil |
382
+ | closed_at | datetime | * | nil | date_completed |
383
+ | created_at | datetime | * | date_created | date_created |
384
+ | currency | string | * | currency_code | currency |
385
+ | current_total_discounts | string | * | discount_amount | discount_total |
386
+ | current_total_discounts_set | hash | * | nil | nil |
387
+ | current_total_duties_set | hash | * | nil | nil |
388
+ | current_total_price | string | * | nil | nil |
389
+ | current_total_price_set | hash | * | nil | nil |
390
+ | current_subtotal_price | string | * | nil | nil |
391
+ | current_subtotal_price_set | hash | * | nil | nil |
392
+ | current_total_tax | string | * | nil | total_tax |
393
+ | current_total_tax_set | hash | * | nil | nil |
394
+ | customer_locale | string | * | customer_locale | nil |
395
+ | device_id | integer | * | nil | nil |
396
+ | discount_codes | array | * | nil | coupon_lines.map(&:code) |
397
+ | email | string | * | billing_address[email] | billing[email] |
398
+ | estimated_taxes | boolean | * | nil | nil |
399
+ | financial_status | string | * | status_id | status |
400
+ | fulfillment_status | string | * | nil | status |
401
+ | gateway | string | * | nil | nil |
402
+ | landing_site | string | * | nil | nil |
403
+ | landing_site_ref | string | * | nil | nil |
404
+ | location_id | integer | * | nil | nil |
405
+ | merchant_of_record_app_id | integer | * | nil | nil |
406
+ | name | string | * | nil | number |
407
+ | note | string | * | staff_notes | customer_note |
408
+ | note_attributes | array | * | nil | nil |
409
+ | number | integer | * | nil | number |
410
+ | order_number | integer | * | id | number |
411
+ | order_status_url | string | * | nil | nil |
412
+ | original_total_duties_set | hash | * | nil | nil |
413
+ | payment_gateway_names | array | * | nil | nil |
414
+ | phone | string | * | nil | billing[phone] |
415
+ | presentment_currency | string | * | nil | currency |
416
+ | processed_at | string | * | nil | date_paid |
417
+ | processing_method | string | * | nil | payment_method |
418
+ | reference | string | * | nil | order_key |
419
+ | referring_site | string | * | nil | nil |
420
+ | source_identifier | string | * | nil | nil |
421
+ | source_name | string | * | nil | created_via |
422
+ | source_url | string | * | nil | nil |
423
+ | subtotal_price | string | * | subtotal_ex_tax | nil |
424
+ | subtotal_price_set | hash | * | nil | nil |
425
+ | tags | string | * | nil | nil |
426
+ | tax_lines | array | * | nil | tax_lines |
427
+ | taxes_included | boolean | * | nil | nil |
428
+ | test | boolean | * | nil | nil |
429
+ | token | string | * | nil | nil |
430
+ | total_discounts | string | * | nil | discount_total |
431
+ | total_discounts_set | hash | * | nil | nil |
432
+ | total_line_items_price | string | * | nil | nil |
433
+ | total_line_items_price_set | hash | * | nil | nil |
434
+ | total_outstanding | string | * | nil | nil |
435
+ | total_price | string | * | total_inc_tax | total |
436
+ | total_price_set | hash | * | nil | nil |
437
+ | total_shipping_price_set | hash | * | nil | nil |
438
+ | total_tax | string | * | total_tax | total_tax |
439
+ | total_tax_set | hash | * | nil | nil |
440
+ | total_tip_received | string | * | nil | nil |
441
+ | total_weight | integer | * | nil | nil |
442
+ | updated_at | datetime | * | date_modified | date_modified |
443
+ | billing_address | hash | * | billing_address | billing |
444
+ | customer | hash | * | nil | nil |
445
+ | discount_applications | array | * | nil | nil |
446
+ | fulfillments | array | * | nil | nil |
447
+ | line_items | array | * | nil | line_items |
448
+ | payment_details | hash | * | nil | nil |
449
+ | payment_terms | hash | * | nil | nil |
450
+ | refunds | array | * | nil | nil |
451
+ | shipping_address | hash | * | nil | shipping |
452
+ | shipping_lines | array | * | nil | shipping_lines |
453
+
433
454
 
434
455
  ### EPlat::Order::ShippingAddress
435
456
 
436
- | Alias | Type | Shopify | BigCommerce | Etc |
457
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
437
458
  |---------------|---------|---------|-------------|-------------|
438
- | address1 | string | * | street_1 | nil |
439
- | address2 | string | * | street_2 | nil |
440
- | city | string | * | city | nil |
441
- | company | string | * | company | nil |
442
- | country | string | * | country | nil |
443
- | first_name | string | * | first_name | nil |
444
- | last_name | string | * | last_name | nil |
459
+ | address1 | string | * | street_1 | address_1 |
460
+ | address2 | string | * | street_2 | address_2 |
461
+ | city | string | * | city | city |
462
+ | company | string | * | company | company |
463
+ | country | string | * | country | country |
464
+ | first_name | string | * | first_name | first_name |
465
+ | last_name | string | * | last_name | last_name |
445
466
  | phone | string | * | phone | nil |
446
- | province | string | * | state | nil |
447
- | zip | string | * | zip | nil |
448
- | country_code | string | * | country_iso2| nil |
449
- | province_code | string | * | nil | nil |
467
+ | province | string | * | state | state |
468
+ | zip | string | * | zip | postcode |
469
+ | country_code | string | * | country_iso2| country |
470
+ | province_code | string | * | nil | state |
450
471
  | latitude | float | * | nil | nil |
451
472
  | longitude | float | * | nil | nil |
473
+ | name | string | * | nil | custom |
452
474
 
453
475
 
454
476
  ### EPlat::Order::BillingAddress
455
477
 
456
- | Alias | Type | Shopify | BigCommerce | Etc |
478
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
457
479
  |---------------|---------|---------|-------------|-------------|
458
- | address1 | string | * | street_1 | nil |
459
- | address2 | string | * | street_2 | nil |
460
- | city | string | * | city | nil |
461
- | company | string | * | company | nil |
462
- | country | string | * | country | nil |
463
- | first_name | string | * | first_name | nil |
464
- | last_name | string | * | last_name | nil |
465
- | phone | string | * | phone | nil |
466
- | province | string | * | state | nil |
467
- | zip | string | * | zip | nil |
468
- | country_code | string | * | country_iso2| nil |
469
- | province_code | string | * | nil | nil |
480
+ | address1 | string | * | street_1 | address_1 |
481
+ | address2 | string | * | street_2 | address_2 |
482
+ | city | string | * | city | city |
483
+ | company | string | * | company | company |
484
+ | country | string | * | country | country |
485
+ | first_name | string | * | first_name | first_name |
486
+ | last_name | string | * | last_name | last_name |
487
+ | phone | string | * | phone | phone |
488
+ | province | string | * | state | state |
489
+ | zip | string | * | zip | postcode |
490
+ | country_code | string | * | country_iso2| country |
491
+ | province_code | string | * | nil | state |
470
492
  | latitude | float | * | nil | nil |
471
493
  | longitude | float | * | nil | nil |
494
+ | name | string | * | nil | custom |
495
+ | email | string | * | nil | email |
472
496
 
473
497
 
474
498
  ### EPlat::Order::LineItem
475
499
 
476
- | Attribute | Type | Shopify | BigCommerce | Etc |
477
- |-------------------------------|---------|---------|-------------|------|
478
- | id | integer | * | order[consignments][0][shipping][0][line_items][#{i}][id] | nil |
479
- | admin_graphql_api_id | string | * | nil | nil |
480
- | fulfillable_quantity | integer | * | nil | nil |
481
- | fulfillment_service | string | * | nil | nil |
482
- | fulfillment_status | string | * | nil | nil |
483
- | gift_card | boolean | * | nil | nil |
484
- | grams | integer | * | nil | nil |
485
- | name | string | * | order[consignments][0][shipping][0][line_items][#{i}][name] | nil |
486
- | price | string | * | order[consignments][0][shipping][0][line_items][#{i}][price] | nil |
487
- | price_set | hash | * | nil | nil |
488
- | product_exists | boolean | * | nil | nil |
489
- | product_id | integer | * | order[consignments][0][shipping][0][line_items][#{i}][product_id] | nil |
490
- | properties | array | * | nil | nil |
491
- | quantity | integer | * | order[consignments][0][shipping][0][line_items][#{i}][quantity] | nil |
492
- | current_quantity | integer | * | order[consignments][0][shipping][0][line_items][#{i}][quantity] | nil |
493
- | requires_shipping | boolean | * | nil | nil |
494
- | sku | string | * | order[consignments][0][shipping][0][line_items][#{i}][sku] | nil |
495
- | taxable | boolean | * | nil | nil |
496
- | title | string | * | nil | nil |
497
- | total_discount | string | * | nil | nil |
498
- | total_discount_set | hash | * | nil | nil |
499
- | variant_id | integer | * | order[consignments][0][shipping][0][line_items][#{i}][variant_id] | nil |
500
- | variant_inventory_management | string | * | nil | nil |
501
- | variant_title | string | * | nil | nil |
502
- | vendor | string | * | nil | nil |
503
- | tax_lines | array | * | nil | nil |
504
- | duties | array | * | nil | nil |
505
- | discount_allocations | array | * | nil | nil |
500
+ | Attribute | Type | Shopify | BigCommerce | WooCommerce |
501
+ |-------------------------------|---------|---------|-------------|-------------|
502
+ | id | integer | * | order[consignments][0][shipping][0][line_items][#{i}][id] | id |
503
+ | admin_graphql_api_id | string | * | nil | nil |
504
+ | fulfillable_quantity | integer | * | nil | quantity |
505
+ | fulfillment_service | string | * | nil | nil |
506
+ | fulfillment_status | string | * | nil | nil |
507
+ | gift_card | boolean | * | nil | false |
508
+ | grams | integer | * | nil | nil |
509
+ | name | string | * | order[consignments][0][shipping][0][line_items][#{i}][name] | name |
510
+ | price | string | * | order[consignments][0][shipping][0][line_items][#{i}][price] | price |
511
+ | price_set | hash | * | nil | nil |
512
+ | product_exists | boolean | * | nil | nil |
513
+ | product_id | integer | * | order[consignments][0][shipping][0][line_items][#{i}][product_id] | product_id |
514
+ | properties | array | * | nil | meta_data |
515
+ | quantity | integer | * | order[consignments][0][shipping][0][line_items][#{i}][quantity] | quantity |
516
+ | current_quantity | integer | * | order[consignments][0][shipping][0][line_items][#{i}][quantity] | quantity |
517
+ | requires_shipping | boolean | * | nil | true |
518
+ | sku | string | * | order[consignments][0][shipping][0][line_items][#{i}][sku] | sku |
519
+ | taxable | boolean | * | nil | tax_class present |
520
+ | title | string | * | nil | name |
521
+ | total_discount | string | * | nil | nil |
522
+ | total_discount_set | hash | * | nil | nil |
523
+ | variant_id | integer | * | order[consignments][0][shipping][0][line_items][#{i}][variant_id] | variation_id |
524
+ | variant_inventory_management | string | * | nil | nil |
525
+ | variant_title | string | * | nil | nil |
526
+ | vendor | string | * | nil | nil |
527
+ | tax_lines | array | * | nil | taxes |
528
+ | duties | array | * | nil | nil |
529
+ | discount_allocations | array | * | nil | nil |
506
530
 
507
531
  *line_item uses a virtual collection for BigCommerce, this allows us to present with the correct nesting position, whilst updating the native much deeper nested set below
508
532
 
533
+
534
+ ### EPlat::Order::ShippingLine
535
+
536
+ | Attribute | Type | Shopify | BigCommerce | WooCommerce |
537
+ |-------------------------------|---------|---------|-------------|-------------|
538
+ | id | integer | * | nil | id |
539
+ | carrier_identifier | string | * | nil | method_id |
540
+ | code | string | * | nil | method_id |
541
+ | delivery_category | string | * | nil | nil |
542
+ | discounted_price | string | * | nil | total |
543
+ | discounted_price_set | hash | * | nil | nil |
544
+ | phone | string | * | nil | nil |
545
+ | price | string | * | nil | total |
546
+ | price_set | hash | * | nil | nil |
547
+ | requested_fulfillment_service_id | integer | * | nil | nil |
548
+ | source | string | * | nil | nil|
549
+ | title | string | * | nil | method_title |
550
+ | tax_lines | array | * | nil | taxes |
551
+ | discount_allocations | array | * | nil | nil |
552
+
509
553
  </details>
510
554
 
511
555
 
@@ -516,17 +560,17 @@ helper methods: <br>
516
560
 
517
561
  ### EPlat::Metafield
518
562
 
519
- | Alias | Type | Shopify | BigCommerce | Etc |
520
- |-----------------|----------|----------------|----------------|-----|
563
+ | Alias | Type | Shopify | BigCommerce | WooCommerce |
564
+ |-----------------|----------|----------------|----------------|-------------|
521
565
  | created_at | datetime | * | date_created | nil |
522
- | description | string | * | description | nil |
523
- | id | integer | * | id | nil |
524
- | key | string | * | key | nil |
525
- | namespace | string | * | namespace | nil |
566
+ | description | string | * | description | nil |
567
+ | id | integer | * | id | id |
568
+ | key | string | * | key | key |
569
+ | namespace | string | * | namespace | nil |
526
570
  | owner_id | integer | * | resource_id | nil |
527
571
  | owner_resource | string | * | resource_type | nil |
528
572
  | updated_at | datetime | * | date_modified | nil |
529
- | value | string | * | value | nil |
573
+ | value | string | * | value | value |
530
574
  | type | string | * | nil | nil |
531
575
 
532
576
  *Note: Bigcommerce always assumes a type of String and a native attribute permission_set of "read_and_sf_access"
@@ -538,20 +582,22 @@ helper methods: <br>
538
582
 
539
583
  ### EPlat::ScriptTag
540
584
 
541
- | Alias | Type | Shopify | BigCommerce | Etc |
585
+ | Alias | Type | Shopify | BigCommerce | Woo |
542
586
  |---------------|----------------|---------------|--------------------|-------------------|
543
- | id | integer/string | id | uuid | |
544
- | src | string | src | src | |
545
- | created_at | datetime | created_at | date_created | |
546
- | updated_at | datetime | updated_at | date_modified | |
547
- | display_scope | string | display_scope | visibility | |
548
- | event | string | event | nil | |
549
- | cache | boolean | cache | nil | |
587
+ | id | integer/string | id | uuid | nil |
588
+ | src | string | src | src | nil |
589
+ | created_at | datetime | created_at | date_created | nil |
590
+ | updated_at | datetime | updated_at | date_modified | nil |
591
+ | display_scope | string | display_scope | visibility | nil |
592
+ | event | string | event | nil | nil |
593
+ | cache | boolean | cache | nil | nil |
550
594
 
551
595
  *display_scope available options: `online_store`, `order_status`, `all`
552
-
596
+ <br>
553
597
  **Bigcommerce has some native attribute defaults set, which can be overwritten if needed:
554
598
  `location: "head"`, `auto_uninstall: true`, `kind: "src"`, `load_method: "async"`, `name: "app-script"`, `enabled: true`
599
+ <br>
600
+ **WooCommerce doesn't have a script tag API, instead use the `wp_enqueue_scripts` [Wordpress hook](https://developer.wordpress.org/reference/hooks/wp_enqueue_scripts/).
555
601
 
556
602
 
557
603
  </details>
@@ -561,23 +607,25 @@ helper methods: <br>
561
607
 
562
608
  ### EPlat::Webhook
563
609
 
564
- | Alias | Type | Shopify | BigCommerce | Etc |
610
+ | Alias | Type | Shopify | BigCommerce | Woo |
565
611
  |-------------------------------|--------------|------------------------------|----------------------|-----|
566
- | address | string | address | destination | |
567
- | api_version | string | api_version | nil | |
568
- | created_at | datetime/Int | created_at | created_at | |
569
- | fields | array | fields | nil | |
570
- | format | string | format | nil | |
571
- | id | integer | id | id | |
572
- | metafield_namespaces | array | metafield_namespaces | nil | |
573
- | private_metafield_namespaces | array | private_metafield_namespaces | nil | |
574
- | topic | string | topic | scope | |
575
- | updated_at | datetime/Int | updated_at | updated_at | |
612
+ | address | string | address | destination | delivery_url |
613
+ | api_version | string | api_version | nil | nil |
614
+ | created_at | datetime/Int | created_at | created_at | date_created_gmt |
615
+ | fields | array | fields | nil | nil |
616
+ | format | string | format | nil | nil |
617
+ | id | integer | id | id | id |
618
+ | metafield_namespaces | array | metafield_namespaces | nil | nil |
619
+ | private_metafield_namespaces | array | private_metafield_namespaces | nil | nil |
620
+ | topic | string | topic | scope | topic |
621
+ | updated_at | datetime/Int | updated_at | updated_at | date_modified_gmt |
576
622
 
577
623
  *EPlat doesn't make any attemps to alias the varias topic/scope values between platforms.
624
+ <br>
578
625
  **Notice that BigCommerce uses updated_at and created_at for this resource.
579
626
  Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion so just tread carefully.
580
627
 
628
+
581
629
  </details>
582
630
 
583
631
 
@@ -591,24 +639,24 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
591
639
  <details>
592
640
  <summary> Base / Config</summary>
593
641
 
594
- | Method | ShopifyAPI Gem equivalent | Shopify - tested | BigCom - tested
595
- | -------------------------------------------- | ------------------------- | ----------------- | ------------------ |
596
- | EPlat::Session.new() | ::Session.new | * | * |
597
- | EPlat::Session.new() | ::Base.activate_session | * | * |
598
- | EPlat::Session.new() | ::Session.setup() | * | * |
642
+ | Method | ShopifyAPI Gem equivalent | Shopify | BigCommerce | Woo |
643
+ | -------------------------------------------- | ------------------------- | ----------------- | ------------------ | ------------ |
644
+ | EPlat::Session.new() | ::Session.new | * | * | * |
645
+ | EPlat::Session.new() | ::Base.activate_session | * | * | * |
646
+ | EPlat::Session.new() | ::Session.setup() | * | * | * |
599
647
  | EPlat.config.values[:shopify_api_version] | ::Baseapi_version | * | |
600
648
  | EPlat.config.values[:bigcommerce_api_version] | ::Baseapi_version | | * |
601
-
649
+ | EPlat.config.values[:woocommerce_api_version] | ::Baseapi_version | | | * |
602
650
  </details>
603
651
 
604
652
 
605
653
  <details>
606
654
  <summary> Shop</summary>
607
655
 
608
- | Method | Shopify - tested | BigCom - tested | Etc |
656
+ | Method | Shopify | BigCommerce | Woo |
609
657
  | ----------------------------- | ----------------- | ----------------- | ------ |
610
- | ::Shop.current | * | * | |
611
- | shop.attribute | * | * | |
658
+ | ::Shop.current | * | * | * |
659
+ | shop.attribute | * | * | * |
612
660
 
613
661
  </details>
614
662
 
@@ -616,30 +664,30 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
616
664
  <details>
617
665
  <summary> Product</summary>
618
666
 
619
- | Method | Shopify - tested | BigCom - tested | Etc |
667
+ | Method | Shopify | BigCommerce | Woo |
620
668
  | ----------------------------- | ----------------- | ----------------- | ------ |
621
- | ::Product.last | * | * | |
622
- | ::Product.all | * | * | |
623
- | ::Product.attribute | * | * | |
624
- | ::Product.find(id) | * | * | |
625
- | ::Product.where(attr: '') | * | * | |
626
- | ::Product.find_by(attr: '') | * | * | |
627
- | ::Product.create(attr:) | * | * | |
628
- | ::Product.save | * | * | |
629
- | .save saves nested resources | only variants | | |
630
- | ::Product.delete(id) | * | * | |
631
- | ::Product.count | * | * | |
632
- | product.dup | * | * | |
633
- | product.variants | * | * | |
634
- | product.load_all_variants | * | * | |
635
- | product.find_variant(id) | * | * | |
636
- | product.images | * | * | |
637
- | products.next_page? | * | * | |
638
- | products.previous_page? | * | * | |
639
- | products.fetch_next_page | * | * | |
640
- | products.fetch_previous_page | * | * | |
641
- | products.previous_page_info | * | * | |
642
- | products.next_page_info | * | * | |
669
+ | ::Product.last | * | * | * |
670
+ | ::Product.all | * | * | * |
671
+ | ::Product.attribute | * | * | * |
672
+ | ::Product.find(id) | * | * | * |
673
+ | ::Product.where(attr: '') | * | * | * |
674
+ | ::Product.find_by(attr: '') | * | * | * |
675
+ | ::Product.create(attr:) | * | * | * |
676
+ | ::Product.save | * | * | * |
677
+ | .save saves nested resources | only variants | No | No |
678
+ | ::Product.delete(id) | * | * | * |
679
+ | ::Product.count | * | * | * |
680
+ | product.dup | * | * | * |
681
+ | product.variants | * | * | * |
682
+ | product.load_all_variants | * | * | * |
683
+ | product.find_variant(id) | * | * | * |
684
+ | product.images | * | * | * |
685
+ | products.next_page? | * | * | * |
686
+ | products.previous_page? | * | * | * |
687
+ | products.fetch_next_page | * | * | * |
688
+ | products.fetch_previous_page | * | * | * |
689
+ | products.previous_page_info | * | * | * |
690
+ | products.next_page_info | * | * | * |
643
691
 
644
692
  ```ruby
645
693
  # The 2024 increased Shopify variants limit
@@ -664,17 +712,17 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
664
712
 
665
713
  ### Product::Variant
666
714
 
667
- | Method | Shopify - tested | BigCom - tested | Etc |
715
+ | Method | Shopify | BigCommerce | Woo |
668
716
  | ----------------------------- | ----------------- | ----------------- | ------ |
669
- | product.variants | * | * | |
670
- | product.find_variant | * | * | |
671
- | variants.attribute | * | * | |
672
- | variant.attributes.delete | * | * | |
673
- | variant.save | * | * | |
717
+ | product.variants | * | * | * |
718
+ | product.find_variant | * | * | * |
719
+ | variants.attribute | * | * | * |
720
+ | variant.attributes.delete | * | * | * |
721
+ | variant.save | * | * | * |
674
722
 
675
- * Nested resources currently need to be saved on their own instance. product.variants.first.save, as opposed to product.save
676
- * Also bear in mind that for platforms like BigCommerce, product and variant IDs are only unique within that store's context
677
- * so if storing these IDs locally, remember to query via the shop i.e. shop.listings.where(platform_product_id: 123)
723
+ * Nested resources currently need to be saved on their own instance. variant.save, as opposed to product.save
724
+ ** Also bear in mind that for platforms like BigCommerce, product and variant IDs are only unique within that store's context
725
+ *** so if storing these IDs locally, remember to query via the shop i.e. shop.listings.where(platform_product_id: 123)
678
726
 
679
727
  </details>
680
728
 
@@ -682,46 +730,47 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
682
730
  <details>
683
731
  <summary> Order</summary>
684
732
 
685
- | Method | Shopify - tested | BigCom - tested | Etc |
733
+ | Method | Shopify | BigCommerce | Woo |
686
734
  | ----------------------------- | ----------------- | ----------------- | ------ |
687
- | ::Order.last | * | * | |
688
- | ::Order.all | * | * | |
689
- | ::Order.attribute | * | * | |
690
- | ::Order.find(id) | * | * | |
691
- | ::Order.where(title: '') | * | * | |
692
- | ::Order.find_by(title: '') | * | * | |
693
- | ::Order.create(attr: '', ) | * | * | |
694
- | ::Order.new(attr: '', ) | * | * | |
695
- | ::Order.save | * | * | |
696
- | ::Order.count | * | * | |
697
- | order.cancel | * | * | |
698
- | orders.next_page? | * | nil | |
699
- | orders.previous_page? | * | nil | |
700
- | orders.fetch_next_page | * | nil | |
701
- | orders.fetch_previous_page | * | nil | |
702
-
703
- *included nested resources: can update non-resource nested hashes like shipping_address, but not proper resources like customer
704
-
735
+ | ::Order.last | * | * | * |
736
+ | ::Order.all | * | * | * |
737
+ | ::Order.attribute | * | * | * |
738
+ | ::Order.find(id) | * | * | * |
739
+ | ::Order.where(status: '') | * | * | * |
740
+ | ::Order.find_by(status: '') | * | * | * |
741
+ | ::Order.create(attr: '', ) | * | * | * |
742
+ | ::Order.new(attr: '', ) | * | * | * |
743
+ | ::Order.save | * | * | * |
744
+ | ::Order.count | * | * | * |
745
+ | order.cancel | * | * | * |
746
+ | orders.next_page? | * | nil | * |
747
+ | orders.previous_page? | * | nil | * |
748
+ | orders.fetch_next_page | * | nil | * |
749
+ | orders.fetch_previous_page | * | nil | * |
750
+
751
+ *included nested resources: can update non-resource nested hashes like shipping_address if marked as changed, but not proper resources like customer
752
+ ** Woo - Remember to call .compact on line_items when creating an order, as simple products will error via the variant_id:nil error.
705
753
  </details>
706
754
 
707
755
  <details>
708
756
  <summary> Metafield </summary>
709
757
 
710
- | Method | Shopify - tested | BigCom - tested | Etc |
758
+ | Method | Shopify | BigCommerce | WooCommerce - tested |
711
759
  | ----------------------------- | ----------------- | ----------------- | ------ |
712
- | product.metafields | * | * | |
713
- | order.metafields | * | * | |
714
- | product.find_metafield(id) | * | * | |
715
- | order.find_metafield(id) | * | * | |
716
- | order.find_metafield(id) | * | * | |
717
- | product.add_metafield(EPlat::Metafield.new {}) |* | * | |
718
- | order.add_metafield(EPlat::Metafield.new {}) |* | * | |
719
- | .attribute | * | * | |
720
- | .save | * | * | |
721
- | .destroy | * | * | |
722
- | ::Metafield.create(attr: '') | * | * | |
723
- | ::Metafield.new(attr: '') | * | * | |
724
-
760
+ | product.metafields | * | * | * |
761
+ | order.metafields | * | * | * |
762
+ | product.find_metafield(id) | * | * | * |
763
+ | order.find_metafield(id) | * | * | * |
764
+ | order.find_metafield(id) | * | * | * |
765
+ | product.add_metafield(EPlat::Metafield.new {}) |* | * | * |
766
+ | order.add_metafield(EPlat::Metafield.new {}) |* | * | * |
767
+ | .attribute | * | * | * |
768
+ | .save | * | * | * |
769
+ | .destroy | * | * | * |
770
+ | ::Metafield.create(attr: '') | * | * | nil |
771
+ | ::Metafield.new(attr: '') | * | * | * |
772
+
773
+ *Woo has to have a metafields added via a parent resource e.g order.add_metafield(EPlat::Metafield.new({...}))
725
774
 
726
775
  </details>
727
776
 
@@ -733,18 +782,20 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
733
782
  <details>
734
783
  <summary> ScriptTag</summary>
735
784
 
736
- | Method | Shopify - tested | BigCom - tested | Etc |
785
+ | Method | Shopify | BigCommerce | Woo |
737
786
  | -------------------------------- | ----------------- | ----------------- | ------ |
738
- | ::ScriptTag.new({}) | * | * | |
739
- | ::ScriptTag.create({}) | * | * | |
740
- | ::ScriptTag.last | * | * | |
741
- | ::ScriptTag.all | * | * | |
742
- | ::ScriptTag.find | * | * | |
743
- | .attribute | * | * | |
744
- | .save | * | * | |
745
- | .destroy | * | * | |
787
+ | ::ScriptTag.new({}) | * | * | nil |
788
+ | ::ScriptTag.create({}) | * | * | nil |
789
+ | ::ScriptTag.last | * | * | nil |
790
+ | ::ScriptTag.all | * | * | nil |
791
+ | ::ScriptTag.find | * | * | nil |
792
+ | .attribute | * | * | nil |
793
+ | .save | * | * | nil |
794
+ | .destroy | * | * | nil |
746
795
 
747
796
  *note that Bigcommerce uses UUID instead of ID for script tags. This should mostly be handled by EPlat, apart from when passing the value to .find
797
+ <br>
798
+ ** Woo doesn't have a script tag API, instead use the `wp_enqueue_scripts` [Wordpress hook](https://developer.wordpress.org/reference/hooks/wp_enqueue_scripts/).
748
799
 
749
800
  </details>
750
801
 
@@ -752,16 +803,19 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
752
803
  <summary> Webhook</summary>
753
804
 
754
805
 
755
- | Method | Shopify - tested | BigCom - tested | Etc |
806
+ | Method | Shopify | BigCommerce | Woo |
756
807
  | -------------------------------- | ----------------- | ----------------- | ------ |
757
- | ::Webhook.new({}) | * | * | |
758
- | ::Webhook.create({}) | * | * | |
759
- | ::Webhook.last | * | * | |
760
- | ::Webhook.all | * | * | |
761
- | ::Webhook.find | * | * | |
762
- | .attribute | * | * | |
763
- | .save | * | * | |
764
- | .destroy | * | * | |
808
+ | ::Webhook.new({}) | * | * | * |
809
+ | ::Webhook.create({}) | * | * | * |
810
+ | ::Webhook.last | * | * | * |
811
+ | ::Webhook.all | * | * | * |
812
+ | ::Webhook.find | * | * | * |
813
+ | .attribute | * | * | * |
814
+ | .save | * | * | * |
815
+ | .destroy | * | * | * |
816
+
817
+ <br>
818
+ **WooCommerce doesn't let you destroy webhooks, so calling .destroy will set the status to disabled.
765
819
 
766
820
  </details>
767
821
 
@@ -773,7 +827,7 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
773
827
 
774
828
  ### RecurringApplicationCharge
775
829
 
776
- | Method | Shopify - tested |
830
+ | Method | Shopify |
777
831
  | -------------------------------------- | ----------------- |
778
832
  | ::RecurringApplicationCharge.current | * |
779
833
  | ::RecurringApplicationCharge.new({}) | * |
@@ -793,7 +847,7 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
793
847
 
794
848
  ### RecurringApplicationCharge::UsageCharge
795
849
 
796
- | Method | Shopify - tested |
850
+ | Method | Shopify |
797
851
  | --------------------------------------------------------------------- | ----------------- |
798
852
  | ::UsageCharge.last(params: {recurring_application_charge: r.id}) | * |
799
853
  | ::UsageCharge.all(params: {recurring_application_charge: r.id}) | * |