Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make all glass bottles recyclable by default #7945

Merged
merged 6 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/ProductOpener/Packaging.pm
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,15 @@ sub apply_rules_to_augment_packaging_component_data ($product_ref, $packaging_re
$packaging_ref->{"shape"} = "en:coffee-capsule";
}

# If the shape is bottle and the material is glass, mark recycling as recycle
if ( (defined $packaging_ref->{"shape"})
and ($packaging_ref->{"shape"} eq "en:bottle")
and (defined $packaging_ref->{"material"})
and ($packaging_ref->{"material"} eq "en:glass"))
diivi marked this conversation as resolved.
Show resolved Hide resolved
diivi marked this conversation as resolved.
Show resolved Hide resolved
{
$packaging_ref->{"recycling"} = "en:recycle";
}
diivi marked this conversation as resolved.
Show resolved Hide resolved

# If we have a shape without a material, check if there is a default material for the shape
# e.g. "en:Bubble wrap" has the property packaging_materials:en: en:plastic
if ((defined $packaging_ref->{"shape"}) and (not defined $packaging_ref->{"material"})) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"packagings" : [
{
"material" : "en:glass",
"shape" : "en:bottle"
"shape" : "en:bottle",
"recycling" : "en:recycle"
}
]
}