Comments (3)
Simply, how would I write to the cart products if I added a field called 'items'? I'm trying to do this from the ProductPage.js. I can't simply use the updateProduct from AdminProductEdit I don't think.
from nicistore.
Okay, I'm working on the API now, adding tables to DB based on Variants per User. Is there a method to retrieve the current userID / Guest user token on the frontend (securely) or is this all dealt with on API level?
from nicistore.
Hi,
In regards to you last question about the current userID, you can use the AccountStore for that.
The question about Variants, I'm sorry but I don't think I follow your issue... and since I haven't implemented them it's hard for me to grasp what you are trying to achieve. From my point of view, variants are, first and foremost, just another product like any other with their own SKU, pricing, etc. But since they are almost exactly like each other, differing only on a specific attribute usually (color, size, etc), they may end up having their own product page.
Is this it?
From the top of my head I would use the attribute "metadata" from Products (as you mentioned) to kind of link one product to another. Now.. you could define one of these products as the "parent" and all other are variants of it or you could, in each of the variants, have the whole details about the other products
Product A
Product B (Variant of A)
Product C (Variant of B)
Option 1 (Product A is parent):
productB.metadata.variantOf = {
id: ProductA_ID,
attribute: 'color' // this product differs from A in its color,
value: 'red'
}
productC.metadata.variantOf = {
id: ProductA_ID,
attribute: 'size' // this product differs from A in its color,
value: 'xl'
}
Option 2 (All Products have variant information):
productA.metadata.variants = [
{id: ProductB_ID, attribute: 'color', value: 'red'},
{id: ProductC_ID, attribute: 'size', value 'xl'}
]
productB.metadata.variants = [
{id: ProductA_ID, attribute: 'color', value: 'blue'},
{id: ProductC_ID, attribute: 'size', value 'xl'}
]
productC.metadata.variants = [
{id: ProductA_ID, attribute: 'color', value: 'blue'},
{id: ProductB_ID, attribute: 'size', value 's'}
]
from nicistore.
Related Issues (20)
- Running takes too long HOT 3
- Add Script on .js HOT 4
- Fatal error when adding image HOT 3
- Is this project still being worked on HOT 1
- CSS not working with "npm run dev" HOT 8
- ORDERS_ITEM_SUCCESS Action / Dispatch Hangs
- Fatal error when adding image HOT 3
- cant set up the project HOT 2
- Currency
- Unstyled page when running in dev mode HOT 11
- Trying to upgrade React 0.13.3 -> 15.6.1 - Invariant Violation: _registerComponent(…) HOT 14
- err GET http://0.0.0.0:3001/dist/bundle.js . css not working HOT 5
- failed to run in win 10 HOT 3
- GET http://0.0.0.0:3001/dist/bundle.js net::ERR_CONNECTION_REFUSED
- I want to use Stripe recirring events, can I? HOT 2
- Error: 404 status code downloading 64-bit node.lib
- Nicistore not installing HOT 2
- Node version HOT 5
- How to secure app with SSL HOT 1
- Any interest in picking this up? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nicistore.