Component example

<marzipan-products
  collection="store"
  placeholder-items="3"
  .show-cart-quantity="true"
  .show-collection-name="false"
  .show-more-link="true"
  show-more-text="Learn more"
  .redirect-to-cart="false"
></marzipan-products>

Props

Props should be passed as attributes to the component element.

Boolean props have a leading dot. This is to allow the boolean props to be passed as attributes to the component element.

bundle-text

The text to display after the price if the product type is bundle.

E.g £99/case, where case is the bundle-text.

Defaults to bundle

cart-path

The path to the cart page.

Defaults to /cart

collection
required

The slug for the collection to display products from.

.hide-add-to-cart-button
boolean

Whether to hide the “add to cart” button for the product.

Defaults to false

placeholder-items
number

The number of placeholder items to display while the products are loading.

Defaults to 8

.redirect-to-cart
boolean

Whether to redirect to the cart page after adding the product to the cart.

Defaults to false

.show-cart-quantity
boolean

Whether to show the quantity field for the product.

Defaults to false

.show-collection-name
boolean

Whether to show the name of the collection.

Defaults to true

Whether to show a “show more” link.

Defaults to false

.show-more-text

The text to display on the “show more” link.

Defaults to Show more

Styling

The following parts are available to style the products component:

--loading-grid

The containing div of placeholder items that is shown while the products are loading.

--loading-colour

The colour of the placeholder items that is shown while the products are loading.

--product-grid

The containing ul of the products grid.

--product-grid-item

The containing li of a product.

--product-image-container

The containing div of the product image.

--product-image

The product image.

--product-info-container

The containing div of the product info.

--product-name

The product name.

--product-price

The product price.

The “show more” link element.

The products component uses the add to cart component to display the “add to cart” button for each product. If you have set styles for the add to cart component they will be applied to the “add to cart” button with this component.