Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Product
  • Overview
  • Usage
  • Components Customization
  • Elements
    • Apps Icons
    • Breadcrumb
    • Color Picker
    • Conditional Fields
    • Count Down
    • Filters
    • Infinite Scroll
    • List Tile
    • Loading
    • Map
    • Modal
    • Placeholder
    • Progress Bar
    • Rating Stars
    • Reviews
    • Reviews Summary
    • Sheet
    • Skeleton
    • Slider
    • Social
    • Social Share
    • Tabs
  • Form
    • Button
    • Bottom Alert
    • Contacts
    • Date Time Picker
    • File Upload
    • Menu
    • Quantity Input
    • Select
    • Tel Input
  • Product
    • Add Product
    • Advertisement
    • Comments
    • Conditional Offer
    • Gifting
    • Installment
    • Meta Data
    • Offer
    • Offer Modal
    • Orders
    • Payments
    • Product Availability
    • Product Card
    • Products List
    • Product Options
    • Product Size Guide
    • Products Slider
    • Quick Buy
    • Quick Order
    • Scopes
    • Search
  • User
    • Cart Summary
    • Localization
    • Login
    • Loyalty
    • Rating
    • User Menu
    • User Profile
    • User Settings
    • Verify
  1. Product

Product Options

The <salla-product-options> web component is used to show to the Merchant all the fields that are customizable to curate the experience of personalizing a product prior to ordering it. Read more details on the proper use of each element of the component from here.
Note
Available API Endpoints for the Product Options component are:
Product Details
Upload Gift Image

Example#

Product Options

Usage#

HTML
SASS

Properties#

PropertyAttributeDescriptionTypeDefault
OptionsoptionsProduct detail information.stringundefined
Product IDproduct-idThe Product ID to which the all options will be fetched for.numbersalla.config.get('page.id')

Events#

EventDescriptionType
changedThis event will be fired when the product options is changed.CustomEvent<any>
Information
The changed event in the salla-product-options component, contains some data about the changed options, which is explained in the following structure and example.

Methods#

The pre-defined methods allow for calling functions built by Salla to carry out certain actvities, such as getOption which gets a specific option by its ID.
MethodDescriptionReturn Type
getOption(option_id: any)Gets a specific option by its ID.Promise<Option>
getSelectedOptions()Gets all selected options.Promise<any[]>
getSelectedOptionsData()Gets the IDs of the selected options.Promise<{}>
hasOutOfStockOption()Returns a true value if there is any out of stock options that are selected and vise versa.Promise<boolean>
reportValidty()Reports the options' form validty.Promise<boolean>

JSON Code Structure#

Structure#

NameDescription
eventThe native change event for each option .
optionThe entire changed option data .
detailThe specific item that has been selected in the option.

Example#

detail {id: 123456789, name: 'XL', additional price: 0, option_value: null, image: null, ...}
event {isTrusted: true, type: 'change', target: select.s-form-control, currentTarget: null, eventPhase: 0 ...}
option {id: 1234567899, name: "المقاس", required: true, type: 'single-option', placeholder: 'اختر' ...}
Modified at 2025-03-04 12:54:02
Previous
Products List
Next
Product Size Guide