WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Shortcode not "read" in Product short descript (6 posts)

  1. cbdallaire
    Member
    Posted 1 year ago #

    I want to add a "Add to my favorites" link in the product page. I want it to be displayed in the product description area beside the image.

    I add the shortcode [wpfp-link], but once I upload the page, the shortcode is shown as text instead of a link.

    If I add the same shortcode in the page area (shown in "product description" beside "reviews" down the page), it is read correctly and the "Add to my favorites" link appears.

    How can I make the link work in the upper section of the page?

    This is the wp_favorites plugin (http://wordpress.org/extend/plugins/wp-favorites/). I haven't found a "favorite" option in WooCommerce. Am I right?

    http://wordpress.org/extend/plugins/woocommerce/

  2. ZjanPreijde
    Member
    Posted 1 year ago #

    Hi cbdaillaire,

    She short product description is like the excerpt of the post, in fact it is stored in exactly that field. Add this to your functions.php and see if it helps :
    'add_filter( 'the_excerpt', 'shortcode_unautop');
    add_filter( 'the_excerpt', 'do_shortcode');'
    I'm not sure what wp-favorites does, but for every product you can check a box [ ] Featured in the General Product Tab, and Woocommerce has a Featured Products Widget, so maybe this can accomplish what you want.

    I hope it helps

  3. ZjanPreijde
    Member
    Posted 1 year ago #

    That should read :

    add_filter( 'the_excerpt', 'shortcode_unautop');
    add_filter( 'the_excerpt', 'do_shortcode');
  4. cbdallaire
    Member
    Posted 1 year ago #

    I've added the code to the functions.php, but nothing changed.

    About the favorite thing, it's that I want my users to be able to have their "my favorites" page. Almost the same as a cart, but without the price, unit and other stuff.

    The plugin works in the product description, but not the excerpt. Some other shortcodes work in the excerpt though, as icons (theme shortcodes) ... (?)

  5. mikejolley
    Member
    Plugin Author

    Posted 1 year ago #

    The 'woocommerce_short_description' already allows shortcodes. I would say its a problem with the wpfp-link shortcode rather that the description section.

  6. miaorantes
    Member
    Posted 1 year ago #

    cbdallaire, did you get this to work? I am looking for the same functionality. Also, when it works in the product description area, does it save it so that when the customer returns and logs in it shows as a favorite? Is there a separate page or panel that shows all favorited items?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic