• Resolved beeweebee

    (@beeweebee)


    Hi there,

    Thanks for this great plugin, works great.
    I struggle with displaying the wishlist icon on an event list page. I have a Tribe event list (controlled by a custom file /themes/mytheme/tribe-events/list/single-event.php).

    I’ve tried to add the following code in my loop:

    do_shortcode("[ti_wishlists_addtowishlist]");

    but it’s not working. Any idea?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author templateinvaders

    (@templateinvaders)

    Hi @beeweebee

    We haven’t any experience with the Tribe Events plugin but it looks like it has its custom posts type that linked to WooCommerce products for cart functionality.

    In your case events list are not WooCommerce products and it’s why the wishlist button shortcode failed to render. You should specify product ID inside shortcode like:
    do_shortcode( '[ti_wishlists_addtowishlist product_id="' . $product->get_id() . '" loop="yes"]' );

    Just check how exactly you can access the product object in your template.

    You can contact us via chat on the plugin settings page if you need further help.

    Thread Starter beeweebee

    (@beeweebee)

    Hi,

    I think I do understand what you mean. I’ve tried with a “static product id” first to see if it works but it doesn’t.

    Example:
    do_shortcode( '[ti_wishlists_addtowishlist product_id="48850" loop=yes]'); –> crashes the page

    Here’s the error:
    Fatal error: Uncaught Error: Call to a member function get_type() on null in /wp-content/plugins/ti-woocommerce-wishlist/public/addtowishlist.class.php:527 Stack trace: #0 /wp-content/plugins/ti-woocommerce-wishlist/public/addtowishlist.class.php(674): TInvWL_Public_AddToWishlist->htmloutput(Array, true) #1 /wp-content/plugins/ti-woocommerce-wishlist/tinv-wishlists-function.php(509): TInvWL_Public_AddToWishlist->shortcode(Array) #2 /wp-includes/shortcodes.php(325): tinvwl_shortcode_addtowishlist(Array, '', 'ti_wishlists_ad...') #3 [internal function]: do_shortcode_tag(Array) #4 /wp-includes/shortcodes.php(199): preg_replace_callback('/\\[(\\[?)(ti_wis...', 'do_shortcode_ta...', '[ti_wishlists_a...') #5 /wp-con in /wp-content/plugins/ti-woocommerce-wishlist/public/addtowishlist.class.php on line 527

    I tried also without the loop=yes :
    do_shortcode( '[ti_wishlists_addtowishlist product_id="48850"]'); –> doesn’t display anything

    Plugin Author templateinvaders

    (@templateinvaders)

    Hi @beeweebee

    Thanks for the bug report.
    This issue fixed in the 1.16.0 version of our plugin.

    Thread Starter beeweebee

    (@beeweebee)

    Hi, indeed the page now no longer crashes … But it still doesn’t display anything as if the shortcode returns an empty value. I’ve tried:

    do_shortcode( '[ti_wishlists_addtowishlist product_id="48850" loop=yes]');

    and

    do_shortcode( '[ti_wishlists_addtowishlist product_id="48850"');

    It just doesn’t work. Any setting/hook I’ve missed?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add the wishlist icon to an event List’ is closed to new replies.