Giter VIP home page Giter VIP logo

nextjs-commerce-tutorial's People

Contributors

ski043 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nextjs-commerce-tutorial's Issues

SSR

Can you please tell me how to enable SSR to display normal code with H1, H2 etc.

Counter of added items

Hello. Could you please tell me Will you be able to add to your project a counter of added items near the cart icon?

Снимок экрана 2023-10-31 в 00 10 42

Unable to resolve image URL from source...

Hi, when I want to use the urlFor(image).url() function, into the image prop, in the AddToBag component, I'm having the following error:

Unhandled Runtime Error
Error: Unable to resolve image URL from source ([{"_type":"image","_key":"2df5c6d2ad5f","asset":{"_ref":"image-0d5ec6fed1e3db3dfe4ac1a14a886fc70e7537b0-800x1065-webp","_type":"reference"}},{"_type":"image","_key":"728563eeb445","asset":{"_ref":"image-4e7bd4bf0e00a5210667fedddcf61672a4e964c1-800x1065-webp","_type":"reference"}},{"_type":"image","_key":"fa629b138da8","asset":{"_ref":"image-309c23d4b559cb78a244504b3d6a1f48d9e01701-800x1065-webp","_type":"reference"}}])

The error goes away when I specify that urlFor(image).url() accepts an array, but the item image in the cartModal, doesn't render.

The component looks like this:

'use client'

import { useShoppingCart } from 'use-shopping-cart'

import { Button } from './ui/button'
import { urlFor } from '@/app/lib/sanity'


export interface CartItems {
  name: string,
  description: string,
  price: number,
  currency: string,
  image: any[],
}


export default function AddToCartClient({ name, description, price, currency, image }: CartItems) {
  const { addItem, handleCartClick } = useShoppingCart()

  const item = {
    name,
    description,
    price,
    image: urlFor(image[0]).url(),
    currency,
    sku: 'asd'
  }

  return (
    <Button onClick={() => {
      addItem(item),
        handleCartClick()
    }}>Add to cart</Button>
  )
}

Can someone help me? Thanks!

The idea is. (Next + Sanity + Next Auth + Vercel Storage)

Tell me, please. It is possible to make a video, with the creation of the site as I drew on the screenshot below. I noticed that everyone makes sites with classic stores. I really want to understand how to work with Vercel Storage.

My idea:
Use a product catalog through Sanity. Without using Stripe and their similar payment systems. When I add a product to the Sidebar, it gets collected there.

Then I click on the button and go to the Login page, when I'm logged in, everything I added is just stored on the profile or dashboard page.

Site subscriptions to specific product categories. I don't buy the product, I take it temporarily for a month or a year. Ideally add a timer too, that after a month it will disappear from the profile.

Please tell me. Is it possible to do this?
No one has not done this as an example. And it would be very cool!

Frame 1

Category & Links Category

Can you please tell me how to add a separate title and link for a category? If I have the title: Interior and Clothing. The link does not work. And to make everything merged is not beautiful

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.