Title: Compare button action
Last modified: October 18, 2023

---

# Compare button action

 *  [levke21](https://wordpress.org/support/users/levke21/)
 * (@levke21)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/compare-button-action/)
 * Hi,
   It is possible that the Compare button (on product list and product page)
   opens the “comparative page” on the second click? If possible, how?Thank you.
   Regards,

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [levke21](https://wordpress.org/support/users/levke21/)
 * (@levke21)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/compare-button-action/#post-17183341)
 * In the meantime I solved the task.
   1. Edit the “frontend.js” file of the plugin.
   2. The following lines need to be replaced:
 *     ```wp-block-code
        woosc_remove_product(id);
               if (woosc_vars.button_action === 'show_message') {
                 $.notiny({
                   theme: 'woosc',
                   position: woosc_vars.message_position,
                   image: product_image,
                   text: woosc_vars.message_removed.replace('{name}',
                       '<strong>' + product_name + '</strong>'),
                 });
               }
          }
       ```
   
 * TO:
 *     ```wp-block-code
         if ((woosc_vars.page_url !== '') && (woosc_vars.page_url !== '#')) {
                 window.location.href = woosc_vars.page_url;
               }
             } 
       ```
   
    3. Save frontend.js file
    4. In the plugin settings, modify this setting: “Remove when clicking again = YES”
    5. Save settings
    6. Clear cache (all device)
    7. Test
 *  -  This reply was modified 2 years, 7 months ago by [levke21](https://wordpress.org/support/users/levke21/).
    -  This reply was modified 2 years, 7 months ago by [levke21](https://wordpress.org/support/users/levke21/).
    -  This reply was modified 2 years, 7 months ago by [levke21](https://wordpress.org/support/users/levke21/).
    -  This reply was modified 2 years, 7 months ago by [levke21](https://wordpress.org/support/users/levke21/).
 *  Thread Starter [levke21](https://wordpress.org/support/users/levke21/)
 * (@levke21)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/compare-button-action/#post-17303064)
 * The code section above does not work well from v6.1.7 for some reason. Worked
   fine v6.1.6

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Compare button action’ is closed to new replies.

 * ![](https://ps.w.org/woo-smart-compare/assets/icon-128x128.png?rev=1858171)
 * [WPC Smart Compare for WooCommerce](https://wordpress.org/plugins/woo-smart-compare/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-smart-compare/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-smart-compare/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-smart-compare/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-smart-compare/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-smart-compare/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [levke21](https://wordpress.org/support/users/levke21/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/compare-button-action/#post-17303064)
 * Status: not resolved