ski043 / nextjs-commerce-tutorial Goto Github PK
View Code? Open in Web Editor NEWA Simple but powerful Ecommerce Store built with Nextjs.14
Home Page: https://youtu.be/UnwmPuPdhFc
A Simple but powerful Ecommerce Store built with Nextjs.14
Home Page: https://youtu.be/UnwmPuPdhFc
Can you please tell me how to enable SSR to display normal code with H1, H2 etc.
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!
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!
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.