Hi. How can we help?

Wishlist - Privacy Options - Remove select visibility and set the default wishlist to private

Let's proceed with removing "Wishlist visibiity" select
This will require to overwrite some templates from wishlist default folder: all you have to do is to copy the following files

wp-content/plugins/yith-woocommerce-wishlist-premium/templates/wishlist-manage.php
wp-content/plugins/yith-woocommerce-wishlist-premium/templates/wishlist-create.php
wp-content/plugins/yith-woocommerce-wishlist-premium/templates/add-to-wishlist-popup.php


And paste them under wp-content/themes/<your theme or child folder>/woocommerce/ (you may need to create WooCommerce subdirectory)

Then we need to make some changes to our brand new templates inside theme folder

1. wishlist-manage.php
Remove lines 35-39

<th class="wishlist-privacy">
<span class="nobr">
<?php echo apply_filters( 'yith_wcwl_wishlist_manage_privacy_heading', __( 'Privacy', 'yith-woocommerce-wishlist' ) ) ?>
</span>
</th>

54-56

<td class="wishlist-privacy">
<?php echo apply_filters( 'yith_wcwl_wishlist_manage_default_privacy', __( 'Public', 'yith-woocommerce-wishlist' ) )?>
</td>

and 71-77

<td class="wishlist-privacy">
<select name="wishlist_options[<?php echo $wishlist['ID'] ?>][wishlist_privacy]" class="wishlist-visibility selectBox">
<option value="0" class="public-visibility" <?php selected( $wishlist['wishlist_privacy'], 0 ) ?> ><?php echo apply_filters( 'yith_wcwl_public_wishlist_visibility', __( 'Public', 'yith-woocommerce-wishlist' ) )?></option>
<option value="1" class="shared-visibility" <?php selected( $wishlist['wishlist_privacy'], 1 ) ?> ><?php echo apply_filters( 'yith_wcwl_shared_wishlist_visibility', __( 'Shared', 'yith-woocommerce-wishlist' ) )?></option>
<option value="2" class="private-visibility" <?php selected( $wishlist['wishlist_privacy'], 2 ) ?> ><?php echo apply_filters( 'yith_wcwl_private_wishlist_visibility', __( 'Private', 'yith-woocommerce-wishlist' ) )?></option>
</select>
</td>

Fianlly change line 92 from this

<td colspan="3">

to this

<td colspan="2">

2. wishlist-create.php
Remove lines 31-35

<select name="wishlist_visibility" class="wishlist-visibility selectBox">
<option value="0" class="public-visibility"><?php echo apply_filters( 'yith_wcwl_public_wishlist_visibility', __( 'Public', 'yith-woocommerce-wishlist' ) )?></option>
<option value="1" class="shared-visibility"><?php echo apply_filters( 'yith_wcwl_shared_wishlist_visibility', __( 'Shared', 'yith-woocommerce-wishlist' ) )?></option>
<option value="2" class="private-visibility"><?php echo apply_filters( 'yith_wcwl_private_wishlist_visibility', __( 'Private', 'yith-woocommerce-wishlist' ) )?></option>
</select>

3. add-to-wishlist-popup.php
Remove lines 66-72

<div class="yith-wcwl-visibility">
<select name="wishlist_visibility" class="wishlist-visibility">
<option value="0" class="public-visibility"><?php echo apply_filters( 'yith_wcwl_public_wishlist_visibility', __( 'Public', 'yith-woocommerce-wishlist' ) )?></option>
<option value="1" class="shared-visibility"><?php echo apply_filters( 'yith_wcwl_shared_wishlist_visibility', __( 'Shared', 'yith-woocommerce-wishlist' ) )?></option>
<option value="2" class="private-visibility"><?php echo apply_filters( 'yith_wcwl_private_wishlist_visibility', __( 'Private', 'yith-woocommerce-wishlist' ) )?></option>
</select>
</div>

Now every "Wishlist Privacy" select should be removed from your site

Fianlly, we have to set default visibility as private: we will do this using a filter
Unfortunately, currently this filter does not exists, so we will have to add it to plugin code (it will be released within next plugin revision)

And that's all

Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >