This tutorial shows how to place a Wishlist Power heart button over the product image in the Broadcast Shopify theme. Start with Add a custom wishlist button if you have not used the web component before.

The code excerpts include surrounding theme code and ... placeholders. Insert the wishlist code at the indicated position; do not paste the surrounding example as a complete file.

Preview

Here’s what it will look like once implemented:

Wishlist heart inside the product image on the Broadcast theme

The heart icon appears in the top-right corner of the product image, toggling between “add” and “remove” states.

Step 1 — Open snippets/product.liquid

  1. From your Shopify admin, go to Online Store → Themes → Edit code.
  2. In the code editor, open the file snippets/product.liquid

Step 2 — Insert the Wishlist Button

Inside the element, paste the following code right below the opening product-images    tag:

...
        <product-images
      class="{{ product_images_classlist }}"
      data-active-media="{{ section.id }}-{{ featured_media.id }}"
      {% if enable_thumbs %}
        data-fader-desktop
      {% endif %}
      {% if enable_thumbs_mobile %}
        data-fader-mobile
      {% endif %}
    >

      <!-- INSERT CODE HERE -->
        <ooo-wl-wishlist-button product-id="{{ product.id }}" handle="{{ product.handle }}" loading>
          <button type="button">
              {%- render 'icon-heart' -%}
          </button>
        </ooo-wl-wishlist-button>
        <style>
          .product__images {
            position: relative;
          }

          ooo-wl-wishlist-button {
            --ooo-wl-icon-color: black;
            --ooo-wl-icon-background-color: black;
            z-index: 10;
            position: absolute;
            top: 10px;
            right: 20px;

            button {
              display: grid;
              width: 50px;
              height: 50px;
              align-items: center;
              justify-content: center;
              background: none;
              border: 0;
              color: var(--ooo-wl-icon-color);
              cursor: pointer

              svg {
                width: var(--icon-size-md);
              }
            }
          }

          /* Show only the Add or Remove button based on state */
          button[aria-checked="true"] svg {
            fill: var(--ooo-wl-icon-background-color);
          }

          button[aria-checked="false"] svg {
            fill: none;
          }

          /* Hide the variant message by default */
          ooo-wl-wishlist-button p {
            display: none;
          }

          /* Show the message if a variant warning is required */
          [show-variant-warning="true"] p {
            display: block;
          }

          /* Loading state */
          ooo-wl-wishlist-button[loading] {
            display: grid;
            border-radius: 2px;
            background: #ebebeb;
            cursor: not-allowed;
            animation: loadingPlaceholder 4s ease infinite;
            animation-delay: -.170s;

            svg {
              display: none;
            }
          }

          @keyframes loadingPlaceholder {
            50% {
              opacity: 1
            }

            75% {
              opacity: .5
            }

            to {
              opacity: 1
            }
          }

          /* Animation when product is added to wishlist */
          ooo-wl-wishlist-button button[aria-busy="true"][aria-checked="true"] svg {
            animation: pulse 0.3s cubic-bezier(.13, -0.3, .2, 1.91);
          }

          @keyframes pulse {
            0% {
              transform: scale(0.9);
            }

            50% {
              transform: scale(1.2);
            }

            100% {
              transform: scale(1);
            }
          }
          </style>
          <!-- END CODE HERE -->

Note: You can adjust the top and right CSS values to position the icon exactly where you want.

Step 3 — Save and Preview

Once you save the file and reload your product page, you should see the heart icon overlaid on the product image.

Clicking the heart will add or remove the product from the wishlist. When active, the icon is filled; when inactive, it’s outlined.

Check your integration

That’s it! 🎉 You’ve successfully added a wishlist heart icon inside the product image on the Broadcast theme.

This integration provides a sleek, customizable button that seamlessly integrates into your product gallery. If you’d like to explore more advanced customization with the Wishlist web component, check out the full documentation here:

👉 Wishlist Button Web Component Documentation