Product actions - block on the PDP which contains main information about the product and main functionality for manipulation with the product. The common actions are selecting or deselecting a specific product type, adding to cart, adding to wishlist, etc.

<aside> ℹ️ Usually, styling this element takes from-to: 5-8h

</aside>

What are the dependencies?

How to theme rating display?

How to theme quantity input?

How to theme a product price?

Where this element can be seen?

Product gallery can be found on the following elements:

How should this element be designed?

Bundle product options

Bundle product options

Grouped product options

Grouped product options

Wishlist and Compare

Wishlist and Compare

Add to cart

Add to cart

Configurable product options

Configurable product options

Title, SKU, stock status, short description

Title, SKU, stock status, short description

The product actions should be displayed accounting for the following:

Please account for the following states:

Design example #1

Design example #2

How to develop styles for this element?

ProductActions is a separate component that renders related elements, there are different methods for desktop and mobile:

How to theme product main details?

In the scope of this part, you should theme elements from this list that are listed in the designs: title, SKU, short description, stock status, and additional data which are in the designs and are available by default or implementation requires only FE adjustments.

How to theme bundle product options?

The ProductBundleItems component renders the bundle product options.

How to theme grouped product options?

Grouped products are rendered by the GroupedProductList component.

How to theme configurable product options?

Configurable options are rendered by the ProductConfigurableAttributes component.

<aside> ➡️ The ProductConfigurableAttributes component is also used on the product list page. Keep that in mind while changing its styles, the designs might be different there.

</aside>

The attribute can be rendered as a swatch list or as a dropdown.

If the attribute is to be rendered as a swatch list, the ProductAttributeValue component will be rendered for each swatch. There, numerous functions can be called depending on the configurable option attribute_type.

If you just want to change some basic styles for the swatches, just changing some variables might be enough. For that:

  1. Override ProductAttributeValue.style.scss as ProductAttributeValue.override.style.scss .
  2. Put the following content inside of it:
:root {
    --option-background-color: <OPTIONS DESIRED BACKGROUND COLOR>;
    --option-check-mark-background: <CHECKMARK BACKGROUND COLOR>;
    --option-size: <SIZE OF EACH OPTION>;
    --option-text-color: <TEXT COLOR>;
    --option-border-color: <BORDER COLOR>;

    @include mobile {
        --option-border-color: <BORDER FOR MOBILE>;
    }
}

<aside> ➡️ Note that depending on the swatch type, some of these styles might not be applied. i.e. background color for color swatches.

</aside>

If it is to be rendered as a dropdown, the ProductConfigurableAttributeDropdown component will be rendered.

How to theme the wishlist button?

The wishlist button is rendered by the ProductWishlistButton component.

The HeartIcon is responsible for rendering the heart icon in the wishlist button.

To change the icon simply override the render method and replace the old path with the desired one.

How to theme compare button?

The ProductCompareButton component renders the product compare button.

The CompareIcon component is responsible for rendering the compare icon.

To change the icon simply override the render method and replace the old path with the desired one.

How to theme add to cart?

The AddToCart component renders the add to cart button.

For changing spacing, orientation, the display, remove or even add some elements, look for the ProductActions component, in there the renderAddToCartActionBlock() function is responsible for rendering the add to cart block on desktop and renderAddToCartMobile(), for mobile.

The example above is a real implementation where the wishlist and compare button were removed and the a new button was added:

renderAddToCartActionBlock() {
        return (
            <div
              block="ProductActions"
              elem="AddToCartWrapper"
              mods={ { isPrerendered: isSSR() || isCrawler() } }
            >
                { this.renderQuantityChanger() }
                { this.renderAddToCartButton() }
                { this.renderMoreDetailsButton() }
            </div>
        );
}

<aside> ➡️ Be aware that the AddToCart component is also used by the ProductCard. So, keep in mind that any changes to this component are also going to be reflected there. Good to use mixin base on passed prop from the route or navigation state to differ element’s location and separate styles

</aside>

Implementation example #1

Implementation example #2