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

    (@yithemes)

    Hi vagu71,
    If you want to use only compare button in custom template, you can use this shortcode [yith_compare_button product=”the id of product to compare”]

    Let me know if it works. Greetings ??

    Thread Starter vagu71

    (@vagu71)

    Hi,

    Many thanks for your message. Was able to get the compare button on the content-product.php file successfully using the shortcode.

    Is there any way to trigger the compare popup using a link maybe?

    Basically, what we want is to be able to put a custom link somewhere on the archive-product.php file which triggers the compare popup.

    Our product archive does not have a sidebar and is 1 column full width. So adding a compare widget in the sidebar is not an option.

    So ideally, if there is a shortcode, or a php that outputs the compare popup code, we can put that in a bootstrap modal.

    Alternatively, if there is a code which can be added to the archive-product.php markup, that gets the popup, that’ll be awesome.

    We tried grabbing the code of the compare button from the sidebar manually and putting it on the archive-prducts.php file. The button came, but when clicked, it didn’t open the compare thing in a popup. Instead, it kinda redirected to another page which had that content. But yeah, it did get the content of the compare popup successfully.

    <a href="https://www.actualizestudiodev.com/testwordpressv?action=yith-woocompare-view-table&iframe=true" class="compare button">Compare</a>

    Plugin Author YITHEMES

    (@yithemes)

    Hi,
    try to add this code
    <a href="#" class="yith-woocompare-open button">Compare</a>

    Let me know if it works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Compare button only on a template file’ is closed to new replies.