create-abcart-theme 0.0.0-stage → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +64 -2
- package/bin/create-abcart-theme.mjs +4 -0
- package/package.json +47 -4
- package/src/args.mjs +113 -0
- package/src/banner.mjs +21 -0
- package/src/cli.mjs +119 -0
- package/src/create.mjs +82 -0
- package/src/package-manager.mjs +32 -0
- package/src/style.mjs +17 -0
- package/templates/default/.agents/skills/shopify-theme-asset-collector/SKILL.md +125 -0
- package/templates/default/.agents/skills/shopify-theme-asset-collector/scripts/collect_public_assets.py +370 -0
- package/templates/default/.agents/skills/wocart-docs/SKILL.md +146 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/SKILL.md +58 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/references/inputs-and-rights.md +47 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/references/layout-rtl-and-phone.md +36 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/references/measure-the-design.md +60 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/references/tokens-sections-content.md +103 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/references/verify-and-report.md +102 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/scripts/compare-design.cjs +230 -0
- package/templates/default/.agents/skills/wocart-theme-from-design/scripts/qa-pages.cjs +219 -0
- package/templates/default/.dev.vars.example +12 -0
- package/templates/default/AGENTS.md +240 -0
- package/templates/default/README.md +184 -0
- package/templates/default/_gitignore +11 -0
- package/templates/default/astro.config.mjs +85 -0
- package/templates/default/package.json +36 -0
- package/templates/default/public/fonts/OFL.txt +96 -0
- package/templates/default/public/fonts/alexandria-arabic.woff2 +0 -0
- package/templates/default/public/fonts/fraunces-latin.woff2 +0 -0
- package/templates/default/src/actions/index.ts +22 -0
- package/templates/default/src/components/cart/AddToCartButton.astro +45 -0
- package/templates/default/src/components/cart/CartDrawer.astro +47 -0
- package/templates/default/src/components/cart/CartSummary.astro +11 -0
- package/templates/default/src/components/cart/FreeShipping.astro +7 -0
- package/templates/default/src/components/checkout/CheckoutMain.astro +29 -0
- package/templates/default/src/components/checkout/OrderForm.astro +280 -0
- package/templates/default/src/components/checkout/ThankYouMain.astro +68 -0
- package/templates/default/src/components/landing/LandingImages.astro +51 -0
- package/templates/default/src/components/landing/LandingOrder.astro +46 -0
- package/templates/default/src/components/landing/LandingProduct.astro +41 -0
- package/templates/default/src/components/listing/ListingMain.astro +93 -0
- package/templates/default/src/components/listing/PageMain.astro +52 -0
- package/templates/default/src/components/listing/Pagination.astro +31 -0
- package/templates/default/src/components/listing/SortControl.astro +35 -0
- package/templates/default/src/components/product/BuyBox.astro +96 -0
- package/templates/default/src/components/product/Description.astro +24 -0
- package/templates/default/src/components/product/Gallery.astro +66 -0
- package/templates/default/src/components/product/MobileBuyBar.astro +29 -0
- package/templates/default/src/components/product/OfferChoice.astro +66 -0
- package/templates/default/src/components/product/ProductMain.astro +40 -0
- package/templates/default/src/components/product/ProductReviews.astro +72 -0
- package/templates/default/src/components/product/RelatedProducts.astro +30 -0
- package/templates/default/src/components/product/blocks/BenefitsBlock.astro +13 -0
- package/templates/default/src/components/product/blocks/CollapsibleBlock.astro +20 -0
- package/templates/default/src/components/product/blocks/DescriptionBlock.astro +19 -0
- package/templates/default/src/components/product/blocks/DetailsBlock.astro +33 -0
- package/templates/default/src/components/product/blocks/GalleryBlock.astro +12 -0
- package/templates/default/src/components/product/blocks/OrderBlock.astro +30 -0
- package/templates/default/src/components/product/blocks/PriceBlock.astro +23 -0
- package/templates/default/src/components/product/blocks/RatingBlock.astro +16 -0
- package/templates/default/src/components/product/blocks/StockBlock.astro +22 -0
- package/templates/default/src/components/product/blocks/TextBlock.astro +11 -0
- package/templates/default/src/components/product/blocks/TitleBlock.astro +20 -0
- package/templates/default/src/components/reviews/ReviewCard.astro +46 -0
- package/templates/default/src/components/reviews/ReviewForm.astro +113 -0
- package/templates/default/src/components/reviews/VoiceNote.astro +60 -0
- package/templates/default/src/components/sections/CollectionCards.astro +65 -0
- package/templates/default/src/components/sections/Countdown.astro +57 -0
- package/templates/default/src/components/sections/Faq.astro +44 -0
- package/templates/default/src/components/sections/FeaturedProduct.astro +71 -0
- package/templates/default/src/components/sections/Hero.astro +99 -0
- package/templates/default/src/components/sections/ImageBanner.astro +46 -0
- package/templates/default/src/components/sections/ProductGrid.astro +47 -0
- package/templates/default/src/components/sections/RichText.astro +35 -0
- package/templates/default/src/components/sections/Steps.astro +46 -0
- package/templates/default/src/components/sections/Testimonials.astro +57 -0
- package/templates/default/src/components/shell/Footer.astro +80 -0
- package/templates/default/src/components/shell/Header.astro +89 -0
- package/templates/default/src/components/shell/LanguageMenu.astro +33 -0
- package/templates/default/src/components/shell/MobileMenu.astro +65 -0
- package/templates/default/src/components/shell/SearchDialog.astro +19 -0
- package/templates/default/src/components/shell/TopBar.astro +54 -0
- package/templates/default/src/components/shell/WhatsAppWidget.astro +111 -0
- package/templates/default/src/components/store/ContactMain.astro +79 -0
- package/templates/default/src/components/store/SearchMain.astro +56 -0
- package/templates/default/src/components/store/TrackOrderMain.astro +161 -0
- package/templates/default/src/components/surface/Area.astro +20 -0
- package/templates/default/src/components/surface/PreviewBridge.astro +24 -0
- package/templates/default/src/components/surface/Sections.astro +35 -0
- package/templates/default/src/components/ui/Breadcrumbs.astro +36 -0
- package/templates/default/src/components/ui/Button.astro +45 -0
- package/templates/default/src/components/ui/EditorPlaceholder.astro +24 -0
- package/templates/default/src/components/ui/Icon.astro +93 -0
- package/templates/default/src/components/ui/Logo.astro +36 -0
- package/templates/default/src/components/ui/Photo.astro +46 -0
- package/templates/default/src/components/ui/Price.astro +24 -0
- package/templates/default/src/components/ui/ProductCard.astro +41 -0
- package/templates/default/src/components/ui/Rating.astro +22 -0
- package/templates/default/src/components/ui/Section.astro +34 -0
- package/templates/default/src/components/ui/SectionHeading.astro +19 -0
- package/templates/default/src/env.d.ts +23 -0
- package/templates/default/src/layouts/StoreLayout.astro +145 -0
- package/templates/default/src/lib/browser-copy.ts +37 -0
- package/templates/default/src/lib/context.ts +89 -0
- package/templates/default/src/lib/coupon-notice.ts +47 -0
- package/templates/default/src/lib/i18n.ts +32 -0
- package/templates/default/src/lib/images.ts +38 -0
- package/templates/default/src/lib/listing-query.ts +41 -0
- package/templates/default/src/lib/money.ts +16 -0
- package/templates/default/src/lib/motion.ts +16 -0
- package/templates/default/src/lib/nav.ts +26 -0
- package/templates/default/src/lib/offer-tiles.ts +105 -0
- package/templates/default/src/lib/order-outcome.ts +66 -0
- package/templates/default/src/lib/otp-message.ts +21 -0
- package/templates/default/src/lib/products.ts +38 -0
- package/templates/default/src/lib/review-refusals.ts +31 -0
- package/templates/default/src/lib/store.ts +31 -0
- package/templates/default/src/lib/whatsapp.ts +29 -0
- package/templates/default/src/middleware.ts +23 -0
- package/templates/default/src/pages/404.astro +22 -0
- package/templates/default/src/pages/api/abandoned/convert.ts +4 -0
- package/templates/default/src/pages/api/abandoned/upsert.ts +4 -0
- package/templates/default/src/pages/api/cart/validate.ts +4 -0
- package/templates/default/src/pages/api/communes/[wilayaId].ts +4 -0
- package/templates/default/src/pages/api/otp/send.ts +4 -0
- package/templates/default/src/pages/api/otp/verify.ts +4 -0
- package/templates/default/src/pages/api/reviews/[productId].ts +3 -0
- package/templates/default/src/pages/api/reviews/eligibility.ts +3 -0
- package/templates/default/src/pages/api/reviews/submit.ts +3 -0
- package/templates/default/src/pages/api/reviews/upload.ts +3 -0
- package/templates/default/src/pages/category/[slug].astro +20 -0
- package/templates/default/src/pages/checkout.astro +25 -0
- package/templates/default/src/pages/collections/[handle].astro +20 -0
- package/templates/default/src/pages/contact.astro +17 -0
- package/templates/default/src/pages/index.astro +9 -0
- package/templates/default/src/pages/lp/[slug].astro +47 -0
- package/templates/default/src/pages/pages/[slug].astro +16 -0
- package/templates/default/src/pages/products/[handle].astro +37 -0
- package/templates/default/src/pages/products/index.astro +15 -0
- package/templates/default/src/pages/robots.txt.ts +9 -0
- package/templates/default/src/pages/search.astro +19 -0
- package/templates/default/src/pages/sitemap.xml.ts +12 -0
- package/templates/default/src/pages/thank-you.astro +33 -0
- package/templates/default/src/pages/track-order.astro +17 -0
- package/templates/default/src/pages/wocart-preview.astro +43 -0
- package/templates/default/src/pages/wocart-revalidate.ts +10 -0
- package/templates/default/src/pages/wocart-styles.css.ts +5 -0
- package/templates/default/src/pages/wocart-theme.json.ts +5 -0
- package/templates/default/src/scripts/cart.ts +371 -0
- package/templates/default/src/scripts/checkout/coupon.ts +96 -0
- package/templates/default/src/scripts/checkout/delivery.ts +86 -0
- package/templates/default/src/scripts/checkout/form.ts +54 -0
- package/templates/default/src/scripts/checkout/otp.ts +106 -0
- package/templates/default/src/scripts/checkout/picker.ts +169 -0
- package/templates/default/src/scripts/checkout/quote.ts +169 -0
- package/templates/default/src/scripts/checkout/submit.ts +113 -0
- package/templates/default/src/scripts/checkout/tracking.ts +74 -0
- package/templates/default/src/scripts/countdown.ts +29 -0
- package/templates/default/src/scripts/events.ts +4 -0
- package/templates/default/src/scripts/hero.ts +49 -0
- package/templates/default/src/scripts/listing.ts +13 -0
- package/templates/default/src/scripts/order-form.ts +100 -0
- package/templates/default/src/scripts/product.ts +306 -0
- package/templates/default/src/scripts/public-config.ts +79 -0
- package/templates/default/src/scripts/reviews.ts +358 -0
- package/templates/default/src/scripts/site.ts +131 -0
- package/templates/default/src/scripts/thank-you.ts +11 -0
- package/templates/default/src/scripts/voice-note.ts +94 -0
- package/templates/default/src/styles/base.css +1030 -0
- package/templates/default/src/styles/checkout.css +1111 -0
- package/templates/default/src/styles/global.css +12 -0
- package/templates/default/src/styles/product.css +871 -0
- package/templates/default/src/styles/reviews.css +533 -0
- package/templates/default/src/styles/sections.css +931 -0
- package/templates/default/src/styles/shell.css +970 -0
- package/templates/default/src/styles/tokens.css +583 -0
- package/templates/default/src/theme/api-routes.ts +10 -0
- package/templates/default/src/theme/content/catalog.ts +117 -0
- package/templates/default/src/theme/content/checkout.ts +168 -0
- package/templates/default/src/theme/content/editor.ts +21 -0
- package/templates/default/src/theme/content/index.ts +45 -0
- package/templates/default/src/theme/content/reviews.ts +76 -0
- package/templates/default/src/theme/content/shell.ts +59 -0
- package/templates/default/src/theme/content/types.ts +12 -0
- package/templates/default/src/theme/documents/catalog.json +11 -0
- package/templates/default/src/theme/documents/category.json +11 -0
- package/templates/default/src/theme/documents/checkout.json +11 -0
- package/templates/default/src/theme/documents/collection.json +11 -0
- package/templates/default/src/theme/documents/contact.json +11 -0
- package/templates/default/src/theme/documents/footer.area.json +11 -0
- package/templates/default/src/theme/documents/header.area.json +16 -0
- package/templates/default/src/theme/documents/home.json +313 -0
- package/templates/default/src/theme/documents/landing.json +8 -0
- package/templates/default/src/theme/documents/page.json +11 -0
- package/templates/default/src/theme/documents/product.json +125 -0
- package/templates/default/src/theme/documents/search.json +11 -0
- package/templates/default/src/theme/documents/thank-you.json +11 -0
- package/templates/default/src/theme/documents/track-order.json +11 -0
- package/templates/default/src/theme/fields.ts +61 -0
- package/templates/default/src/theme/key.ts +11 -0
- package/templates/default/src/theme/labels.ts +231 -0
- package/templates/default/src/theme/locales.ts +11 -0
- package/templates/default/src/theme/palette.ts +14 -0
- package/templates/default/src/theme/sections/collection-cards.ts +65 -0
- package/templates/default/src/theme/sections/faq.ts +74 -0
- package/templates/default/src/theme/sections/featured-product.ts +42 -0
- package/templates/default/src/theme/sections/hero.ts +47 -0
- package/templates/default/src/theme/sections/image-banner.ts +25 -0
- package/templates/default/src/theme/sections/index.ts +40 -0
- package/templates/default/src/theme/sections/landing.ts +150 -0
- package/templates/default/src/theme/sections/listing.ts +84 -0
- package/templates/default/src/theme/sections/product-grid.ts +42 -0
- package/templates/default/src/theme/sections/product.ts +297 -0
- package/templates/default/src/theme/sections/rich-text.ts +39 -0
- package/templates/default/src/theme/sections/shared.ts +54 -0
- package/templates/default/src/theme/sections/shell.ts +85 -0
- package/templates/default/src/theme/sections/store-pages.ts +101 -0
- package/templates/default/src/theme/sections/testimonials.ts +61 -0
- package/templates/default/src/theme/sections/thank-you.ts +35 -0
- package/templates/default/src/theme/settings.ts +124 -0
- package/templates/default/src/theme/theme.ts +65 -0
- package/templates/default/tests/fixtures/canvas-tote.json +62 -0
- package/templates/default/tests/fixtures/linen-shirt.json +128 -0
- package/templates/default/tests/unit/checkout.test.ts +241 -0
- package/templates/default/tests/unit/contract.test.ts +169 -0
- package/templates/default/tests/unit/contrast.test.ts +68 -0
- package/templates/default/tests/unit/copy.test.ts +101 -0
- package/templates/default/tests/unit/design-values.test.ts +95 -0
- package/templates/default/tests/unit/editability.test.ts +180 -0
- package/templates/default/tests/unit/fixtures.ts +91 -0
- package/templates/default/tests/unit/footer.test.ts +54 -0
- package/templates/default/tests/unit/guards.test.ts +340 -0
- package/templates/default/tests/unit/images.test.ts +26 -0
- package/templates/default/tests/unit/landing.test.ts +151 -0
- package/templates/default/tests/unit/languages.test.ts +42 -0
- package/templates/default/tests/unit/middleware.test.ts +53 -0
- package/templates/default/tests/unit/offer-tiles.test.ts +75 -0
- package/templates/default/tests/unit/render.ts +38 -0
- package/templates/default/tests/unit/reviews.test.ts +25 -0
- package/templates/default/tests/unit/rules.test.ts +59 -0
- package/templates/default/tests/unit/source.ts +75 -0
- package/templates/default/tests/unit/store-pages.test.ts +147 -0
- package/templates/default/tests/unit/studio.test.ts +202 -0
- package/templates/default/tests/unit/testimonials.test.ts +52 -0
- package/templates/default/tests/unit/thank-you.test.ts +52 -0
- package/templates/default/tests/unit/tracking.test.ts +29 -0
- package/templates/default/tests/unit/voice-note.test.ts +42 -0
- package/templates/default/tsconfig.json +13 -0
- package/templates/default/vitest.config.ts +15 -0
- package/templates/default/wrangler.jsonc +17 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** The parts every page shares, each composed of sections and edited once for the whole store. */
|
|
2
|
+
import { defineComponent } from "@abcart/theme";
|
|
3
|
+
import { ACCENT_SCHEME, DARK_SCHEME, PAGE_SCHEME, iconField, schemeField } from "../fields";
|
|
4
|
+
import { FIELD, GROUP, SECTION, HELP } from "../labels";
|
|
5
|
+
import TopBar from "@/components/shell/TopBar.astro";
|
|
6
|
+
import Header from "@/components/shell/Header.astro";
|
|
7
|
+
import Footer from "@/components/shell/Footer.astro";
|
|
8
|
+
|
|
9
|
+
const l = (ar: string, fr: string, en: string) => ({ ar, fr, en });
|
|
10
|
+
|
|
11
|
+
const announcementBar = defineComponent({
|
|
12
|
+
type: "announcement-bar",
|
|
13
|
+
component: TopBar,
|
|
14
|
+
label: SECTION.announcementBar,
|
|
15
|
+
group: GROUP.header,
|
|
16
|
+
placement: "section",
|
|
17
|
+
capabilities: { surfaces: ["area:header"] },
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
key: "announcements",
|
|
21
|
+
kind: "list",
|
|
22
|
+
label: FIELD.announcements,
|
|
23
|
+
itemLabel: "text",
|
|
24
|
+
max: 4,
|
|
25
|
+
fields: [{ key: "text", kind: "text", label: FIELD.text }, iconField("sparkles"), { key: "link", kind: "url", label: FIELD.link }],
|
|
26
|
+
default: [
|
|
27
|
+
{ id: "ann-1", props: { text: l("الدفع عند الاستلام", "Paiement à la livraison", "Cash on delivery"), icon: "cash" } },
|
|
28
|
+
{ id: "ann-2", props: { text: l("سعر التوصيل يظهر قبل تأكيد الطلب", "Frais de livraison affichés avant de commander", "Delivery fee shown before you order"), icon: "truck" } },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{ key: "showSocial", kind: "boolean", label: FIELD.showSocial, default: true },
|
|
32
|
+
{ key: "showLanguage", kind: "boolean", label: FIELD.showLanguage, default: false },
|
|
33
|
+
schemeField(ACCENT_SCHEME),
|
|
34
|
+
],
|
|
35
|
+
presets: [
|
|
36
|
+
{
|
|
37
|
+
key: "promises",
|
|
38
|
+
label: { ar: "وعود المتجر", fr: "Engagements de la boutique", en: "Store promises" },
|
|
39
|
+
props: {
|
|
40
|
+
showSocial: false,
|
|
41
|
+
announcements: [
|
|
42
|
+
{ id: "cash", props: { text: { ar: "الدفع عند الاستلام", fr: "Paiement à la livraison", en: "Cash on delivery" }, icon: "cash" } },
|
|
43
|
+
{ id: "delivery", props: { text: { ar: "سعر التوصيل يظهر قبل تأكيد الطلب", fr: "Frais de livraison affichés avant de commander", en: "Delivery fee shown before you order" }, icon: "truck" } },
|
|
44
|
+
{ id: "no-prepay", props: { text: { ar: "لا دفع مسبق", fr: "Aucun paiement à l'avance", en: "No payment in advance" }, icon: "shield" } },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const header = defineComponent({
|
|
52
|
+
type: "header",
|
|
53
|
+
component: Header,
|
|
54
|
+
label: SECTION.header,
|
|
55
|
+
group: GROUP.header,
|
|
56
|
+
placement: "section",
|
|
57
|
+
capabilities: { surfaces: ["area:header"], insertable: false },
|
|
58
|
+
fields: [
|
|
59
|
+
{ key: "menu", kind: "menu", label: FIELD.menu, default: "main-menu" },
|
|
60
|
+
{ key: "logoHeight", kind: "number", label: FIELD.logoHeight, description: HELP.logoHeight, min: 28, max: 72, step: 2, display: "slider", default: 42 },
|
|
61
|
+
{ key: "sticky", kind: "boolean", label: FIELD.stickyHeader, default: true },
|
|
62
|
+
{ key: "showSearch", kind: "boolean", label: FIELD.showSearch, default: true },
|
|
63
|
+
{ key: "showLanguage", kind: "boolean", label: FIELD.showLanguage, default: true },
|
|
64
|
+
schemeField(PAGE_SCHEME),
|
|
65
|
+
],
|
|
66
|
+
load: async ({ storefront, props, reads }) => ({ storeMenu: await reads.get(`menu:${props.menu}`, () => storefront.menus.get(props.menu)) }),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const footer = defineComponent({
|
|
70
|
+
type: "footer",
|
|
71
|
+
component: Footer,
|
|
72
|
+
label: SECTION.footer,
|
|
73
|
+
group: GROUP.footer,
|
|
74
|
+
placement: "section",
|
|
75
|
+
capabilities: { surfaces: ["area:footer"], insertable: false },
|
|
76
|
+
fields: [
|
|
77
|
+
{ key: "menu", kind: "menu", label: FIELD.menu, default: "footer-menu" },
|
|
78
|
+
{ key: "about", kind: "textarea", label: FIELD.about, description: HELP.about, contentKey: "footer.about" },
|
|
79
|
+
{ key: "showPayment", kind: "boolean", label: FIELD.showPayment, description: HELP.payment, default: true },
|
|
80
|
+
schemeField(DARK_SCHEME),
|
|
81
|
+
],
|
|
82
|
+
load: async ({ storefront, props, reads }) => ({ storeMenu: await reads.get(`menu:${props.menu}`, () => storefront.menus.get(props.menu)) }),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const shellComponents = { "announcement-bar": announcementBar, header, footer };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The store's own pages — search, order tracking, checkout, contact — each
|
|
3
|
+
* with its one required section, which the editor composes like any page.
|
|
4
|
+
* The routes hand them what their address carries: a search's words, page
|
|
5
|
+
* and order.
|
|
6
|
+
*/
|
|
7
|
+
import { defineComponent } from "@abcart/theme";
|
|
8
|
+
import type { ProductPage, ProductSort } from "@abcart/storefront";
|
|
9
|
+
import { schemeField, sectionStyle, styleField } from "../fields";
|
|
10
|
+
import { FIELD, GROUP, HELP, SECTION } from "../labels";
|
|
11
|
+
import { LISTING_PAGE_SIZE, requestedPage, requestedSort } from "@/lib/listing-query";
|
|
12
|
+
import SearchMain from "@/components/store/SearchMain.astro";
|
|
13
|
+
import TrackOrderMain from "@/components/store/TrackOrderMain.astro";
|
|
14
|
+
import CheckoutMain from "@/components/checkout/CheckoutMain.astro";
|
|
15
|
+
import ContactMain from "@/components/store/ContactMain.astro";
|
|
16
|
+
|
|
17
|
+
/** What a search shows: the words asked, and the page of products they find. */
|
|
18
|
+
export interface SearchView {
|
|
19
|
+
query: string;
|
|
20
|
+
page: number;
|
|
21
|
+
sort: ProductSort | undefined;
|
|
22
|
+
result: ProductPage;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const searchMain = defineComponent({
|
|
26
|
+
type: "search-main",
|
|
27
|
+
component: SearchMain,
|
|
28
|
+
label: SECTION.searchMain,
|
|
29
|
+
group: GROUP.page,
|
|
30
|
+
placement: "section",
|
|
31
|
+
capabilities: { surfaces: ["search"], insertable: false },
|
|
32
|
+
fields: [
|
|
33
|
+
{ key: "showBreadcrumbs", kind: "boolean", label: FIELD.showBreadcrumbs, default: true },
|
|
34
|
+
{ key: "showSort", kind: "boolean", label: FIELD.showSort, default: true },
|
|
35
|
+
schemeField(),
|
|
36
|
+
styleField(sectionStyle("tight")),
|
|
37
|
+
],
|
|
38
|
+
load: async ({ storefront, context }): Promise<{ view: SearchView }> => {
|
|
39
|
+
const params = context.params ?? {};
|
|
40
|
+
const query = (params.q ?? "").trim();
|
|
41
|
+
const page = requestedPage(params.page);
|
|
42
|
+
const sort = requestedSort(params.sort);
|
|
43
|
+
const result = query ? await storefront.products.search(query, { limit: LISTING_PAGE_SIZE, offset: (page - 1) * LISTING_PAGE_SIZE, sort }) : { items: [], hasNext: false, total: 0 };
|
|
44
|
+
return { view: { query, page, sort, result } };
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const trackOrderMain = defineComponent({
|
|
49
|
+
type: "track-order-main",
|
|
50
|
+
component: TrackOrderMain,
|
|
51
|
+
label: SECTION.trackOrderMain,
|
|
52
|
+
group: GROUP.page,
|
|
53
|
+
placement: "section",
|
|
54
|
+
capabilities: { surfaces: ["track-order"], insertable: false },
|
|
55
|
+
fields: [
|
|
56
|
+
{ key: "title", kind: "text", label: FIELD.title, contentKey: "track.title" },
|
|
57
|
+
{ key: "subtitle", kind: "textarea", label: FIELD.subtitle, contentKey: "track.subtitle" },
|
|
58
|
+
{ key: "showBreadcrumbs", kind: "boolean", label: FIELD.showBreadcrumbs, default: true },
|
|
59
|
+
schemeField(),
|
|
60
|
+
styleField(sectionStyle("normal", "narrow")),
|
|
61
|
+
],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const checkoutMain = defineComponent({
|
|
65
|
+
type: "checkout-main",
|
|
66
|
+
component: CheckoutMain,
|
|
67
|
+
label: SECTION.checkoutMain,
|
|
68
|
+
group: GROUP.page,
|
|
69
|
+
placement: "section",
|
|
70
|
+
capabilities: { surfaces: ["checkout"], insertable: false },
|
|
71
|
+
fields: [
|
|
72
|
+
{ key: "title", kind: "text", label: FIELD.title, contentKey: "checkout.title" },
|
|
73
|
+
schemeField(),
|
|
74
|
+
styleField(sectionStyle("normal", "narrow")),
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* How a shopper reaches the store: its WhatsApp (the App's), its phone, email
|
|
80
|
+
* and address (the store's own details), each once the merchant has set it.
|
|
81
|
+
* Opening hours and a note are the merchant's, in each language, and show
|
|
82
|
+
* only once written: the theme never claims hours a store does not keep.
|
|
83
|
+
*/
|
|
84
|
+
export const contactMain = defineComponent({
|
|
85
|
+
type: "contact-main",
|
|
86
|
+
component: ContactMain,
|
|
87
|
+
label: SECTION.contactMain,
|
|
88
|
+
group: GROUP.page,
|
|
89
|
+
placement: "section",
|
|
90
|
+
capabilities: { surfaces: ["contact"], insertable: false },
|
|
91
|
+
fields: [
|
|
92
|
+
{ key: "title", kind: "text", label: FIELD.title, contentKey: "contact.title" },
|
|
93
|
+
{ key: "subtitle", kind: "textarea", label: FIELD.subtitle, contentKey: "contact.body" },
|
|
94
|
+
{ key: "hours", kind: "text", label: FIELD.hours, description: HELP.hours },
|
|
95
|
+
{ key: "note", kind: "textarea", label: FIELD.contactNote },
|
|
96
|
+
{ key: "showPages", kind: "boolean", label: FIELD.showPages, default: true },
|
|
97
|
+
{ key: "showBreadcrumbs", kind: "boolean", label: FIELD.showBreadcrumbs, default: true },
|
|
98
|
+
schemeField(),
|
|
99
|
+
styleField(sectionStyle("normal")),
|
|
100
|
+
],
|
|
101
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** The store's own best reviews, newest first: never invented quotes. */
|
|
2
|
+
import { defineComponent } from "@abcart/theme";
|
|
3
|
+
import { localeRouting, localizeHref, storefrontPath, type Review } from "@abcart/storefront";
|
|
4
|
+
import Testimonials from "@/components/sections/Testimonials.astro";
|
|
5
|
+
import { alignField, headingFields, schemeField, styleField } from "../fields";
|
|
6
|
+
import { FIELD, GROUP, SECTION, HELP } from "../labels";
|
|
7
|
+
import { WITH_LANDING } from "./shared";
|
|
8
|
+
|
|
9
|
+
/** A shopper's review on a page, with the product it is about. */
|
|
10
|
+
export interface TestimonialReview {
|
|
11
|
+
review: Review;
|
|
12
|
+
product: { name: string; href: string };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const testimonials = defineComponent({
|
|
16
|
+
type: "testimonials",
|
|
17
|
+
component: Testimonials,
|
|
18
|
+
label: SECTION.testimonials,
|
|
19
|
+
group: GROUP.content,
|
|
20
|
+
placement: "section",
|
|
21
|
+
capabilities: WITH_LANDING,
|
|
22
|
+
fields: [
|
|
23
|
+
...headingFields("home.testimonials"),
|
|
24
|
+
alignField,
|
|
25
|
+
{ key: "limit", kind: "number", label: FIELD.reviewsShown, description: HELP.reviewsShown, default: 6, min: 3, max: 9, step: 1, display: "slider" },
|
|
26
|
+
{ key: "minRating", kind: "number", label: FIELD.minRating, description: HELP.minRating, default: 4, min: 1, max: 5, step: 1, display: "slider" },
|
|
27
|
+
schemeField(),
|
|
28
|
+
styleField(),
|
|
29
|
+
],
|
|
30
|
+
presets: [
|
|
31
|
+
{
|
|
32
|
+
key: "top-rated",
|
|
33
|
+
label: { ar: "الأعلى تقييماً", fr: "Les mieux notés", en: "Top rated" },
|
|
34
|
+
props: {
|
|
35
|
+
title: { ar: "الأعلى", fr: "Les mieux", en: "Top" },
|
|
36
|
+
accent: { ar: "تقييماً", fr: "notés", en: "rated" },
|
|
37
|
+
minRating: 5,
|
|
38
|
+
limit: 3,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
load: async ({ storefront, context, props, reads }): Promise<{ reviews: TestimonialReview[] }> => {
|
|
43
|
+
if (!context.store.reviewsEnabled) return { reviews: [] };
|
|
44
|
+
const limit = props.limit ?? 6;
|
|
45
|
+
const minRating = props.minRating ?? 4;
|
|
46
|
+
const products = await reads.get("products:all", () => storefront.products.list());
|
|
47
|
+
const reviewed = products
|
|
48
|
+
.filter((product) => (product.reviewStats?.reviewCount ?? 0) > 0)
|
|
49
|
+
.sort((a, b) => (b.reviewStats?.reviewCount ?? 0) - (a.reviewStats?.reviewCount ?? 0))
|
|
50
|
+
.slice(0, limit);
|
|
51
|
+
const pages = await Promise.all(reviewed.map((product) => reads.get(`reviews:${product.id}:3`, () => storefront.products.reviews.list(product.id, { limit: 3 }))));
|
|
52
|
+
const routing = localeRouting(context.store);
|
|
53
|
+
const reviews = pages
|
|
54
|
+
.flatMap((page, index) => page.rows.map((review) => ({ review, product: reviewed[index]! })))
|
|
55
|
+
.filter(({ review }) => review.rating >= minRating && review.body.trim().length > 0)
|
|
56
|
+
.sort((a, b) => b.review.createdAt.localeCompare(a.review.createdAt))
|
|
57
|
+
.slice(0, limit)
|
|
58
|
+
.map(({ review, product }) => ({ review, product: { name: product.name, href: localizeHref(storefrontPath("product", { handle: product.handle }), context.locale, routing) } }));
|
|
59
|
+
return { reviews };
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The thank-you page: the order's confirmation, the page's one required
|
|
3
|
+
* section, which content sections can follow. The route hands it the order's
|
|
4
|
+
* number and total from its link; the editor's preview, with no order, an
|
|
5
|
+
* example number.
|
|
6
|
+
*/
|
|
7
|
+
import { defineComponent } from "@abcart/theme";
|
|
8
|
+
import { schemeField, sectionStyle, styleField } from "../fields";
|
|
9
|
+
import { FIELD, GROUP, SECTION } from "../labels";
|
|
10
|
+
import { ORDER_EXAMPLE } from "@/lib/order-outcome";
|
|
11
|
+
import ThankYouMain from "@/components/checkout/ThankYouMain.astro";
|
|
12
|
+
|
|
13
|
+
export const thankYouMain = defineComponent({
|
|
14
|
+
type: "thank-you-main",
|
|
15
|
+
component: ThankYouMain,
|
|
16
|
+
label: SECTION.thankYouMain,
|
|
17
|
+
group: GROUP.page,
|
|
18
|
+
placement: "section",
|
|
19
|
+
capabilities: { surfaces: ["thank-you"], insertable: false },
|
|
20
|
+
fields: [
|
|
21
|
+
{ key: "title", kind: "text", label: FIELD.title, contentKey: "thankYou.title" },
|
|
22
|
+
{ key: "subtitle", kind: "textarea", label: FIELD.subtitle, contentKey: "thankYou.subtitle" },
|
|
23
|
+
{ key: "note", kind: "textarea", label: FIELD.whatNext, contentKey: "thankYou.next" },
|
|
24
|
+
{ key: "showContact", kind: "boolean", label: FIELD.showContact, default: true },
|
|
25
|
+
{ key: "showTrack", kind: "boolean", label: FIELD.showTrack, default: true },
|
|
26
|
+
{ key: "showContinue", kind: "boolean", label: FIELD.showContinue, default: true },
|
|
27
|
+
schemeField(),
|
|
28
|
+
styleField(sectionStyle("normal", "narrow")),
|
|
29
|
+
],
|
|
30
|
+
load: async ({ context }): Promise<{ order: { number: string; total: number | null } }> => {
|
|
31
|
+
const params = context.params ?? {};
|
|
32
|
+
const total = params.total ? Number(params.total) : NaN;
|
|
33
|
+
return { order: { number: params.orderNumber || ORDER_EXAMPLE, total: Number.isFinite(total) ? total : null } };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The store-wide choices a merchant makes in the editor: colors, corners,
|
|
3
|
+
* product cards, and the store's promises and social links. The defaults are
|
|
4
|
+
* the starter's neutral look; a theme's brand lives in `src/styles/tokens.css`
|
|
5
|
+
* and in the color schemes below.
|
|
6
|
+
*/
|
|
7
|
+
import { defineTheme, type SettingsGroup } from "@abcart/theme";
|
|
8
|
+
import { THEME_KEY, THEME_VERSION } from "./key";
|
|
9
|
+
import { LOCALES } from "./locales";
|
|
10
|
+
import { FIELD, OPTION, SETTINGS, HELP } from "./labels";
|
|
11
|
+
import { ACCENT_SCHEME, DARK_SCHEME, MUTED_SCHEME, PAGE_SCHEME, iconField } from "./fields";
|
|
12
|
+
import { BLACK, CHARCOAL, LINE, MIST, SILVER, STEEL, WHITE } from "./palette";
|
|
13
|
+
|
|
14
|
+
const l = (ar: string, fr: string, en: string) => ({ ar, fr, en });
|
|
15
|
+
|
|
16
|
+
export const THEME_SETTINGS = [
|
|
17
|
+
{
|
|
18
|
+
key: "appearance",
|
|
19
|
+
label: SETTINGS.appearance,
|
|
20
|
+
fields: [
|
|
21
|
+
{
|
|
22
|
+
key: "colorSchemes",
|
|
23
|
+
kind: "colorSchemes",
|
|
24
|
+
label: FIELD.colors,
|
|
25
|
+
default: [
|
|
26
|
+
{
|
|
27
|
+
id: PAGE_SCHEME,
|
|
28
|
+
name: l("فاتح", "Clair", "Light"),
|
|
29
|
+
colors: { background: WHITE, text: CHARCOAL, heading: BLACK, accent: BLACK, button: BLACK, buttonText: WHITE, border: LINE },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: MUTED_SCHEME,
|
|
33
|
+
name: l("هادئ", "Doux", "Muted"),
|
|
34
|
+
colors: { background: MIST, text: CHARCOAL, heading: BLACK, accent: BLACK, button: BLACK, buttonText: WHITE, border: LINE },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: ACCENT_SCHEME,
|
|
38
|
+
name: l("بارز", "Accent", "Accent"),
|
|
39
|
+
colors: { background: CHARCOAL, text: SILVER, heading: WHITE, accent: WHITE, button: WHITE, buttonText: BLACK, border: STEEL },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: DARK_SCHEME,
|
|
43
|
+
name: l("داكن", "Sombre", "Dark"),
|
|
44
|
+
colors: { background: BLACK, text: SILVER, heading: WHITE, accent: WHITE, button: WHITE, buttonText: BLACK, border: STEEL },
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{ key: "pageScheme", kind: "colorScheme", label: FIELD.pageScheme, description: HELP.pageScheme, default: PAGE_SCHEME },
|
|
49
|
+
{
|
|
50
|
+
key: "corners",
|
|
51
|
+
kind: "select",
|
|
52
|
+
label: FIELD.corners,
|
|
53
|
+
description: HELP.corners,
|
|
54
|
+
options: ["square", "soft", "round"],
|
|
55
|
+
optionLabels: { square: OPTION.square, soft: OPTION.soft, round: OPTION.round },
|
|
56
|
+
default: "soft",
|
|
57
|
+
display: "segmented",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "cardRatio",
|
|
61
|
+
kind: "select",
|
|
62
|
+
label: FIELD.cardImage,
|
|
63
|
+
description: HELP.cardRatio,
|
|
64
|
+
options: ["square", "portrait"],
|
|
65
|
+
optionLabels: { square: OPTION.squareImage, portrait: OPTION.portrait },
|
|
66
|
+
default: "square",
|
|
67
|
+
display: "segmented",
|
|
68
|
+
},
|
|
69
|
+
{ key: "cardButton", kind: "boolean", label: FIELD.cardButton, description: HELP.cardButton, default: true },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "store",
|
|
74
|
+
label: SETTINGS.store,
|
|
75
|
+
fields: [
|
|
76
|
+
{
|
|
77
|
+
key: "benefits",
|
|
78
|
+
kind: "list",
|
|
79
|
+
label: FIELD.benefits,
|
|
80
|
+
itemLabel: "text",
|
|
81
|
+
max: 6,
|
|
82
|
+
fields: [{ key: "text", kind: "text", label: FIELD.text }, iconField("check")],
|
|
83
|
+
default: [
|
|
84
|
+
{ id: "ben-1", props: { text: l("الدفع عند الاستلام", "Paiement à la livraison", "Cash on delivery"), icon: "cash" } },
|
|
85
|
+
{ id: "ben-2", props: { text: l("سعر التوصيل يظهر قبل التأكيد", "Frais de livraison affichés avant de confirmer", "Delivery fee shown before you confirm"), icon: "truck" } },
|
|
86
|
+
{ id: "ben-3", props: { text: l("تتبّع طلبك برقمه", "Suivez votre commande avec son numéro", "Track your order with its number"), icon: "package" } },
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: "socialLinks",
|
|
91
|
+
kind: "list",
|
|
92
|
+
label: FIELD.socialLinks,
|
|
93
|
+
itemLabel: "label",
|
|
94
|
+
max: 5,
|
|
95
|
+
fields: [
|
|
96
|
+
{
|
|
97
|
+
key: "network",
|
|
98
|
+
kind: "select",
|
|
99
|
+
label: FIELD.network,
|
|
100
|
+
options: ["instagram", "facebook", "tiktok", "youtube"],
|
|
101
|
+
optionLabels: { instagram: OPTION.instagram, facebook: OPTION.facebook, tiktok: OPTION.tiktok, youtube: OPTION.youtube },
|
|
102
|
+
default: "instagram",
|
|
103
|
+
},
|
|
104
|
+
{ key: "href", kind: "url", label: FIELD.link },
|
|
105
|
+
{ key: "label", kind: "text", label: FIELD.label },
|
|
106
|
+
],
|
|
107
|
+
default: [],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
] as const satisfies readonly SettingsGroup[];
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The settings alone, as a definition: what the middleware and the layout
|
|
115
|
+
* resolve a store's settings against, so a request never loads every section
|
|
116
|
+
* just to read the store's colors.
|
|
117
|
+
*/
|
|
118
|
+
export const settingsDefinition = defineTheme({
|
|
119
|
+
key: THEME_KEY,
|
|
120
|
+
version: THEME_VERSION,
|
|
121
|
+
locales: LOCALES,
|
|
122
|
+
settings: THEME_SETTINGS,
|
|
123
|
+
components: {},
|
|
124
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme, as the platform and the editor see it: its pages (surfaces), the
|
|
3
|
+
* header and footer (areas), its sections, settings, words and spacing scale.
|
|
4
|
+
* Definitions are code; each page's default layout is a JSON document in
|
|
5
|
+
* `documents/`. The build turns this into `/wocart-theme.json`, the manifest
|
|
6
|
+
* the editor reads.
|
|
7
|
+
*/
|
|
8
|
+
import { defineTheme, type PageData, type RequiredBlock } from "@abcart/theme";
|
|
9
|
+
import { THEME_KEY, THEME_VERSION } from "./key";
|
|
10
|
+
import { LOCALES } from "./locales";
|
|
11
|
+
import { content } from "./content";
|
|
12
|
+
import { SURFACE } from "./labels";
|
|
13
|
+
import { THEME_SETTINGS } from "./settings";
|
|
14
|
+
import { components } from "./sections";
|
|
15
|
+
import homeDocument from "./documents/home.json";
|
|
16
|
+
import productDocument from "./documents/product.json";
|
|
17
|
+
import collectionDocument from "./documents/collection.json";
|
|
18
|
+
import categoryDocument from "./documents/category.json";
|
|
19
|
+
import catalogDocument from "./documents/catalog.json";
|
|
20
|
+
import pageDocument from "./documents/page.json";
|
|
21
|
+
import thankYouDocument from "./documents/thank-you.json";
|
|
22
|
+
import landingDocument from "./documents/landing.json";
|
|
23
|
+
import searchDocument from "./documents/search.json";
|
|
24
|
+
import trackOrderDocument from "./documents/track-order.json";
|
|
25
|
+
import checkoutDocument from "./documents/checkout.json";
|
|
26
|
+
import contactDocument from "./documents/contact.json";
|
|
27
|
+
import headerDocument from "./documents/header.area.json";
|
|
28
|
+
import footerDocument from "./documents/footer.area.json";
|
|
29
|
+
|
|
30
|
+
const doc = (value: unknown) => value as PageData;
|
|
31
|
+
/** The one section a page cannot lose: the editor keeps it, and a saved page missing it gets it back. */
|
|
32
|
+
const main = (type: string): RequiredBlock[] => [{ type, min: 1, max: 1 }];
|
|
33
|
+
|
|
34
|
+
export const theme = defineTheme({
|
|
35
|
+
key: THEME_KEY,
|
|
36
|
+
version: THEME_VERSION,
|
|
37
|
+
preview: true,
|
|
38
|
+
locales: LOCALES,
|
|
39
|
+
content,
|
|
40
|
+
/** The steps a section's spacing and width are picked from (pixels). */
|
|
41
|
+
style: {
|
|
42
|
+
spacing: { s0: 0, s1: 4, s2: 8, s3: 12, s4: 16, s5: 24, s6: 32, s7: 40, s8: 56, s9: 72, s10: 88, s11: 104, s12: 128 },
|
|
43
|
+
widths: { wide: 1280, content: 960, narrow: 680 },
|
|
44
|
+
},
|
|
45
|
+
settings: THEME_SETTINGS,
|
|
46
|
+
areas: [
|
|
47
|
+
{ key: "header", label: SURFACE.header, document: doc(headerDocument), required: main("header"), max: 4 },
|
|
48
|
+
{ key: "footer", label: SURFACE.footer, document: doc(footerDocument), required: main("footer"), max: 4 },
|
|
49
|
+
],
|
|
50
|
+
surfaces: [
|
|
51
|
+
{ key: "home", label: SURFACE.home, pageType: "home", document: doc(homeDocument), max: 20 },
|
|
52
|
+
{ key: "product", label: SURFACE.product, pageType: "product", document: doc(productDocument), required: main("product-main"), max: 12 },
|
|
53
|
+
{ key: "collection", label: SURFACE.collection, pageType: "collection", document: doc(collectionDocument), required: main("listing-main"), max: 12 },
|
|
54
|
+
{ key: "category", label: SURFACE.category, pageType: "category", document: doc(categoryDocument), required: main("listing-main"), max: 12 },
|
|
55
|
+
{ key: "catalog", label: SURFACE.catalog, pageType: "catalog", document: doc(catalogDocument), required: main("listing-main"), max: 12 },
|
|
56
|
+
{ key: "page", label: SURFACE.page, pageType: "page", document: doc(pageDocument), required: main("page-main"), max: 8 },
|
|
57
|
+
{ key: "thank-you", label: SURFACE.thankYou, pageType: "thankYou", document: doc(thankYouDocument), required: main("thank-you-main"), max: 6 },
|
|
58
|
+
{ key: "landing", label: SURFACE.landing, pageType: "landing", document: doc(landingDocument), required: main("landing-order"), max: 16, hideableAreas: ["header", "footer"] },
|
|
59
|
+
{ key: "search", label: SURFACE.search, pageType: "search", document: doc(searchDocument), required: main("search-main"), max: 6 },
|
|
60
|
+
{ key: "track-order", label: SURFACE.trackOrder, pageType: "trackOrder", document: doc(trackOrderDocument), required: main("track-order-main"), max: 6 },
|
|
61
|
+
{ key: "checkout", label: SURFACE.checkout, pageType: "checkout", document: doc(checkoutDocument), required: main("checkout-main"), max: 4 },
|
|
62
|
+
{ key: "contact", label: SURFACE.contact, pageType: "contact", document: doc(contactDocument), required: main("contact-main"), max: 8 },
|
|
63
|
+
],
|
|
64
|
+
components,
|
|
65
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "fixture:product:tote",
|
|
3
|
+
"name": "حقيبة قماشية",
|
|
4
|
+
"description": "<p>حقيبة متينة من القماش لكل يوم.</p>",
|
|
5
|
+
"descriptionFormat": "html",
|
|
6
|
+
"handle": "canvas-tote",
|
|
7
|
+
"currency": "DZD",
|
|
8
|
+
"price": 900,
|
|
9
|
+
"compareAtPrice": null,
|
|
10
|
+
"type": "PHYSICAL",
|
|
11
|
+
"hasVariants": false,
|
|
12
|
+
"variantOptions": null,
|
|
13
|
+
"sku": "CANVAS-TOTE",
|
|
14
|
+
"inventory": 76,
|
|
15
|
+
"trackInventory": true,
|
|
16
|
+
"lowStockThreshold": 5,
|
|
17
|
+
"categoryId": "fixture:category:accessories",
|
|
18
|
+
"tags": [
|
|
19
|
+
"essentials"
|
|
20
|
+
],
|
|
21
|
+
"descriptionPlain": "حقيبة متينة من القماش لكل يوم.",
|
|
22
|
+
"category": {
|
|
23
|
+
"id": "fixture:category:accessories",
|
|
24
|
+
"name": "إكسسوارات",
|
|
25
|
+
"slug": "accessories",
|
|
26
|
+
"description": "ما تحتاجه كل يوم.",
|
|
27
|
+
"parentId": null,
|
|
28
|
+
"image": null,
|
|
29
|
+
"metaTitle": null,
|
|
30
|
+
"metaDescription": null,
|
|
31
|
+
"metaKeywords": null,
|
|
32
|
+
"position": 101,
|
|
33
|
+
"createdAt": "2026-10-23T18:00:00.000Z",
|
|
34
|
+
"updatedAt": "2026-10-23T18:00:00.000Z"
|
|
35
|
+
},
|
|
36
|
+
"variants": [],
|
|
37
|
+
"images": [],
|
|
38
|
+
"quantityPricing": {
|
|
39
|
+
"offerId": "fixture:offer:tote-tiers",
|
|
40
|
+
"name": "عرض الكمية",
|
|
41
|
+
"triggerVariantId": null,
|
|
42
|
+
"tiers": [
|
|
43
|
+
{
|
|
44
|
+
"quantity": 2,
|
|
45
|
+
"price": 1600,
|
|
46
|
+
"freeShipping": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"quantity": 3,
|
|
50
|
+
"price": 2100,
|
|
51
|
+
"freeShipping": true
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"offers": [],
|
|
56
|
+
"reviewStats": {
|
|
57
|
+
"avgRating": 4.7,
|
|
58
|
+
"reviewCount": 3
|
|
59
|
+
},
|
|
60
|
+
"metaTitle": null,
|
|
61
|
+
"metaDescription": null
|
|
62
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "fixture:product:shirt",
|
|
3
|
+
"name": "قميص كتان",
|
|
4
|
+
"description": "<h3>لماذا ستحبه</h3><ul><li>كتان 100%</li><li>قصة مريحة</li></ul><p><strong>نصيحة:</strong> اغسله على 30°.</p>",
|
|
5
|
+
"descriptionFormat": "html",
|
|
6
|
+
"handle": "linen-shirt",
|
|
7
|
+
"currency": "DZD",
|
|
8
|
+
"price": 2400,
|
|
9
|
+
"compareAtPrice": 2900,
|
|
10
|
+
"type": "PHYSICAL",
|
|
11
|
+
"hasVariants": true,
|
|
12
|
+
"variantOptions": [
|
|
13
|
+
{
|
|
14
|
+
"name": "المقاس",
|
|
15
|
+
"values": [
|
|
16
|
+
{
|
|
17
|
+
"value": "S"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"value": "M"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"value": "L"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"sku": null,
|
|
29
|
+
"inventory": 36,
|
|
30
|
+
"trackInventory": true,
|
|
31
|
+
"lowStockThreshold": 5,
|
|
32
|
+
"categoryId": "fixture:category:clothing",
|
|
33
|
+
"tags": [
|
|
34
|
+
"essentials"
|
|
35
|
+
],
|
|
36
|
+
"descriptionPlain": "لماذا ستحبه كتان 100% قصة مريحة نصيحة: اغسله على 30°.",
|
|
37
|
+
"category": {
|
|
38
|
+
"id": "fixture:category:clothing",
|
|
39
|
+
"name": "ملابس",
|
|
40
|
+
"slug": "clothing",
|
|
41
|
+
"description": "ملابس مريحة لكل يوم.",
|
|
42
|
+
"parentId": null,
|
|
43
|
+
"image": null,
|
|
44
|
+
"metaTitle": null,
|
|
45
|
+
"metaDescription": null,
|
|
46
|
+
"metaKeywords": null,
|
|
47
|
+
"position": 100,
|
|
48
|
+
"createdAt": "2026-10-23T18:00:00.000Z",
|
|
49
|
+
"updatedAt": "2026-10-23T18:00:00.000Z"
|
|
50
|
+
},
|
|
51
|
+
"variants": [
|
|
52
|
+
{
|
|
53
|
+
"id": "fixture:variant:shirt:s",
|
|
54
|
+
"variations": {
|
|
55
|
+
"المقاس": "S"
|
|
56
|
+
},
|
|
57
|
+
"price": 2400,
|
|
58
|
+
"compareAtPrice": null,
|
|
59
|
+
"sku": "LINEN-SHIRT-S",
|
|
60
|
+
"inventory": 12,
|
|
61
|
+
"lowStockThreshold": 5,
|
|
62
|
+
"imageId": null,
|
|
63
|
+
"isDefault": true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "fixture:variant:shirt:m",
|
|
67
|
+
"variations": {
|
|
68
|
+
"المقاس": "M"
|
|
69
|
+
},
|
|
70
|
+
"price": 2400,
|
|
71
|
+
"compareAtPrice": null,
|
|
72
|
+
"sku": "LINEN-SHIRT-M",
|
|
73
|
+
"inventory": 14,
|
|
74
|
+
"lowStockThreshold": 5,
|
|
75
|
+
"imageId": null,
|
|
76
|
+
"isDefault": false
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "fixture:variant:shirt:l",
|
|
80
|
+
"variations": {
|
|
81
|
+
"المقاس": "L"
|
|
82
|
+
},
|
|
83
|
+
"price": 2600,
|
|
84
|
+
"compareAtPrice": null,
|
|
85
|
+
"sku": "LINEN-SHIRT-L",
|
|
86
|
+
"inventory": 10,
|
|
87
|
+
"lowStockThreshold": 5,
|
|
88
|
+
"imageId": null,
|
|
89
|
+
"isDefault": false
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"images": [],
|
|
93
|
+
"quantityPricing": null,
|
|
94
|
+
"offers": [
|
|
95
|
+
{
|
|
96
|
+
"id": "fixture:offer:shirt-gift",
|
|
97
|
+
"name": "اشترِ 2 واحصل على حقيبة هدية",
|
|
98
|
+
"discountType": "free",
|
|
99
|
+
"triggerQuantity": 2,
|
|
100
|
+
"triggerVariantId": null,
|
|
101
|
+
"rewardQuantity": 1,
|
|
102
|
+
"rewardProductId": "fixture:product:gift-bag",
|
|
103
|
+
"rewardProductName": "حقيبة هدية",
|
|
104
|
+
"rewardVariantId": null,
|
|
105
|
+
"rewardVariantLabel": null,
|
|
106
|
+
"rewardUnitPrice": 1200
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "fixture:offer:shirt-ship",
|
|
110
|
+
"name": "3 قطع والتوصيل مجاني",
|
|
111
|
+
"discountType": "free_shipping",
|
|
112
|
+
"triggerQuantity": 3,
|
|
113
|
+
"triggerVariantId": null,
|
|
114
|
+
"rewardQuantity": 0,
|
|
115
|
+
"rewardProductId": null,
|
|
116
|
+
"rewardProductName": "",
|
|
117
|
+
"rewardVariantId": null,
|
|
118
|
+
"rewardVariantLabel": null,
|
|
119
|
+
"rewardUnitPrice": null
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"reviewStats": {
|
|
123
|
+
"avgRating": 4.7,
|
|
124
|
+
"reviewCount": 3
|
|
125
|
+
},
|
|
126
|
+
"metaTitle": null,
|
|
127
|
+
"metaDescription": null
|
|
128
|
+
}
|