• I made some small QOL changes so it’s prod ready in my view. These changes can be features references for future releases in official way. Added the full patch details at end. Some changes have multiple updates in different places which can be tracked using the common identifier below. Thanks.

    • loop floating button -> enables modern looking floating button in block product collection, additinally enables it in homepage
    • guest disabled redirect -> with guest wishlist disabled redirects guest to login page from shop loop and detail page
    • widget compat type -> makes widget compact to be used in header, additionally reduces text for block editor
    • wishlist action buttons -> Differenciates out of stock, in stock and back order products to give seperate actions and label
    • wishlist action styles -> Makes remove button compact and centered in all view
    • add cart notice -> adds cart actions notice in wishlist page
    • remove name edit -> disables wishlist name edit, works along with multi wishlist remove
    • remove multi wishlist -> disables multi-wishlist, works along with remove name edit
    • remove privacy row -> disables privacy row so links can’t even be shared at all

    wishowl-wishlist-changes.patch

    diff --git a/includes/class-wishowl-frontend.php b/includes/class-wishowl-frontend.php
    index b268985..d4cf771 100644
    --- a/includes/class-wishowl-frontend.php
    +++ b/includes/class-wishowl-frontend.php
    @@ -165,7 +165,8 @@ class WishOwl_Frontend {
    add_action( 'woocommerce_after_shop_loop_item', array( $this, 'render_loop_button' ), 7 );
    break;
    case 'shop_only':
    - add_action( 'woocommerce_after_shop_loop_item', array( $this, 'render_loop_button' ), 12 );
    + // Change Feature: loop floating button
    + add_filter( 'render_block_woocommerce/product-image', array( $this, 'inject_block_product_button' ), 10, 2 );
    break;
    case 'off':
    // no-op
    @@ -209,6 +210,11 @@ class WishOwl_Frontend {
    'ajaxUrl' => admin_url( 'admin-ajax.php' ),
    'nonce' => wp_create_nonce( WishOwl_Ajax::NONCE_ACTION ),
    'wishlistUrl' => $this->get_wishlist_page_url(),
    + // Change Feature: guest disabled redirect
    + 'isLoggedIn' => is_user_logged_in(),
    + 'guestWishlists' => 'yes' === $this->settings()['enable_guest'],
    + 'accountUrl' => wc_get_page_permalink( 'myaccount' ),
    +
    'i18n' => array(
    'add' => __( 'Add to Wishlist', 'wishowl-wishlist-for-woocommerce' ),
    'inList' => __( '✓ In Wishlist', 'wishowl-wishlist-for-woocommerce' ),
    @@ -262,6 +268,12 @@ class WishOwl_Frontend {
    if ( function_exists( 'is_woocommerce' ) && ( is_woocommerce() || is_cart() || is_checkout() ) ) {
    return true;
    }
    +
    + // Change Feature: loop floating button
    + if ( is_front_page() ) {
    + return true;
    + }
    +
    if ( is_singular() ) {
    global $post;
    if ( $post && (
    @@ -316,6 +328,24 @@ class WishOwl_Frontend {
    echo $this->render_button( $product->get_id(), array( 'compact' => true ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    }

    + // Change Feature: loop floating button
    + public function inject_block_product_button( $block_content, $block ) {
    + global $product;
    + if ( ! $product || ! $block_content ) {
    + return $block_content;
    + }
    +
    + $button = $this->render_button(
    + $product->get_id(),
    + array(
    + 'floating' => true,
    + 'compact' => true,
    + )
    + );
    +
    + return preg_replace( '#</div>\s*$#', $button . '</div>', $block_content, 1 );
    + }
    +
    /**
    * Render the heart button. Used by hooks AND the [wishowl_button] shortcode.
    *
    diff --git a/includes/class-wishowl-shortcodes.php b/includes/class-wishowl-shortcodes.php
    index 936c826..e754114 100644
    --- a/includes/class-wishowl-shortcodes.php
    +++ b/includes/class-wishowl-shortcodes.php
    @@ -71,6 +71,13 @@ class WishOwl_Shortcodes {
    'wishowl_wishlist'
    );

    + // Change Feature: guest disabled redirect
    + $settings = $this->settings();
    + if ( ! is_user_logged_in() && 'yes' !== $settings['enable_guest'] ) {
    + wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) );
    + exit;
    + }
    +
    $storage = WishOwl_Storage::instance();
    $user_id = $storage->current_user_id();
    $settings = $this->settings();
    diff --git a/public/css/wishowl-wishlist.css b/public/css/wishowl-wishlist.css
    index 8b7c62b..de45848 100644
    --- a/public/css/wishowl-wishlist.css
    +++ b/public/css/wishowl-wishlist.css
    @@ -278,20 +278,39 @@ ul.products li.product .button + .wishowl-button--compact,
    margin-top: 0.5em;
    }

    +/* Change Feature: loop floating button */
    .wishowl-button--floating {
    position: absolute;
    - top: 12px;
    - right: 12px;
    + top: 6px;
    + right: 6px;
    z-index: 5;
    - width: 36px;
    - height: 36px;
    + min-width: 30px;
    + min-height: 30px;
    + width: 30px;
    + height: 30px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.40) !important;
    color: #888;
    justify-content: center;
    + transition: transform 100ms ease, box-shadow 100ms ease;
    +}
    +.wishowl-button--floating:hover {
    + background: #fff;
    + color: #555;
    + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.70) !important;
    + transform: scale(1.05);
    +}
    +
    +/* Change Feature: wishlist action styles */
    +.wishowl-remove {
    + line-height: 0.1;
    + vertical-align: middle;
    +}
    +.wishowl-table td:last-child {
    + text-align: center;
    }

    .wishowl-button--floating .wishowl-button__label {
    diff --git a/public/js/block.js b/public/js/block.js
    index 3e2e85e..3b44b38 100644
    --- a/public/js/block.js
    +++ b/public/js/block.js
    @@ -50,7 +50,7 @@
    el(
    'div',
    { style: { padding: '12px', border: '1px dashed #ccc', borderRadius: '4px' } },
    - '♥ ' + __( 'Wishlist widget — renders on the front end.', 'wishowl-wishlist-for-woocommerce' )
    + '♥ ' + __( '#', 'wishowl-wishlist-for-woocommerce' ) // Change Feature: widget compact type
    )
    );
    },
    diff --git a/public/js/wishowl-wishlist.js b/public/js/wishowl-wishlist.js
    index cf3fe2a..791d3c7 100644
    --- a/public/js/wishowl-wishlist.js
    +++ b/public/js/wishowl-wishlist.js
    @@ -167,6 +167,12 @@
    return;
    }

    + // Change Feature: guest disabled redirect
    + if ( ! wishowlData.isLoggedIn && ! wishowlData.guestWishlists ) {
    + window.location.href = wishowlData.accountUrl;
    + return;
    + }
    +
    disableTemporarily($btn);

    var action = inList ? 'remove_item' : 'add_item';
    diff --git a/public/views/widget.php b/public/views/widget.php
    index e380630..63075c6 100644
    --- a/public/views/widget.php
    +++ b/public/views/widget.php
    @@ -10,18 +10,15 @@
    defined( 'ABSPATH' ) || exit;
    ?>
    <div class="wishowl-widget">
    - <div class="wishowl-widget__row">
    - <span aria-hidden="true">♥</span>
    - <span>
    - <?php
    - printf(
    - /* translators: %s: item count, wrapped in a span */
    - esc_html( _n( '%s item in your wishlist', '%s items in your wishlist', max( 1, $count ), 'wishowl-wishlist-for-woocommerce' ) ),
    - '<span class="wishowl-widget__count">' . esc_html( (int) $count ) . '</span>'
    - );
    - ?>
    - </span>
    - </div>
    + <!-- Change Feature: widget compact type -->
    + <a
    + class="wishowl-wishlist-widget"
    + href="<?php echo esc_url( $wishlist_url ); ?>"
    + aria-label="<?php esc_attr_e( 'View wishlist', 'wishowl-wishlist-for-woocommerce' ); ?>"
    + >
    + <span aria-hidden="true">💙</span>
    + <span class="wishowl-widget__count"><?php echo esc_html( (int) $count ); ?></span>
    + </a>

    <?php if ( $show_thumbs && ! empty( $items ) ) : ?>
    <div class="wishowl-widget__items">
    @@ -34,8 +31,5 @@ defined( 'ABSPATH' ) || exit;
    <?php endforeach; ?>
    </div>
    <?php endif; ?>
    -
    - <a class="wishowl-widget__link" href="<?php echo esc_url( $wishlist_url ); ?>">
    - <?php esc_html_e( 'View wishlist →', 'wishowl-wishlist-for-woocommerce' ); ?>
    - </a>
    + <!-- Change Feature: widget compact type -->
    </div>
    diff --git a/public/views/wishlist-page.php b/public/views/wishlist-page.php
    index ffdb860..88904f8 100644
    --- a/public/views/wishlist-page.php
    +++ b/public/views/wishlist-page.php
    @@ -51,17 +51,32 @@ $btn_preset = isset( $settings['design_style_preset'] ) ? $settings['design
    $btn_classes = 'wishowl-button wishowl-button--style-' . $btn_preset;
    $btn_theme_class = ( 'theme' === $btn_preset ) ? ' button' : '';
    $action_btn_cls = $btn_classes . $btn_theme_class;
    +
    +// Change Feature: wishlist action buttons
    +$wishlist_action = function ( $product ) {
    + if ( 'onbackorder' === $product->get_stock_status() ) {
    + return array(
    + 'url' => home_url( '/?pagename=query-stock' ),
    + 'label' => __( 'Query stock', 'wishowl-wishlist-for-woocommerce' ),
    + );
    + }
    + if ( ! $product->is_in_stock() ) {
    + return array(
    + 'url' => get_permalink( $product->get_id() ),
    + 'label' => __( 'Read more', 'wishowl-wishlist-for-woocommerce' ),
    + );
    + }
    + return array(
    + 'url' => $product->add_to_cart_url(),
    + 'label' => __( 'Add to cart', 'wishowl-wishlist-for-woocommerce' ),
    + );
    +};
    +
    ?>
    <div class="wishowl-page">
    + <?php wc_print_notices(); ?> <!-- Change Feature: add cart notice -->
    <div class="wishowl-page__header">
    - <input
    - type="text"
    - class="wishowl-name-edit"
    - value="<?php echo esc_attr( $wishlist['name'] ); ?>"
    - data-wishlist-id="<?php echo esc_attr( $wishlist['id'] ); ?>"
    - aria-label="<?php esc_attr_e( 'Wishlist name', 'wishowl-wishlist-for-woocommerce' ); ?>"
    - <?php echo $user_id ? '' : 'readonly'; ?>
    - />
    + <!-- Change Feature: remove name edit -->

    <div class="wishowl-page__actions">
    <div
    @@ -117,11 +132,7 @@ $action_btn_cls = $btn_classes . $btn_theme_class;
    <?php endif; ?>

    <?php if ( $user_id ) : ?>
    - <button
    - type="button"
    - class="wishowl-create-list <?php echo esc_attr( $action_btn_cls ); ?>"
    - data-prompt="<?php esc_attr_e( 'Name for the new wishlist', 'wishowl-wishlist-for-woocommerce' ); ?>"
    - ><?php esc_html_e( '+ New', 'wishowl-wishlist-for-woocommerce' ); ?></button>
    + <!-- Change Feature: remove multi wishlist -->
    <?php if ( count( $lists ) > 1 ) : ?>
    <button
    type="button"
    @@ -134,28 +145,7 @@ $action_btn_cls = $btn_classes . $btn_theme_class;
    </div>
    </div>

    - <div class="wishowl-privacy-row">
    - <label for="wishowl-privacy-<?php echo esc_attr( $wishlist['id'] ); ?>">
    - <?php esc_html_e( 'Privacy:', 'wishowl-wishlist-for-woocommerce' ); ?>
    - </label>
    - <select
    - id="wishowl-privacy-<?php echo esc_attr( $wishlist['id'] ); ?>"
    - class="wishowl-privacy-select"
    - data-wishlist-id="<?php echo esc_attr( $wishlist['id'] ); ?>"
    - >
    - <option value="private" <?php selected( $wishlist['privacy'], 'private' ); ?>>
    - <?php esc_html_e( 'Private — only me', 'wishowl-wishlist-for-woocommerce' ); ?>
    - </option>
    - <option value="shared" <?php selected( $wishlist['privacy'], 'shared' ); ?>>
    - <?php esc_html_e( 'Shared — anyone with the link', 'wishowl-wishlist-for-woocommerce' ); ?>
    - </option>
    - <?php if ( $allow_public ) : ?>
    - <option value="public" <?php selected( $wishlist['privacy'], 'public' ); ?>>
    - <?php esc_html_e( 'Public — discoverable', 'wishowl-wishlist-for-woocommerce' ); ?>
    - </option>
    - <?php endif; ?>
    - </select>
    - </div>
    + <!-- Change Feature: remove privacy row -->

    <div class="wishowl-share-row" style="<?php echo 'private' === $wishlist['privacy'] ? 'display:none;' : ''; ?>">
    <input
    @@ -260,8 +250,10 @@ $action_btn_cls = $btn_classes . $btn_theme_class;
    </div>
    <?php endif; ?>
    <div class="wishowl-grid__actions">
    - <a class="<?php echo esc_attr( $action_btn_cls ); ?>" href="<?php echo esc_url( $product->add_to_cart_url() ); ?>" rel="nofollow">
    - <?php esc_html_e( 'Add to cart', 'wishowl-wishlist-for-woocommerce' ); ?>
    + <!-- Change Feature: wishlist action buttons -->
    + <?php $action = $wishlist_action( $product ); ?>
    + <a class="<?php echo esc_attr( $action_btn_cls ); ?>" href="<?php echo esc_url( $action['url'] ); ?>" rel="nofollow">
    + <?php echo esc_html( $action['label'] ); ?>
    </a>
    <button
    type="button"
    @@ -329,8 +321,10 @@ $action_btn_cls = $btn_classes . $btn_theme_class;
    </td>
    <?php endif; ?>
    <td>
    - <a class="<?php echo esc_attr( $action_btn_cls ); ?>" href="<?php echo esc_url( $product->add_to_cart_url() ); ?>" rel="nofollow">
    - <?php esc_html_e( 'Add to cart', 'wishowl-wishlist-for-woocommerce' ); ?>
    + <!-- Change Feature: wishlist action buttons -->
    + <?php $action = $wishlist_action( $product ); ?>
    + <a class="<?php echo esc_attr( $action_btn_cls ); ?>" href="<?php echo esc_url( $action['url'] ); ?>" rel="nofollow">
    + <?php echo esc_html( $action['label'] ); ?>
    </a>
    <button
    type="button"

You must be logged in to reply to this topic.