Black Friday

30% off premium pluginsEnds 2 December

Shop the sale
Simple Wishlists

How can we help?

Search the documentation or ask the AI agent anything about the plugin.

Override the wishlist templates

Simple WishlistsUpdated

All customer-facing wishlist markup is in template files that your theme can override. Copy a file from the plugin’s templates folder to yourtheme/relywp-wishlists/ and edit the copy. The plugin loads your theme’s copy first.

Override a template

  1. Create a folder named relywp-wishlists in your child theme.
  2. Copy the template from the templates folder inside the plugin’s folder in wp-content/plugins/, keeping the same file name.
  3. Edit the copy. Templates receive their data in a single $args array, which is described at the top of each file.

Each template has a @version line. After a plugin update, compare your copy with the new version and bring across any changes.

The templates

  • wishlist.php: the wishlist component (header, toolbar, bulk actions, items and footer).
  • wishlist-items.php: the grid or table of items, the empty state or the “no results” message.
  • item-card.php and item-row.php: one item in the grid and table views.
  • item-price.php, item-quantity.php and item-actions.php: an item’s price and price change badge, quantity, and actions.
  • wishlist-empty.php: the empty wishlist, with the optional popular products.
  • hero.php: the coloured header with stat cards.
  • account-dashboard.php and account-settings.php: the My Account dashboard and its Settings tab.
  • share-modal.php: the share window.
  • shared-header.php: the header of a shared list.
  • wishlist-unavailable.php: shown for a share link whose list is private or deleted.
  • login-required.php: shown to guests when they must log in.

PRO also has emails/items-table.php, the table of items used in wishlist emails.

Add content with hooks instead

To add something without overriding a template, use the actions the templates fire: swlp_wishlist_list_switcher, swlp_wishlist_toolbar_end, swlp_wishlist_bulk_actions, swlp_wishlist_before_items, swlp_wishlist_after_items, swlp_wishlist_item_meta, swlp_wishlist_item_actions and swlp_share_modal_after. PRO features use these hooks, so keep them in any template you override.

<?php
// PHP: show the product SKU under each wishlist item's price.
add_action( 'swlp_wishlist_item_meta', function ( $item, $product, $list, $context ) {
	if ( $product && $product->get_sku() ) {
		echo '<p class="my-sku">SKU: ' . esc_html( $product->get_sku() ) . '</p>';
	}
}, 10, 4 );

Template filters

  • swlp_template_path: change the theme folder name (default relywp-wishlists).
  • swlp_locate_template: change the file used for a template.
  • swlp_template_args: change the data passed to a template.

Related

Was this article helpful?