View Categories

Shortcode Usage

2 min read


Shortcode Usage

The WooCommerce Products Wishlist plugin provides three powerful shortcodes that allow you to display wishlist functionality anywhere on your website, giving you complete control over placement and presentation.

Available Shortcodes

[woowish_table]

๐Ÿ“‹ Wishlist Table

Purpose: Displays the complete wishlist in a table format

Best for: Dedicated wishlist pages, customer account areas

Features: Full product management with add to cart, remove, and quantity selection

[woowish_single]

๐ŸŽฏ Single Product Wishlist Button

Purpose: Shows wishlist button/link for the current product (single product pages)

Best for: Custom product page layouts, additional wishlist placements

Features: Add/remove functionality with visual state changes

[woowish_archive]

๐Ÿ“‚ Archive Product Wishlist

Purpose: Displays wishlist functionality for products in archive/loop contexts

Best for: Custom shop layouts, product grids, featured product sections

Features: Context-aware product detection in WooCommerce loops

Primary Shortcode: [woowish_table]

Main Wishlist Page: This is the primary shortcode that creates the full wishlist experience. The plugin automatically creates a โ€œWishlistโ€ page with this shortcode during activation.

๐Ÿ“„ Page Creation

To create a custom wishlist page:

  1. Create a new page in WordPress
  2. Add the shortcode [woowish_table] to the page content
  3. Publish the page
  4. Update the โ€œWishlist page URLโ€ setting with the new pageโ€™s URL

Where to Use Shortcodes

๐Ÿ“„ Pages and Posts

Add any shortcode directly to page or post content:

[woowish_table]

Best for: Dedicated wishlist pages, customer service pages, account pages

๐ŸŽ›๏ธ Widgets

Use shortcodes in text widgets or custom HTML widgets:

[woowish_single]

Best for: Sidebars, footer areas, header widgets

๐Ÿ“‹ Page Builders

Most page builders support shortcodes:

  • Elementor: Use Shortcode widget
  • Beaver Builder: Use HTML module
  • Divi: Use Code module
  • Gutenberg: Use Shortcode block
  • Visual Composer: Use Raw HTML element

๐ŸŽจ Theme Templates

Add to theme files using PHP:

<?php echo do_shortcode(โ€˜[woowish_table]โ€™); ?>

Best for: Custom theme development, specific template modifications

Shortcode Behavior and Context

๐Ÿ” User Detection

  • Logged-in Users: Shows full functionality with database storage
  • Guest Users: Shows functionality with cookie-based storage
  • Disabled Users: Respects General settings for user type restrictions

๐Ÿ›’ Product Context

  • [woowish_single]: Automatically detects current product on single product pages
  • [woowish_archive]: Works within WooCommerce product loops
  • [woowish_table]: Shows all saved products regardless of current page context

Common Use Cases

๐Ÿช Custom Shop Layout

Use [woowish_archive] in custom product grids or featured product sections to add wishlist functionality to any product display.

๐Ÿ‘ค Customer Dashboard

Create a comprehensive customer dashboard page that includes [woowish_table] alongside other customer information and tools.

๐Ÿ“ง Email Campaign Landing

Create dedicated landing pages for email campaigns encouraging wishlist usage with [woowish_table] for registered users.

๐ŸŽฏ Additional Product Placements

Use [woowish_single] to add extra wishlist buttons in custom locations on product pages, such as in product galleries or description areas.

Styling and Customization

Inheritance: Shortcodes inherit all styling from the pluginโ€™s Style settings. Colors, icons, and custom CSS apply to shortcode displays just as they do to automatically positioned elements.

๐ŸŽจ Custom Styling

Target shortcode output with CSS:

.woowish_table { /* Styles for table shortcode */ }
.woowish_btn { /* Styles for button shortcodes */ }
.woowish_link { /* Styles for link shortcodes */ }

Troubleshooting Shortcodes

Common Issues and Solutions:

Shortcode displays as text:

  • Ensure youโ€™re using the exact shortcode format: [woowish_table]
  • Check that the plugin is activated
  • Verify no syntax errors in the shortcode

Nothing displays:

  • Check General settings โ€“ ensure the user type (member/guest) is enabled
  • Verify WooCommerce is active and working
  • For single/archive shortcodes, ensure youโ€™re on appropriate pages

Styling issues:

  • Check Style settings for color and display type configurations
  • Verify custom CSS isnโ€™t conflicting
  • Test with a default theme to isolate theme-specific issues

Advanced Implementation

๐Ÿ”ง Conditional Display

Use WordPress conditional tags with shortcodes:

<?php if (is_user_logged_in()) { echo do_shortcode(โ€˜[woowish_table]โ€™); } ?>

๐ŸŽ›๏ธ Dynamic Content

Combine with other dynamic content for rich customer experiences:

<h2>Your Saved Products</h2>
[woowish_table]
<h2>Recommended for You</h2>