• Resolved pctec

    (@pctec)


    problems with wcfm and woodmart

    Hi. excellent plugin. I have wcfm installed along with the woodmart theme. in the sidebar of the seller’s store, there is the search box of your AWS plugin.

    I removed the option that when clicking on a vendor store link, wcfm opens a new window. But I have the problem that when going to a seller’s store, if the customer uses the top search bar of the site and searches for any other product that is not related to the store in which he is at that moment, AWS reports that there are no products.

    It seems to me that in the sidebar of the seller’s store, when doing a search, it only shows products related to the store. But in the main search bar of the site, this should not be the case.

    example: I am in a store of a seller that sells headphones. if I go to the top bar of the site and write “t-shirts” AWS says that there are no products…

    Any solution?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Looks like I found the solution for you. Please use following code snippet:

    add_action( 'wp_head', 'my_wp_head', 1 );
    function my_wp_head() {
    
                $store = $this->get_current_store();
                if ( ! $store ) {
                    return;
                }
    
                $form_action = AWS_Helpers::get_search_url();
    
                ?>
    
                <script>
                    document.addEventListener("DOMContentLoaded", function() {
                        let $awsForms = jQuery(".aws-container");
                        if ( $awsForms.length > 0 ) {
                            $awsForms.each(function( index ) {
                                if ( ! jQuery(this).closest("#wcfmmp-store").length > 0 && ! jQuery(this).closest("#wcfmmp-store-content").length > 0 ) {
                                    jQuery(this).find('form').attr('action', '<?php echo $form_action; ?>');
                                    jQuery(this).data('tax', '');
                                }
                            });
                        }
                    });
                </script>
    
            <?php }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Also, after adding this code you will need to go to the plugin settings page and click the ‘Clear cache’ button.

    Regards

    Thread Starter pctec

    (@pctec)

    Hello, thank you for your reply.
    Unfortunately the code you provided gives me a fatal error.
    Luckily for me, I use the plugin “Code snippets” and it allows me to disable the error codes.

    As the search engine is an important tool for my business model, I will buy the pro version and we will solve this issue with a support ticket. thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘problems with wcfm and woodmart’ is closed to new replies.