Skip to content

Wishlist buttons cause CLS on product listings for guest visitors (unnecessary getAllWishlist fetch) #463

Description

@Prestaplugins

On category, search, and home pages with product listings, the module injects wishlist buttons on each product miniature via JavaScript (product.bundle.js).

For guest visitors (not logged in), the Apollo GraphQL resolver lists still performs a fetch() to the getAllWishlist endpoint on page load. This request:

  1. Is useless — the server cannot return wishlists for anonymous users.
  2. Delays rendering of wishlist buttons on product miniatures.
  3. Causes a Cumulative Layout Shift (CLS) when buttons appear after the initial paint, hurting Core Web Vitals scores.

The shift is visible on product listing pages where .js-product-miniature elements are present.

Environment tested:

  • PrestaShop 9.1.4 (official package)
  • blockwishlist 3.0.2 (native module)
  • Theme: Classic / Classic child
  • Browser: Chrome (Lighthouse / PageSpeed Insights)

Steps to reproduce

  1. Install PrestaShop 9.1.x with the native blockwishlist module enabled.
  2. Log out (or use a private browsing window).
  3. Open a category page or home page with featured products.
  4. Open DevTools → Network tab and filter by getAllWishlist (or blockwishlist).
  5. Observe an XHR/fetch request fired on page load.
  6. Run Lighthouse (Performance) or observe layout shift when circular wishlist buttons appear on product thumbnails after initial render.

Expected behavior

  • No getAllWishlist network request for guest visitors.
  • Wishlist buttons on listing pages should not cause layout shift (or the reserved space should be stable from first paint).
  • Logged-in customers should still see their wishlists and working add-to-wishlist functionality.

Actual Result

  • Guest visitors trigger a getAllWishlist fetch via the lists GraphQL resolver.
  • Wishlist buttons are rendered asynchronously after the AJAX response, shifting product miniature layout (CLS).

PrestaShop version where the bug happens

9.1.4 (also reproducible on 8.x with blockwishlist 2.x/3.x)

How have you installed PrestaShop

Official PrestaShop 9.1.4 package

PHP version(s) where the bug happened

8.1+

Your company or customer's name goes here (if applicable).

Prestaplugins

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions