v0.0.2
Demos (demo panel, opens in a new tab)

E-commerce

Install the ready-made store themes, connect them to your store, customize them or write your own theme; to see them all live, open the demo store.

Note

The store pages, the <zb:shop.*> components and the Nova, Vivid, Atelier and Volt themes are in Zubazar UI Pro; no panel is needed: License.

Shortest example

bash
composer require zubazar/ui-pro
php artisan zubazar:themes
npm run build

zubazar:themes writes the enabled themes' CSS and fonts into the application. Then add @import './zb-themes.css'; to the CSS entry and the zb.theme:commerce middleware to the store routes.

Installation

  1. Install the package: Adding Zubazar UI Pro to an existing project, steps 1–3. The free package comes along.

  2. Pick the themes. The themes the store offers are the themes list in config/zubazar-ui-pro.php; only the listed ones are registered, shown in the switcher and compiled. To publish the config file: php artisan vendor:publish --tag=zubazar-ui-pro-config.

  3. Write the theme files. php artisan zubazar:themes writes resources/css/zb-themes.css and resources/js/zb-themes.js. Run it again whenever you change the list; in CI, --check fails when the files are out of date.

  4. Add the CSS and the fonts (Fonts):

    css
    /* resources/css/zubazar-ui.css */
    @import 'tailwindcss';
    @import '@zubazar/ui';
    @import './zb-themes.css';
    
    @source '../../vendor/zubazar/ui/resources/views';
    
    js
    // vite.config.js
    import { themeFonts } from './resources/js/zb-themes.js';
    
    fonts: [bunny('Public Sans', …), bunny('DM Mono', …), ...themeFonts(bunny)],
    
  5. Add the JavaScript entry. The store's menus, filters, gallery and cart use no Alpine; the storefront entry sets up their behavior and downloads only on store pages. If the panel entry (import '@zubazar/ui-pro';) is already loaded, you don't need this line.

    js
    // resources/js/zubazar-ui.js
    import '@zubazar/ui';
    import '@zubazar/ui-pro/storefront';
    
    php
    // config/zubazar-ui-pro.php, the 'commerce' section (default: app.css and app.js)
    'vite' => ['resources/css/zubazar-ui.css', 'resources/js/zubazar-ui.js'],
    

    package.json needs the line "@zubazar/ui-pro": "file:vendor/zubazar/ui-pro".

Connecting your store

The themes never touch your database; they see the store through the Zubazar\Commerce\Contracts\Storefront interface. Extend BaseStorefront; four methods are required:

php
namespace App\Support;

use Zubazar\Commerce\BaseStorefront;
use Zubazar\Commerce\Data\Category;
use App\Models\Kategori;
use App\Models\Urun;
use Illuminate\Support\Collection;

final class Magaza extends BaseStorefront
{
    public function name(): string
    {
        return 'My Store';
    }

    public function categories(): Collection
    {
        return Kategori::query()->orderBy('sira')->get()
            ->map(fn (Kategori $kategori) => new Category($kategori->id, $kategori->slug, $kategori->ad));
    }

    public function category(string $slug): ?Category
    {
        return $this->categories()->firstWhere('slug', $slug);
    }

    public function productCount(?Category $category = null): int
    {
        return $category ? Urun::where('kategori_id', $category->id)->count() : Urun::count();
    }
}
php
// app/Providers/AppServiceProvider.php › register()
$this->app->singleton(\Zubazar\Commerce\Contracts\Storefront::class, \App\Support\Magaza::class);

The other methods have defaults; override the ones you need:

Method What it gives Default
menu() The main menu Home, Products, Categories, Deals
categoryMenu() The mega menu's tree (Navbar) The categories
headerLinks(), topLinks() Links in the header (account, favorites) and in the top strip None
footerLinks(), footerNote() Footer columns and the note next to the copyright line. None
languages() The store's languages; with more than one, a language switcher appears One language
freeShippingThreshold(), shippingFee() Free shipping threshold and shipping fee (minor units) None, 0
maxQuantity() The largest quantity of a cart line 10

Product and category data

The themes read the store through Zubazar\Commerce\Shop (Shop::name(), Shop::categories()) and the Zubazar\Commerce\Data objects (Product, Category, CartLine).

Field What it does
images The product's photos (URLs or url, alt, width, height): the first on the card, in the cart and at checkout, all of them in the gallery. The gallery opens full screen
visual The drawing of a product without photos (shape, hue); with commerce.placeholder_views 3, three angles in the gallery
color_images Photos per colour: {"black": ["/img/aura-black-1.jpg"]}. Picking a colour switches the gallery to it, and the cart shows that colour's photo. A colour without photos uses the product's
brand The brand's name: above the name on the product page, in the filters' Brand section. With brand_url it links to the brand's page
price The price in the minor unit. Leave it out of a product whose price is hidden (null): it says "Price on request" and is only quoted (Selling and quotes)
option_name, color_name The purchase box's names for the option and colour rows: "Weight: 1 kg" (one per language too); without them "Option", "Colour"
thumb, zoom, srcset, sizes in images The photo's copies: thumb in the thumbnails, zoom (a large copy) in the magnifier and the full screen, srcset the copies the page picks by width. An unsafe address is left out
badges The store's own badges on the card: [['label' => 'On offer', 'tone' => 'success'], '3 options'] (tone: primary, secondary, success, danger, warning, info, dark). With a stock of 0 the card adds "Out of stock" itself and leads to the product page
favorite Whether it is the visitor's favourite: the card's heart is full (Favourites)
choose true: something has to be chosen on the product page first (your own variant picker); the card leads to the page instead of adding. Without it: when the product has sizes
ratings false: no stars and no Reviews tab for this product
description_html true: the description is cleaned HTML (lists, headings), printed as it is. Cleaning it is the application's job; otherwise the description is escaped text
group in specs A heading in the Specifications tab: ['label' => 'Power', 'value' => '12 kW', 'group' => 'Energy']. Without specs there is no tab
reviews With 0, no rating is drawn on the card
image (category) The category card, the category pages and the mega menu show it instead of the drawing
parent (category) The parent category's slug: the filters draw the categories as a tree, a category page offers its own subcategories. Bringing a subcategory's products when its parent is ticked is the application's job

Routes and pages

The store routes sit inside the zb.theme:commerce middleware; the middleware picks the request's theme from the setting (commerce.theme):

php
// routes/web.php
use Zubazar\Themes\Themes;

Route::middleware('zb.theme:commerce')->group(function () {
    Route::get('/', HomeController::class)->name('home');
    Route::get('/products/{slug}', [ProductController::class, 'show'])->name('web.products.show');
    // … the other routes in the table
});

The themes link to these route names (Shop::ROUTES):

Route name Page
home Home
web.products.index, web.products.show Product list, product
web.categories.index, web.categories.show Categories, one category
web.cart, web.checkout Cart, checkout
web.quote The quote list (only in a store with quotes)
locale The language switcher (only with several languages)

A controller returns the page in the current theme's view; a Livewire page (cart, checkout) uses the store's layout:

php
return view(Themes::view('commerce', 'pages.products.show'), [
    'product' => $urun,
    'category' => $urun->category(),
    'related' => $benzerler,
    'reviews' => $reviews,   // optional
    'ratings' => [5 => 225, 4 => 59, 3 => 19, 2 => 6, 1 => 3],
    'highlights' => [['icon' => 'truck', 'label' => __('Ships in 1–2 business days')]],
]);

// Livewire: ->layout(Themes::layout('commerce'))->title('My cart')

The cart counter, add to cart, product purchase and newsletter are your Livewire components and your views; the kit gives them content-free parts (Shop::LIVEWIRE, below).

Your buttons and words

The kit is free of content: it draws no "Add to cart", "Request a quote" or "Proceed to checkout" button and no such words. You give them and what they do; the kit manages the place, the size, when they show, the loading state and accessibility. Changing a word never touches the kit.

Place The kit's part Yours
Product card zb:shop.product-card: places corner (the picture's corner), overlay (the picture's foot), action (beside the price), footer (the card's foot) Your card view (commerce.card.view) and the buttons in it; zb:shop.icon-button for the corner
Purchase box zb:shop.purchase-box: colour, option, quantity, stock line Your web.product-purchase view and its buttons
Navbar zb:shop.count-link: icon, count, name Your web.cart-count view; commerce.navbar_links for a cart and a quote list
Cart, checkout, quote list zb:shop.cart-page, zb:shop.checkout-page, zb:shop.quote-page Your Livewire views; slots checkout, submit, terms, actions, empty, done
Newsletter zb:shop.newsletter: the e-mail field Your web.newsletter-form view and its button

A card view (resources/views/shop/product-card.blade.php, commerce.card.view: 'shop.product-card'):

blade
<zb:shop.product-card :product="$product" :key-prefix="$keyPrefix" :class="$class ?? null">
    <zb:slot:corner>
        <zb:shop.icon-button icon="eye" :label="__('Quick view')" data-zb-shop-quick-view="{{ $product->slug }}" />
    </zb:slot:corner>
    <zb:slot:action>
        <livewire:web.add-to-cart :slug="$product->slug" :key="$keyPrefix.'-'.$product->slug" />
    </zb:slot:action>
</zb:shop.product-card>

The corner and the picture's foot show under a mouse (always on a touch screen; always with reveal="always"). The kit's behaviour hooks work on your buttons: data-zb-shop-add-to-cart on a wrapper ("Added" and the flight to the cart on cart-updated; ="quote": quote-updated, to the quote list), data-zb-shop-quick-view, data-zb-shop-favorite. The demo (demos/resources/views/magaza/) shows every part in use.

On a narrow card (under 13rem: two columns on a phone) mark the words of the button beside the price with data-card-label: they stay for screen readers only and the button shows its icon (<span data-card-label>{{ __('Add') }}</span>). An unmarked button that does not fit goes under the price. The card is a container (shop-card); to change anything else by the card's width use Tailwind's container query: @max-[13rem]/shop-card:w-full.

Quick view

SHOP_CARD_QUICK_VIEW=true gives the store a quick view: the product opens in a modal without leaving the list (the gallery, the price, the purchase box). Its button is yours: one with data-zb-shop-quick-view="{{ $product->slug }}" in your card view (e.g. zb:shop.icon-button icon="eye"). The modal opens at once; your application's web.quick-view component loads the product:

php
namespace App\Livewire\Web;

use Livewire\Attributes\On;
use Livewire\Component;

final class QuickView extends Component
{
    public ?string $slug = null;

    #[On('quick-view')]
    public function show(string $slug): void
    {
        $this->slug = $slug;
    }

    public function render()
    {
        return view('zubazar-ui-pro::commerce.livewire.quick-view', [
            'product' => $this->slug ? Product::find($this->slug) : null,  // Zubazar\Commerce\Data\Product
        ]);
    }
}

zb:shop.document puts the component on every store page itself. The purchase box in the modal is your web.product-purchase component; give it a public string $gallery = 'product-gallery' property to take the gallery value. An added product flies to the cart (Fly to cart).

Page data

Reviews, promises and hero figures are page data; a section without data is not drawn.

Page Variable Content
Product $reviews Zubazar\Commerce\Data\Review objects or rows: name, rating (1–5), text, date, verified (shows "Verified purchase")
Product $ratings Stars => count; the rating bars are worked out from it
Product $highlights The promises under the purchase box: icon, label
Home $stats The figures in the hero (the shared hero, Nova): value, label
Product $tabs Your own tabs: [['value' => 'questions', 'label' => 'Questions', 'icon' => 'chat-bubble-left-right', 'badge' => 3, 'content' => 'product.questions', 'data' => [...]]]. content is a view name (a Livewire component inside it works; drawn with $product) or an HtmlString
Product $beforePurchase, $afterPurchase Your own content over and under the purchase box (a variant picker, share buttons, "tell me when it is back"); like content
Product $reviewsAction, $reviewActions An action over the reviews ("Write a review") and actions under each review (with $review: like, report; the review's id)
Cart $cartNote A short note under the summary ("Sign in to send your quote")
Checkout $checkoutNote A short note under the summary
Product list, category $choices The filters' brand, colour and size choices with their product counts: ['brands' => ['Sonora' => 2], 'colors' => ['black' => 10], 'sizes' => ['M' => 1]], and the store's own groups (groups, below); without it those sections are not drawn

The product list and its filters

The filters live in the URL: q, category[] (several categories), min, max, sale, stock, brand[], color[], size[] and sort. ProductFilters::fromRequest() reads them; you apply them to your own query. For the category tree, pass categories with the subcategories too. On a phone, while the panel is open, a choice fetches the same page address in the background and renews the panel; it needs no server code of its own. Filtering and counting the choices is your code; an example with a collection:

php
use Zubazar\Commerce\Data\ProductFilters;

$filters = ProductFilters::fromRequest($request);
$products = $catalog->filter(fn ($product) =>
    ($filters->categories === [] || in_array($product->categorySlug, $filters->categories, true))
    && ($filters->min === null || $product->price >= $filters->min * 100)
    && ($filters->max === null || $product->price <= $filters->max * 100)
    && (! $filters->sale || $product->onSale())
    && (! $filters->inStock || $product->stock > 0)
    && ($filters->brands === [] || in_array($product->brand, $filters->brands, true))
    && ($filters->colors === [] || array_intersect($product->colors, $filters->colors) !== [])
    && ($filters->sizes === [] || array_intersect($product->sizes, $filters->sizes) !== [])
); // the search and the sort are yours too

return view(Themes::view('commerce', 'pages.products.index'), [
    'filters' => $filters,
    'products' => $page,                                // LengthAwarePaginator
    'categories' => $categories,
    'category' => null,
    'choices' => [                                      // the choices and their product counts
        'brands' => $catalog->whereNotNull('brand')->countBy('brand')->all(),
        'colors' => $catalog->pluck('colors')->flatten()->countBy()->all(),
        'sizes' => $catalog->pluck('sizes')->flatten()->countBy()->all(),
    ],
]);

Your own filter groups (technical specs) live in the URL under their own names: fromRequest($request, ['spec']) reads them, $filters->group('spec') gives the chosen values. Give their choices in choices.groups; several groups may share a name:

php
$filters = ProductFilters::fromRequest($request, ['spec']);

'choices' => [
    'groups' => [
        ['key' => 'energy', 'param' => 'spec', 'label' => 'Energy type', 'options' => ['gas' => 12, 'electric' => ['label' => 'Electric', 'count' => 4]]],
        ['key' => 'series', 'param' => 'spec', 'label' => 'Series', 'options' => $series, 'searchable' => true],
    ],
],

Each group is drawn in its own section, the chosen values show as chips at the top and count as filters. A list longer than eight shows eight and "Show all", and a search field narrows it. The category tree's branches open and close; a branch that holds a ticked category starts open.

With commerce.list_more on, "Show more" replaces the page numbers: the next page's cards join the list (without JavaScript it goes to the next page).

Selling and quotes

Whether a product sells, is quoted or shows its price are your rules; the kit decides nothing, it draws what you give:

  • Hiding a price: send a product whose price is hidden without price (null). The kit writes "Price on request" instead; the hidden price never reaches the page's HTML. Leave it out of your structured data (JSON-LD) and API responses too.
  • Buttons: your card view and your purchase view put "Add to cart", "Request a quote" or both, as the product needs; refuse a direct request on your server too.
  • A quote list: keeping it apart from the cart is yours. The kit lets your commerce.navbar_links view put an zb:shop.count-link (target="quote") beside the cart, and draws the quote list page with zb:shop.quote-page: the lines (increment(key), decrement(key), remove(key)), the form (name, phone, email, company, note; requestQuote()) and the thanks with $quoteNumber. The buttons are yours in the submit, empty and done slots. Validation, keeping, numbering, rate limiting and the admin panel are your code.
  • Added and the flight: put data-zb-shop-add-to-cart="quote" on your quote button's wrapper and send quote-updated after a successful add: the button says "Added" and the picture flies to the quote list (data-zb-quote-target).

Favourites

The heart is your button: <zb:shop.icon-button icon="heart" :label="__('Add to favourites')" :pressed="$product->favorite" data-zb-shop-favorite="{{ $product->slug }}" /> in your card view. A click turns it at once and sends the Livewire event favorite-toggled (slug, favorite) and zb:shop-favorite on the page; a chosen heart stays shown outside the mouse too. Keeping it is yours; send favorite-state to undo it (a guest, an error):

php
#[On('favorite-toggled')]
public function favourite(string $slug, bool $favorite): void
{
    if (! auth()->check()) {
        $this->dispatch('favorite-state', slug: $slug, favorite: false);
        return;
    }
    // keep it
}

Choosing a theme

dotenv
SHOP_THEME=vivid
  • Which theme opens: commerce.theme; if that theme is not enabled, the first in the list. The package keeps no visitor choice on the server: it reads neither ?theme= nor a cookie.
  • Visitor settings: SHOP_THEME_SWITCHING=true adds a gear on the right edge: light/dark, colour, width and language, chosen and kept in the browser. Details: Store settings.
  • A theme, navbar or footer choice (a demo): the application's own code. It sets the request's setting itself (config(['zubazar-ui-pro.commerce.theme' => …])) and gives the panel its links: Themes::linkUsing(fn (string $kind, ?string $key) => …) (theme, navbar, footer, reset). Without links these sections are not shown.
  • On the page: <html data-theme="vivid">; in dark mode vivid-dark.
  • Choices are separate: the visitor's choice is kept in the store's scope (localStorage['zubazar-ui:shop']); a choice in the panel does not change the store.

Customizing

What changes How
Theme, navbar, footer, color, width Settings
Colors, fonts, corners, shadows, background Variables
A page, a part or a component Changing pages
Texts Texts
Everything Your own theme

The store's color

Nova is purple, Vivid coral, Atelier green, Volt electric blue. To use your store's color in every theme:

dotenv
SHOP_BRAND_COLOR=#0f766e

Preset names work too: default, green, red, yellow, blue, gray, dark. The color is measured against every theme's backgrounds; with a light color, a darker tone keeps the text readable. While the settings panel is on, it is only the starting color.

Variables

A store theme is a data-theme pair (nova, nova-dark); its look comes from CSS variables:

Variable What it changes Class
--zb-tone-primary The primary color; --zb-tone-primary-dark the text tone in dark mode, --zb-tone-on-primary the text on the fill bg-primary, text-primary-ink
--zb-font-sans, --zb-font-display Text and heading fonts font-sans, font-display
--zb-radius Corners; --zb-radius-check the checkbox rounded-*
--zb-page, --zb-page-pattern, --zb-page-pattern-size Page background and its texture bg-page
--zb-surface, --zb-line Card background, lines bg-surface, border-line
--zb-bar Navbar rows, category rail, footer bar bg-bar
--zb-shadow-card, --zb-shadow-lift Card shadow; the shadow of a card under the pointer shadow-card, shadow-lift

Write the block after the @import './zb-themes.css'; line and inside @layer base:

css
@layer base {
    :is([data-theme='nova'], [data-theme='nova-dark']) {
        --zb-radius: 0.75rem;
        --zb-shadow-card: 0 0 0 1px var(--zb-line);
    }
}

Light mode only: [data-theme='nova']; dark only: [data-theme='nova-dark']; every theme: [data-theme]. Every color name: Colors.

Warning

If you set the primary color as a variable, the text on the fill must read 4.5:1. If unsure, use brand_color.

Fonts

  1. The variable: --zb-font-sans: var(--font-inter, 'Inter'), ui-sans-serif, system-ui, sans-serif;
  2. In the fonts list of vite.config.js: bunny('Inter', { weights: [400, 500, 600, 700], subsets: ['latin', 'latin-ext'] }).
  3. In the view of the head setting: @zubazarFonts(['inter']).

In your own theme, listing the font in the fonts field of theme.php is enough.

Changing pages

Themes::view('commerce', 'partials.hero') looks first at the theme's view, else at the package's shared view; a copy in the application wins over both. Copy only the file you change:

bash
mkdir -p resources/views/vendor/ecommerce-vivid/partials
cp vendor/zubazar/ui-pro/themes/commerce/vivid/views/partials/hero.blade.php resources/views/vendor/ecommerce-vivid/partials/
Copy What it changes
resources/views/vendor/ecommerce-{theme}/partials/hero.blade.php That theme's hero
resources/views/vendor/ecommerce-{theme}/sections/navbar.blade.php That theme's navbar (the same for footer)
resources/views/vendor/zubazar-ui-pro/commerce/pages/products/show.blade.php The product page, in themes without a copy of their own
resources/views/vendor/zubazar-ui-pro/components/shop/product-card.blade.php The <zb:shop.product-card> component

A copy of an zb:shop.* component goes in a components/shop/ folder (vendor/zubazar-ui-pro/components/shop/logo.blade.php or vendor/ecommerce/components/shop/logo.blade.php); without that folder the copy is not read.

The parts you can replace: sections/navbar, sections/footer, partials/hero, partials/promo, partials/product-browser, partials/product-filters, pages/….

  • Write colors with color names (bg-surface, text-muted); for a dark section data-theme="{{ \Zubazar\Ui\Support\Appearance::dark() }}".
  • A copy replaces its original entirely; compare it when the package is updated.

Texts

A key in the application's lang/tr.json wins over the package's:

json
{
    "Add to cart": "Sepete at",
    "Free shipping over :amount": ":amount üzeri kargo bizden"
}

Your own theme

A theme is a folder of data only: themes/commerce/{key}/. The pages come from the package; a theme gives only what differs. In other products the folder is themes/{product}/{key}/.

php
<?php // themes/commerce/kampanya/theme.php

return new \Zubazar\Themes\Theme(key: 'kampanya', name: 'Kampanya', dark: 'kampanya-dark', contract: 1);
php
// app/Providers/AppServiceProvider.php › boot()
use Zubazar\Themes\Themes;

foreach (Themes::discover(base_path('themes')) as $theme) {
    $theme = Themes::register($theme);
    $this->loadViewsFrom($theme->path.'/views', $theme->views);
    $this->loadJsonTranslationsFrom($theme->path.'/lang');
}

Then SHOP_THEME=kampanya, php artisan zubazar:themes and npm run build. To offer only your own theme, 'themes' => []. The views go into the ecommerce-kampanya namespace.

The theme file

Field What it does Default
key The key: the setting, data-theme. Lowercase letters, digits, dashes; not light, dark, system or default, not ending in dark required
name The name shown in the switcher required
product The theme's product commerce
dark The dark member's name, ending in dark; null: light only null
style, description The style name and description in the switcher empty
fonts Fonts: 'plus-jakarta-sans' or 'inter' => ['family' => 'Inter', 'weights' => [400, 600]] []
navbar, footer A preset (marketplace, standard) or own own
look The style of the switcher's miniature: default, modern, classic default
targets The darkest light background a color must read on: ['light' => '#f3f7f6'] the kit's backgrounds
contract The contract version (Shop::CONTRACT, 1 today); registering fails when it differs current

The variable file

One @layer base block; write only what differs from the kit. Start the variables only your own views read with the key (--kampanya-glow).

css
/* themes/commerce/kampanya/theme.css */
@layer base {
    :is([data-theme='kampanya'], [data-theme='kampanya-dark']) {
        --zb-tone-primary: #0f766e;
        --zb-radius: 1.25rem;
    }

    [data-theme='kampanya'] { --zb-page: #f3f7f6; }
    [data-theme='kampanya-dark'] { --zb-bar: #0d1514; }
}

An example that uses every variable: vendor/zubazar/ui-pro/themes/commerce/atelier/theme.css.

The theme's views

Optional; every file in views/ replaces the shared view: sections/navbar, sections/footer (other themes can pick them as the kampanya preset), partials/hero, any partials/… or pages/… under the same name, layout.

bash
mkdir -p themes/commerce/kampanya/views/partials
cp vendor/zubazar/ui-pro/resources/views/commerce/partials/hero.blade.php themes/commerce/kampanya/views/partials/

Warning

Do not copy another theme's whole folder: Vivid's views read the --vivid-* variables, which stay undefined in a copy.

The views read the store only through Shop, the Data objects and Shop::ROUTES. The theme's texts are English keys; their Turkish is in the theme's lang/tr.json.

Trying the theme

php
public function test_every_page_draws_in_the_theme(): void
{
    config(['zubazar-ui-pro.commerce.theme' => 'kampanya']);

    $this->get(route('home'))->assertOk()->assertSee('data-theme="kampanya"', false);
    $this->get(route('web.products.index'))->assertOk();
    $this->get(route('web.cart'))->assertOk();
}

Theme package

To use the theme in other projects, move the folder to a Composer package ("zubazar/ui-pro": "^2.0"). The package's service provider runs the registration loop above with Themes::discover(__DIR__.'/../themes'), inside $this->app->booted(function () { … }) in boot(); the order of providers is not fixed.

Settings

config/zubazar-ui-pro.php; the environment variable in brackets:

Setting What it does Default
themes The enabled themes; after a change, php artisan zubazar:themes ['nova', 'atelier', 'vivid', 'volt']
commerce.theme The store's theme (SHOP_THEME) nova
commerce.switching The visitor's settings panel: light/dark, colour, width, language; in the browser (SHOP_THEME_SWITCHING) false
commerce.brand_color A preset name or #rrggbb (SHOP_BRAND_COLOR) null
commerce.layout The view name of your own layout (SHOP_LAYOUT) null
commerce.navbar One navbar preset in every theme (SHOP_NAVBAR) null
commerce.footer One footer preset in every theme, standard (SHOP_FOOTER) null
commerce.content_width The pages' width: default (1280 px), wide (1440), wider (1600), full or 1520px. Grids add columns as it grows; while the settings panel is on, it is the starting value (SHOP_CONTENT_WIDTH). See Content width default
commerce.ratings Ratings and the Reviews tab (SHOP_RATINGS) true
commerce.image_aspect The product pictures' shape (the cards, the gallery, the cart, checkout, the hero and the mega menu): default (cards 4:3.6, the gallery square), square, portrait (3:4, model photos). One card takes its own with aspect (SHOP_IMAGE_ASPECT) default
commerce.gallery_thumbs The product page gallery's thumbnails: bottom · left (a vertical strip on the left from 1024px, under the pictures on a phone). A page may pass its own: ['thumbs' => 'left'] (SHOP_GALLERY_THUMBS) bottom
commerce.image_fit How a product photo sits in its box, in the same places: cover (edge to edge) · contain (the whole photo with a margin, on the card colour; for photos on a white ground) (SHOP_IMAGE_FIT) cover
commerce.heading_size The size of the section and page titles: sm, md, lg. One heading takes its own with size (SHOP_HEADING_SIZE) lg
commerce.placeholder_views Drawings of a product without photos: 1 or 3 (SHOP_PLACEHOLDER_VIEWS) 1
commerce.logo The store's logo image instead of the theme's lettering: ['light' => '/logo.svg', 'dark' => '/logo-white.svg', 'alt' => 'Store', 'height' => '2.5rem'] or the URL alone. When a panel keeps it, set it with config([...]) in a service provider null
commerce.newsletter The newsletter box in the footers and on the home page; false: none anywhere true
commerce.promises The store's promises (home page, footers, cart): [['icon' => 'truck', 'title' => '…', 'text' => '…']]; [] none; null the kit's own null
commerce.payment_methods The payment methods in the footers: [['icon' => 'credit-card', 'label' => 'Credit card']]; [] none; null card, transfer, cash on delivery null
commerce.contact A Contact column in every footer: address, phone, whatsapp, email, hours (each optional) null
commerce.tagline The line under the logo in the footers; null the footer's own null
commerce.deal A deal box in the navbars that have a place for one (Volt): eyebrow, title, url, icon; null none null
commerce.stock_note The purchase box's line for a product in stock (a translation key); null "Available", for a store that promises no shipping time In stock, ships in 1–2 business days
commerce.card.view Your card view the theme draws every card with: your buttons in the card's places (Your buttons) null
commerce.navbar_links Your view in the navbar's cart place: your cart and quote list links (it gets $variant); without it web.cart-count null
commerce.list_more "Show more" instead of page numbers in the product lists (SHOP_LIST_MORE) false
commerce.card.price The card's price line: stacked (the old price on a small line above; a row's prices on one line) · inline (the price with the old one struck through beside it; wraps on a narrow card) (SHOP_CARD_PRICE) stacked
commerce.color_swatch The purchase box's colours (product page, quick view): color (a dot of the colour) · image (the colour's own first photo in a small square; a colour without photos keeps its dot) (SHOP_COLOR_SWATCH) color
commerce.vite The Vite entries of the store pages ['resources/css/app.css', 'resources/js/app.js']
commerce.head A view added to <head>: favicon, analytics null
commerce.language_flags The flag of a language whose country differs from its code ['en' => 'gb']
commerce.currency_symbol The currency sign ₺

With the panel

The panel (/admin) and the store (/) use the same kit. Panel pages are drawn in the panel's layouts, store pages in <zb:shop.document>. The panel's CSS (@import '@zubazar/ui-pro') and its @source line are only needed for the panel: CSS and JavaScript files.

Troubleshooting

Symptom Fix
The store has no styles, or a new theme does not show php artisan zubazar:themes, @import './zb-themes.css'; in the CSS, npm run build
No commerce theme is enabled Keep at least one theme in the themes list
?theme= changes nothing The package reads no theme from the address (2.6); a choice is the application's code: config(['zubazar-ui-pro.commerce.theme' => …])
The theme's font does not load ...themeFonts(bunny) in vite.config.js
A variable has no effect, or only in one mode After the zb-themes.css line, inside @layer base, both members selected with :is(…)
A copy of a shared view has no effect in one theme Put the copy under resources/views/vendor/ecommerce-{theme}/
Theme key [default] is reserved Pick another key
a dark member's name must end in "dark" dark: 'kampanya-dark'
was made for e-commerce contract 1 Update the theme to the new contract: Upgrading
must return an Zubazar\Themes\Theme End theme.php with return new Theme(…)
Your own theme is not in the switcher Register it in AppServiceProvider

Advanced

Your own layout

Give the layout setting a view name and draw the layout in <zb:shop.document>; the document gives the <head>, the theme, the width, the fonts and the theme switcher:

blade
{{-- config/zubazar-ui-pro.php (commerce): 'layout' => 'layouts.magaza' --}}
<zb:shop.document :title="\Zubazar\Commerce\Shop::pageTitle($title ?? null)" class="flex min-h-dvh flex-col bg-page">
    <div class="bg-inverse py-2 text-center text-sm text-on-inverse">Free shipping over ₺750</div>
    <zb:shop.site-header />
    <main id="main" class="flex-1">@yield('content'){{ $slot ?? '' }}</main>
    <zb:shop.site-footer />
</zb:shop.document>

Put the content of your bands in zb-container (or <zb:container>); it follows the store's width. Details: Document and layout.

More details

  • Ready-made navbars: ten presets and the standard footer work with every theme; the themes' own menus can be picked too (SHOP_NAVBAR=atelier): Navbar, Footer.
  • A theme gallery: Themes::items('commerce') gives the enabled themes with name, description, link and whether each is current.
  • All the views: php artisan vendor:publish --tag=ecommerce-vivid-views copies a theme's views, --tag=zubazar-ui-pro-views every view of the package.

Learn more

Zubazar UI · ZubazarDesigned for people.