這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Wishlist for WooCommerce

外掛說明

A simple and lightweight wishlist for WooCommerce, with plenty of hooks for customization to fit your WooCommerce theme.

By default, the plugin adds a wishlist icon to the WooCommerce archive pages and the WooCommerce single product page. Instead of an icon you can also switch to a text-based link to or add/remove wishlist items.
The wishlist can be added to a page using the [jvm_woocommerce_add_to_wishlist] shortcode. For more advanced customization see the hooks, javascript API and templates sections below.

Hooks

For advanced users and developers, a few WordPress actions and filters are supplied to modify the behavior of the wishlist.

Example usage removing the button from the archive page:

remove_action( 'woocommerce_after_shop_loop_item', 'jvm_woocommerce_add_to_wishlist', 15 );

Example usage switching to text links instead of icons:

add_filter( 'jvm_add_to_wishlist_class', function($class) {
    return 'jvm_add_to_wishlist text';
});

Actions

Available actions:

  • jvm_woocommerce_wishlist_loaded
  • jvm_woocommerce_wishlist_before_wishlist
  • jvm_woocommerce_wishlist_after_wishlist
  • jvm_woocommerce_wishlist_before_wishlist_contents
  • jvm_woocommerce_wishlist_after_wishlist_contents
  • jvm_woocommerce_wishlist_before_add_to_wishlist
  • jvm_woocommerce_wishlist_after_add_to_wishlist

Filters

  • jvm_add_to_wishlist_class
  • jvm_add_to_wishlist_icon_html
  • jvm_woocommerce_wishlist_product_ids

Functions

  • jvm_woocommerce_wishlist_get_count()
  • jvm_woocommerce_wishlist_get_wishlist_product_ids()

Templates

The default wishlist page can be overridden in your theme. From the plugin directory copy

templates/wishlist.php 

to:

your-theme-directory/jvm-woocommerce-wishlist/wishlist.php 

Modify what you need in the copy.

Javascript API

For further theme integration the javascript file in the plugin has a few custom events that are fired for wishlist user activity.

  • add.JVMWooCommerceWishlist
  • remove.JVMWooCommerceWishlist
  • beforeupdate.JVMWooCommerceWishlist
  • afterupdate.JVMWooCommerceWishlist

Example usage:

$(document).on("beforeupdate.JVMWooCommerceWishlist", function(e) {
  console.log(e);

  // Do something like update some custom counter, show a message or whatever.
});

螢幕擷圖

安裝方式

  1. Install the plugin from the Plugins or upload the plugin folder to the /wp-content/plugins/ directory menu and then activate it.
  2. Go to the plugin setting screen to define a wishlist page.
  3. Go to the plugin settings page from the plugins screen and create your wishlist page.

使用者評論

2021 年 10 月 23 日
It's a pity the plugin is no longer supported. I'd suggest to make 2 fixes (needed to support multilang). 1. Change get_bloginfo('name') to $_SERVER['HTTP_HOST'] File \wp-content\plugins\jvm-woocommerce-wishlist\inc\www-core-functions.php 23 return str_replace( '-', '_', sanitize_title_with_dashes( $_SERVER['HTTP_HOST'] ) ); //get_bloginfo('name') 2. Change get_the_title($product_id) to get_post_field( 'post_name', get_post($product_id) ) File \wp-content\plugins\jvm-woocommerce-wishlist\inc\frontend\www-functions.php 60 ?><a class="<?php echo esc_attr( $class ); ?>" href="?add_to_wishlist=<?php echo $product_id; ?>" title="<?php echo esc_attr( $text ); ?>" rel="nofollow" data-product-title="<?php echo esc_attr( get_post_field( 'post_name', get_post($product_id) ) ); ?>" data-product-id="<?php echo $product_id; ?>"> //get_the_title($product_id)
2020 年 10 月 28 日
How to add product wishlist page to 'add to cart' page. I don't find any add to cart button
2020 年 10 月 12 日 2 則留言
Nothing to edit, exept the favorite-page.
2020 年 6 月 29 日
I appreciate all the free plugins out there, but many times they're bloated with unwanted options. Having tried many other Wordpress wishlist plugins, this is exactly what I was looking for. Thank you!
2020 年 6 月 25 日
After having tried several of the more popular Wishlist plugins, I found that they were all difficult to work with/customize, ran slow, and came with a lot of features I didn't need - while some simple features I did want would come in a premium package. This plugin however, is fast and allows for customization. If you're not shy to change up the code and style a little, you can easily get to the result you want, without the plugin breaking or acting weird. Support was also quick to get back to me and provided all I needed. Thank you for an amazingly smooth plugin and keep up the good work!
2020 年 6 月 4 日
I had a request/suggestion and the developer responded immediately, released an update too. Works pretty good 🙂
閱讀全部 9 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Wishlist for WooCommerce〉的開發相關工作。

參與者

〈Wishlist for WooCommerce〉外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Wishlist for WooCommerce〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.3.6 – 23 Sep 22

Fixed: default WooCommerce style for wishlist page table
Compatibility with WooCommerce 7.1

1.3.5 – 23 Sep 22

Bug fix
Added: appsero insights
Compatibility with WooCommerce 6.9.3

1.3.4

Added a new filter for modifying the icon HTML: jvm_add_to_wishlist_icon_html

1.3.3

Bug fix php error notice in ajax/www-ajax-functions.php

1.3.2

Added an optional $product _id parameter to the jvm_woocommerce_add_to_wishlist function for use of this function outside of the loop, for increased flexibility.

1.3.1

Bug fix. Whitespace in main plugin file. Please update.

1.3.0

Fixed a fatal error in update 1.2.9. Please upgrade if you are on 1.2.9.

1.2.9

Some slight changes to wishlist storage. The cookie is now always cleared on logout. Also newly added products when not logged in will be added after login.

1.2.8

Bug fix: When logged in last item on wishlist would need to be removed twice. Should be fixed now. Also no ajax requests will de done if a user is not logged in to reduce overhead.

1.2.7

Security fix. User ID passed to ajax calls must match the current user.

1.2.6

Another whitespace fix.

1.2.5

Fixed a whitespace issue in front end link.

1.2.4

Added a partially Japanese translation.

1.2.3

Added a grunt task for automated POT files.
Added and a Dutch translation and auto generated POT file.

1.2.2

Added a dontation button.

1.2.1

Added a Dutch translation.

1.2.0

Fixed a bug where the custom wishlist template would not load from the (child) theme.

1.1.0

Fixed a bug “No products on your wishlist yet.” shown with products in wishlist on other pages than the main wishlist page (plugin settings).

1.0.0

Initial release

Stable

1.0.0