salla-quick-order

A "quick order" box for a product page that lets a visitor order a product without going through the cart.

A "quick order" box for a product page that lets a visitor order a product without going through the cart. It renders only when the store has the quick order setting enabled, and the store's settings (texts, style, email and agreement requirements) override the matching props on load, so most props are only fallbacks. Guests see a form with name, phone and email fields (and an agreement checkbox if the store requires it). Logged-in users with an email and no required agreement order with a single confirm click. After a successful order it shows the thank-you message and fires quickOrderSubmited. Inputs use native validation and the form fields are labelled by placeholders.

Use it

In HTML or JSX, use the tag <salla-quick-order> with the Attribute names below. In React, the wrapper takes the Property names (camelCase).

import { SallaQuickOrder } from '@salla.sa/twilight-components-react/quick-order';

Client-only. On the server this wrapper renders a placeholder (a skeleton, or nothing), and the real component mounts in the browser. Do not rely on it for content that search engines must see.

Example

import { SallaQuickOrder } from '@salla.sa/twilight-components-react/quick-order';

export function Example() {
  return (
    <SallaQuickOrder productId="123456" />
  );
}

Properties

PropertyAttributeDescriptionTypeDefault
agreementTextagreement-textAgreement text (HTML) shown next to the terms checkbox, truncated to 150 characters with a link to the full text. Only shown when the store requires agreement. Overwritten by the store's quick order settings on load.stringsalla.lang.get( 'pages.checkout.show_full_agreement' )
confirmPayButtonTitleconfirm-pay-button-titleLabel of the main button that opens the form, or confirms the order for one-click users. Overwritten by the store's quick order settings on load.string'اشتر الآن'
isEmailRequiredis-email-requiredWhether the email field is required for guests. It is set to false when the logged-in user has an email. Overwritten by the store's quick order settings on load.booleanfalse
payButtonTitlepay-button-titleLabel of the form submit button. Overwritten by the store's quick order settings on load.string'اطلب المنتج'
productIdproduct-idThe id of the product to order. When not set, it defaults to the page id from the Salla config (page.id).string
quickOrderStylequick-order-styleVisual style of the box: default (uses the theme primary color), gray or white. Overwritten by the store's quick order settings on load."default" | "gray" | "white"'default'
quickOrderTitlequick-order-titleHeading of the box. Overwritten by the store's quick order settings on load.string'ليش تنتظر؟'
subTitlesub-titleText under the heading. Overwritten by the store's quick order settings on load.string'احصل على المنتج مباشرة الآن'
thanksMessagethanks-messageMessage shown after the order is submitted successfully. Overwritten by the store's quick order settings on load.string

Events

Listen with addEventListener, or the on prop of the React wrapper (for example onModalBack).

EventDescriptionDetail
quickOrderSubmitedFires after the quick order is created successfully. It carries no event.detail.any

Renders: <salla-button>, <salla-tel-input>, <salla-modal>.

On this page