Support » Plugin: YITH WooCommerce Compare » Yith Compare Button is not shown on a single product page

  • neposeda

    (@neposeda)


    We have a YITH Compare Plugin (free) on a kuteshop based theme.
    The checkbox in settings is checked to show the compare button on a single product page. But it does not.
    As I need the button right behind the “add to cart” and “add to wishlist” links, i try to insert a shortcode to template in add-to-cart/external.php (as I want it for external products)
    But it does not show. I see it in the source code as an epmty div.

    My code:

    <?php echo do_shortcode( ‘[yith_wcwl_add_to_wishlist]’ ); ?> <?php echo do_shortcode( ‘[yith_compare_button]’ ); ?>

    How to fix it?

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    could you try the default theme? just to see if it’s the theme.

    neposeda

    (@neposeda)

    ok, i will, but it takes time as we need to arrange another instance of the theme…

    Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    I understand that but it is the only thing that allows us to exclude an intervention of the theme.

    I have installed the original theme. And just modified the code of the
    content-single-product.php
    You can see the screenshots of code and results here https://drive.google.com/drive/folders/1ll5UFRyGpgKg4ejCHq2Xl_zUFDMOO_0X?usp=sharing

    the test page is here http://1616467.hpx.web.hosting-test.net/?product=galaxy-s-vii

    Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    I’m sorry but with “Default Theme” we means a Twenty20 theme or Storefront. However, in your screenshot I see works fine if you add the shortcode in template code. I think that your theme remove some standard WooCommerce action so you can copy this copy of template in child theme and use it or ask to theme author to restore the standard WooCommerce hook.

    How the shortcode should work? On my screenshot it generates an epmty <div class=”woocommerce product compare-button”></div>. No any button shows on the page in the place the shortcode is inserted (rigth behind “hello world”). No any signs on the product id to be compared?

    I expected that the shortcode will generate a button with something like this:
    <i aria-hidden=”true” class=”fa fa-refresh”></i><span>Compare</span>

    Shouldn’t it?

    Plugin Author YITHEMES

    (@yithemes)

    Hi,
    have you made the test we proposed you with a default WordPress theme (Twenty Twenty, Twenty Nineteen, and so on…)?

    Please try replacing this line in your code:
    <?php echo do_shortcode( '[yith_compare_button]' ); ?>
    with the following one:
    <?php echo do_shortcode( '[yith_compare_button product=' . get_the_ID() . ']' ); ?>
    and let us know if this will do the trick!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.