Created
January 13, 2024 00:39
-
-
Save Adammatthiesen/f08249f1831ae447b4de8de6841fca48 to your computer and use it in GitHub Desktop.
Astro SnipCart Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from '@adammatthiesen/astro-snipcart'; | |
--- | |
<SC.Cart> | |
<button>Open basket/checkout</button> | |
</SC.Cart> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SCVue from '@adammatthiesen/astro-snipcart/vue'; | |
--- | |
<span> | |
You have <SCVue.CartItemCount transition:persist client:load /> items in your cart. | |
</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from '@adammatthiesen/astro-snipcart'; | |
--- | |
<span> | |
You have <SC.CartItemCount /> items in your cart. | |
</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SCVue from '@adammatthiesen/astro-snipcart/vue'; | |
--- | |
total of <SCVue.CartTotal transition:persist client:load />. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from '@adammatthiesen/astro-snipcart'; | |
--- | |
total of <SC.CartTotal />. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import { HeaderAstro } from '@adammatthiesen/astro-snipcart'; | |
--- | |
<html> | |
<head> | |
<!-- ... other header stuff ... --> | |
<HeaderAstro /> | |
</head> | |
<body> | |
<slot /> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import { ViewTransitions } from "astro:transitions"; | |
import { HeaderVUE } from '@adammatthiesen/astro-snipcart/vue'; | |
--- | |
<html> | |
<head> | |
<!-- ... other header stuff ... --> | |
<ViewTransitions /> | |
<HeaderVUE transition:persist client:idle /> | |
</head> | |
<body> | |
<slot /> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from '@adammatthiesen/astro-snipcart'; | |
// Available usage; <SC.Cart>, <SC.CartItemCount />, <SC.CartTotal />, <SC.Login />, <SC.HeaderAstro />, <SC.MakeProduct> | |
import * as SCVue from '@adammatthiesen/astro-snipcart/vue'; | |
// Available usage; <SCVue.CartItemCount client:? />, <SCVue.CartTotal client:? />, <SCVue.HeaderVue client:? /> | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from '@adammatthiesen/astro-snipcart'; | |
--- | |
<SC.Login> | |
<button>Login</button> | |
</SC.Login> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from '@adammatthiesen/astro-snipcart'; | |
--- | |
<SC.MakeProduct | |
id="SKU-0001" | |
name="Example Name" | |
price={ 12.99 } | |
url="/store/example" # OPTIONAL Remove entry if not using... | |
description="Some Default Example Product" # OPTIONAL Remove entry if not using... | |
image="/Link/To/Image" # OPTIONAL Remove entry if not using... | |
catagories? # OPTIONAL Remove entry if not using... | |
fileGuid? # OPTIONAL Remove entry if not using... | |
quantity? # OPTIONAL Remove entry if not using... | |
minimumQuantity? # OPTIONAL Remove entry if not using... | |
maximumQuantity? # OPTIONAL Remove entry if not using... | |
quantityStep? # OPTIONAL Remove entry if not using... | |
customFields? # OPTIONAL Remove entry if not using... | |
stackable? # OPTIONAL Remove entry if not using... | |
> | |
<button>Add to cart</button> | |
</SC.MakeProduct> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import * as SC from "@adammatthiesen/astro-snipcart"; | |
--- | |
<SC.Cart> | |
<button> | |
Cart / Checkout | |
</button> | |
</SC.Cart> | |
<SC.CartItemCount /> Items - Sub Total: <SC.CartTotal /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment