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

Has many association of variants with prices #8678

Open
arjun289 opened this issue Apr 25, 2018 · 4 comments
Open

Has many association of variants with prices #8678

arjun289 opened this issue Apr 25, 2018 · 4 comments

Comments

@arjun289
Copy link

Context

I was looking at the spree code for the variants entity and found out that it has an association has_many with prices entity.
Ideally seeing this relationship makes me feel, this must have been provided so that
products/variants can have multiple prices in different currencies.

The gentlemen here feels the same
http://grokbase.com/t/gg/spree-user/135ef1d6s3/question-about-variant-has-many-prices

If you look at the solution to this query, it has been mentioned that the feature
products/variants can have multiple prices in different currencies wasn't the goal of this.

I just want to understand then, what's the motive behind keeping this ha_manyassociation between variants and prices?

Expected Behavior

Most of the e-commerce websites usually support only one currency and thus, each variant of a product has only one price.
So, shouldn't the association be has_one? If the answer is no, then what could be the possible reasons ?

@mdavo6
Copy link

mdavo6 commented Apr 28, 2018

Hi @arjun289

Your initial feeling is correct. Although the query you've provided doesn't mention it the has_many relationship is definitely used for multiple currencies - not directly in core spree but the spree_multi_currency gem makes full use of it - See https://github.com/spree-contrib/spree_multi_currency.

@arjun289
Copy link
Author

@mdavo6
Can you give me an example of a scenario where a store, will have a requirement for multiple currencies? As per my limited knowledge of e-commerce, most of the online stores usually operate only in one currency and they usually have a separate entity altogether for different currencies. e.g. amazon.in, amazon.co.uk, amazon.com.au etc.

@MatthewKennedy
Copy link
Contributor

I’m currently setting up a spree store now with multiple currencies all running on one domain.

I chose to use Spree specifically because spree can handle multiple languages and multiple currencies all in one instance.

I was sick of the SEO and content updating nightmare of having multiple stores for multiple currencies.

I also have an existing Spree store set up using sub domains for each currency, again all handled from one Spree admin with the multiple domain plugin, either way the multiple currencies setup that Spree uses is a super powerful feature.

You can create one SKU and give it many different currencies then have that single product appear in different sub domains stores based on currency, or run a single domain and set the landing currency currencies via a string query in the url or currency switching drop down.

@mdavo6
Copy link

mdavo6 commented Apr 30, 2018

Hi @arjun289

Agree with @MatthewKennedy 's comments above.

You essentially have two options - 1. Multiple stores each with one currency (per your Amazon example) or 2. One store with multiple currencies.

As @MatthewKennedy has described, the major benefit from option 2 is less ongoing management - due to the fact you have only one listing to manage for each product vs multiple. Another point to mention is inventory. Depends on the individual specifications of the store, but you may run into issues keeping stock counts accurate across multiple single currency sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants