theme
The Theme
object is representing the current theme of the shop, it contains the follow attributes:
Object Fields
Field | Data Type | Description |
---|---|---|
theme.key | String | Returns the key of the theme |
theme.settings | Object | Returns an object of settings of the theme. |
theme.settings.hover_style | String | Selected hover style of the theme. |
theme.settings.categories_collapsed | Boolean | Category list will be collapsed by default when it's enabled. |
theme.settings.mobile_categories_collapsed | Boolean | Category list will be collapsed in mobile view by default when it's enabled. |
theme.settings.image_fill | Boolean | Crop product images to fill into the image view when it's enabled. |
theme.settings.hide_share_buttons | Boolean | Hide social media sharing button in detail pages. |
theme.settings.enabled_quick_cart | Boolean | Enable to this setting to show "instant add to cart" feature for all products listing view. |
Code Example
{% if theme.key == "swanky" and theme.settings.hover_style == "swanky.box" %}
// Do somethings
{% endif %}
Updated about 1 year ago