solidus

https://github.com/solidusio/solidus

Ruby

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.

Spree::ReturnItem::ExchangeVariantEligibility::SameOptionValue.eligible_variants

This can be configured in an initializer, e.g.:
Spree::ReturnItem::ExchangeVariantEligibility::SameOptionValue.option_type_restrictions = ["size", "color"]

This restriction causes only variants that share the same option value for the
specified option types to be returned. e.g.:

option_type_restrictions = ["color", "waist"]
Variant: blue pants with 32 waist and 30 inseam

can be exchanged for:
blue pants with 32 waist and 31 inseam

cannot be exchanged for:
green pants with 32 waist and 30 inseam
blue pants with 34 waist and 32 inseam

Source | Google | Stack overflow

Edit

git clone [email protected]:solidusio/solidus.git

cd solidus

open core/app/models/spree/return_item/exchange_variant_eligibility/same_option_value.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Spree--ReturnItem--ExchangeVariantEligibility--SameOptionValue-eligible_variants-for-pr


# Commit to git

git add core/app/models/spree/return_item/exchange_variant_eligibility/same_option_value.rbgit commit -m "better docs for Spree::ReturnItem::ExchangeVariantEligibility::SameOptionValue.eligible_variants"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Spree--ReturnItem--ExchangeVariantEligibility--SameOptionValue-eligible_variants-for-pr

hub pull-request


# Celebrate!