- Go to Settings -> Product Grid Widget.
- This section contains the HTML structure used to define the Product Card.
- Developers can customize the Product Card based on the requirements.
- This HTML structure uses some standard tags to fill in the information like Title, Price, Image, etc. These tags are listed below in Template variables.
- The Styling of the Product card and other components is added from
frenzy-css.cssfile in theme assets or through Settings -> Global CSS.
Enable the new product cards
The new product cards render each card with React from the same HTML template. They are required for Swatches, the Image Swiper and infinite scroll.Where to add the code
All the options on this page and on the Swatches and Image Swiper pages are global variables (window.*). Add them in the Frenzy callback file, assets/frenzy-callback-function.js, at the top level.
assets/frenzy-callback-function.js
type: How to activate the swiperswiperOptions: Image Swiper optionsonCardRender: Card render hook
Template variables
Use these tags in the Product Card HTML. Frenzy replaces them with the product data.Card behavior
- Secondary image on hover (
grid_show_secondary_image = "1"): only works on desktop, and it is turned off when the Image Swiper is active. - Extra first image:
window.frenzyImageKeyNameputs an image from a product field first in the image list. Only on cards without swatches. - Add to cart follows the Frenzy settings (
product_option_type,stop_direct_add_to_cart_button). If no variant is selected, the first variant with stock is used. When the card has swatches, the selected swatch’s variant is used.
Card render hook
window.productCardOptions.onCardRender is called once per card after it mounts. It receives productCardElement, product, productId, sku, classType, swatches, selectedSwatch and selectedSwatchIndex. Stores can use it to patch the card DOM without touching the bundle.
Example: add the product type as a data attribute
Example: add a badge to cards with a product tag
If
window.productCardOptions already exists in the assets/frenzy-callback-function.js, add ‘onCardRenderer’ to that object instead of creating a new one. Assigning a new object replaces the swiper settings.