lorenzogm / gatsby-ecommerce-starter

MIT License
15 stars 15 forks source link

How do I update the product? #6

Closed yansusanto closed 3 years ago

yansusanto commented 3 years ago

Say I'd like to change the product's name from 'Roarrr Shape Women T-Shirt' to 'Roarrr Shape Men T-Shirt'? What else do I need to do?

const defaultProduct = {
  name: 'Roarrr Shape Women T-Shirt',
  caption: 'caption',
  description: 'description',
  images: [skus[0].image],
  metadata: {
    categoryId: categories.WOMEN.id,
    defaultColor: colors.NAVY.id,
    defaultSize: sizes.WOMEN.MEDIUM.id,
  },
}

yarn catalog:update doesn't update it at all.

lorenzogm commented 3 years ago

Hi @yansusanto!

https://github.com/lorenzogm/gatsby-ecommerce-starter/blob/main/scripts/lib/generateProductsAndSkus.js#L16

The product ID is generated from the product name, maybe that's the reason. But the script is just using the API from stripe, try to debug what exactly you are sending when update the product.

FYI, this project is abandoned. I have been working in a better solution with Next.js, instead of Gatsby, Prismic as CMS (so no products in a script) and Stripe just for the payments. And in my opinion everything is just easier and you can have something running earlier. This is the link: https://github.com/lorenzogm/ecommerce

yansusanto commented 3 years ago

Hi @lorenzogm

Thank you for your response. If it is not too much to ask, do you have a demo of Next.js project you're working on?

lorenzogm commented 3 years ago

I don’t have a demo yet for that repo. I’ll do it soon.

But, this repo is with nextjs and crystallize (an older approach than the previous link): https://github.com/lorenzogm/ecommerce-nextjs-crystallize

The demo is dindim.es

lorenzogm commented 3 years ago

I deployed the demo Repo: https://github.com/lorenzogm/ecommerce Demo: https://ecommerce-umber-ten.vercel.app/

yansusanto commented 3 years ago

Awesome. I have never touched Next.js before so this is a new territory for me but I really like what you've done. Thanks for taking the time to setup the demo, @lorenzogm. Appreciate it!

yansusanto commented 3 years ago

Hi @lorenzogm,

Mind if I ask how do you install the repo? Thanks!

lorenzogm commented 3 years ago

I wrote some info in the README.md. It's not very detailed and maybe it's not enough. But it's something 😄

I close this issue, feel free to ask in the other repo if you have questions.

And feel free to submit a PR if you want with more details about your experience getting started with the repo.