Skip to content

Show the customer's wishlists on the back office customer page - #540

Draft
boo-code wants to merge 1 commit into
PrestaShop:devfrom
boo-code:fix/admin-customer-wishlist-block-27143
Draft

boo-code wants to merge 1 commit into
PrestaShop:devfrom
boo-code:fix/admin-customer-wishlist-block-27143

Conversation

@boo-code

@boo-code boo-code commented Sep 4, 2026

Copy link
Copy Markdown
Questions Answers
Description? The card the module renders through displayAdminCustomers never looked the customer up. hookDisplayAdminCustomers() assigned only $this->displayName, and the template printed a hardcoded 0 badge with the module name as its body, so the block was empty for every customer no matter what they had saved - which is what PrestaShop/PrestaShop#28572 meant by "not implemented". It now fetches the wishlists and lists them with their product counts, and says so explicitly when there are none.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#27143
How to test? Sign in on the front office, add products to a wishlist, then open that customer in Customers > view. Before: the Wishlist card shows a 0 badge and the word "Wishlist". After: it lists each wishlist with the number of products in it, the default one first, and shows "This customer has no wishlist." for a customer who has none.
Sponsor company

blockwishlist has no PULL_REQUEST_TEMPLATE.md - table shape taken from an earlier PR in this repo.
Confirm against a recent merged one at publish time.

Measured, on the real hook

Hook::exec('displayAdminCustomers', ['id_customer' => …]) against a seeded wishlist of 2 products:

                                   badge   body
shipped                            0       "Wishlist"        (the module display name)
patched, customer with 1 list      1       table: "Probe27143 list" -> 2 products
patched, customer with none        0       "This customer has no wishlist."
patched, hook called with no id    0       "This customer has no wishlist."   (no error)

Reused rather than written

WishList::getAllWishlistsByIdCustomer() already existed and already returns nbProducts per list plus
the default flag, and already restricts itself to Shop::getContextShopID() or the context shop group.
So the hook is four lines and the multistore scoping comes for free rather than being re-implemented -
worth saying in the PR, since a reviewer will otherwise wonder why no shop handling is visible.

Gates

  • php -l clean; module's own php-cs-fixer (PrestaShop coding standard) reports no violations.
  • blockwishlist ships no PHPUnit suite (tests/ holds js, php (phpstan) and UI), so the measured
    RED -> GREEN above stands in for a unit test, as with ps_emailalerts.
  • Not run: the module's PHPStan and the UI campaign.

Context worth carrying to the PR

PrestaShop SA said on the issue (ibahloul-ps, 2025-02-06) that they would not fix it and invited a community
PR; the issue is labelled Ready. Three later reports were closed as duplicates of it: PrestaShop/PrestaShop#28572, PrestaShop/PrestaShop#34853, PrestaShop/PrestaShop#35844.

The block rendered by displayAdminCustomers never looked the customer up: the
hook assigned only the module's display name and the template printed a
hardcoded 0 badge, so the card was empty whatever the customer had saved.

Fetch the wishlists with WishList::getAllWishlistsByIdCustomer(), which already
returns the product count per list and scopes itself to the current shop or shop
group, and render them with an explicit empty state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BO - Customer View page - the block wishlist is always empty

1 participant