Customizing the Position of "Add to Wishlist" Button
-
Hi,
Just started playing with this plugin and so far so good ??
I did want the wishlist button to appear literally after the the ‘Add to Cart’ button rather than after the form. So I dug into the code and was happy to find a filter for me to alter the position setting new actions,yith_wcwl_positions
.
However, for some reason this filter is not getting applied. When i moved it to the add_button() function in the YITH_WCWL_Init class all was working as expected.Here are the exact lines I changed. You might want to do it a different way.
$positions = apply_filters( 'yith_wcwl_positions', $this->_positions ); if( $position != 'shortcode' ) { add_action( $positions[$position]['hook'], create_function( '', 'echo do_shortcode( "[yith_wcwl_add_to_wishlist]" );' ), $this->_positions[$position]['priority'] ); }
All I did was apply the filter here rather than in the __construct
Would you be able to provide a fix in a future update so that I am not scared to click the ‘Update’ button?
The Setting name suggests you would be using the
woocommerce_after_add_to_cart_button
hook. Is there a reason you decided to use thewoocommerce_single_product_summary
hook?https://www.ads-software.com/plugins/yith-woocommerce-wishlist/
- The topic ‘Customizing the Position of "Add to Wishlist" Button’ is closed to new replies.