e_plat 1.1.0.pre.rc.5 → 1.1.0.pre.rc.6
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae49d0be03b307f8982ec8ab83f200cf1a5b22159b7454ae3dee0e50a4fe4dde
|
4
|
+
data.tar.gz: 94acc2fcd262d76ad8ac02dfb355b330297472ec6d4b8355b2ce27bc18758ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40de991243c9611dc785ac2336043d211db3b0a35b5d2c87df2b457092d5601e84862e85980b0d2c8b42a21ed6267a57ca5b6c182e89c368817a982adb5ed707
|
7
|
+
data.tar.gz: 3ab713d5bca7758ae7c0c44abc2cea97fcdb85f696b381028d4d358a50bc702acc28e82a638bdd549b4568884e919970b11063784337383033c93e6e5ab70ba7
|
data/README.md
CHANGED
@@ -331,7 +331,7 @@ helper methods: <br>
|
|
331
331
|
|
332
332
|
| Alias | Type | Shopify | BigCommerce | WooCommerce |
|
333
333
|
|----------|----------|---------|------------------------------|-----------------------------------|
|
334
|
-
| id | integer | * | id |
|
334
|
+
| id | integer | * | id | name.downcase.hash.abs % 1000000 |
|
335
335
|
| name | string | * | display_name | attributes[i][name] |
|
336
336
|
| position | integer | * | sort_order | attributes[i][position] |
|
337
337
|
| values | array | * | option_values[i][label] | attributes[i][options] |
|
@@ -355,7 +355,7 @@ helper methods: <br>
|
|
355
355
|
|
356
356
|
| Alias | Type | Shopify | BigCommerce | WooCommerce |
|
357
357
|
|-------|----------|------------------------------------------|---------------------|----------------------------------------------|
|
358
|
-
| id | integer | [selected_options][option_value][id] | id |
|
358
|
+
| id | integer | [selected_options][option_value][id] | id | name.downcase.hash.abs % 1000000 |
|
359
359
|
| name | string | [selected_options][name] | option_display_name | attributes[i][name] |
|
360
360
|
| value | string | [selected_options][value] | label | attributes[i][option] |
|
361
361
|
|
@@ -16,6 +16,21 @@ module EPlat::Woocommerce
|
|
16
16
|
instance
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
def initialize(attributes = {}, persisted = false)
|
21
|
+
super
|
22
|
+
|
23
|
+
# Ensure option_values have stable IDs based on name
|
24
|
+
if self.option_values.present?
|
25
|
+
self.option_values.each do |option_value|
|
26
|
+
if (option_value.attributes["id"].nil? || option_value.attributes["id"] == 0) && option_value.name.present?
|
27
|
+
# Use the hash of the name (lowercase) as a consistent ID
|
28
|
+
# We're using the name here because it refers to the attribute name (like "Color", "Size")
|
29
|
+
option_value.attributes["id"] = option_value.name.downcase.hash.abs % 1000000
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
19
34
|
|
20
35
|
def save
|
21
36
|
if _is_virtual
|
@@ -2,6 +2,20 @@ module EPlat::Woocommerce
|
|
2
2
|
class Product < EPlat::Product
|
3
3
|
has_many :meta_data, class_name: "EPlat::Woocommerce::Metafield"
|
4
4
|
|
5
|
+
def initialize(attributes = {}, persisted = false)
|
6
|
+
super
|
7
|
+
|
8
|
+
# Ensure options have correct IDs based on name (more stable than position)
|
9
|
+
if self.options.present?
|
10
|
+
self.options.each do |option|
|
11
|
+
if (option.attributes["id"].nil? || option.attributes["id"] == 0) && option.name.present?
|
12
|
+
# Use the hash of the name (lowercase) as a consistent ID
|
13
|
+
option.attributes["id"] = option.name.downcase.hash.abs % 1000000
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
5
19
|
def lazy_load_variants
|
6
20
|
# Woo products natively just return an array of ids under the 'variations' key
|
7
21
|
@variants_collection ||= EPlat::Product::Variant.find(
|
data/lib/e_plat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: e_plat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.pre.rc.
|
4
|
+
version: 1.1.0.pre.rc.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oliwoodsuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|