Woocommerce filter setup?

This topic contains 11 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 9 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #42730
    Troy Eccles
    Troy Eccles
    Participant

    Hi team,

    Great plugin!
    I’m trying to set up a woocommerce filter just like you have on your example page but I just can’t get anything like it.
    I’m using a multisite and have a specific product page that has fetched the required products.
    The price slider seems to work but it gives me ‘drop-down’ results instead of filtering the products on display.
    As you can see here:
    https://artwaiter.com/scenic/
    The other filters do nothing so I’m clearly doing something very very wrong.

    Do you have a tutorial specific to this?
    Troy

    #42743
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Troy,

    Thank you very much for your kind words!

    I assume you are reffering to the shop page search. In that case the plugin is added to the WooCommerce shop page (which is kind of an archive page), and the shop page live filtering is enabled.
    This feature is available also for post type, category and taxonomy archive pages too.

    Another different example is the woocommerce search, where we are using the plugin results container to display the results. I would rather recommend using it this way, as you have a singular page on the given URL.
    For that setup you can follow this tutorial, it will explain everything step by step.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #42758
    Troy Eccles
    Troy Eccles
    Participant

    Amazing. I’ve followed your tutorials….thank YOU!!
    But I’m not sure what step I’m missing as it’s still not working quite right.

    Two possible reasons:
    1. I’ve misunderstood completely how your filter works.
    2. I’m an idiot (<—this is the likely reason)

    I have a page that’s showing the fetched results of various woocommerce stores from multisites.
    I have your filter all set up.
    But it’s not showing the product ‘attributes’ as I expected (in this case, the dimensions and orientation of artwork)…it’s just showing the “select all”button.
    And if I just use the price filter, it’s not filtering the images I have on screen (this is where ‘option 2: idiot’ comes in as I suspect it’s not designed to work like this.

    Could you have a look at this link and you’ll see what I mean?
    https://artwaiter.com/scenic/#link_tab-1684649715933-2

    Thank you so much for all your help…I’m using your plugin elsewhere on the site and it’s incredible. I bought the ‘pro’ version for this filter and I’m VERY excited by it.

    Troy.

    #42760
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Troy,

    Thank you very much for your kind words!

    It’s all right, there are many many options on the back-end, it’s very easy to get confused. To me it seems familiar, but I am working on this for 10 years now.

    The main issue with your setup is that you want to filter items from across the network – and that unfortunately is not going to work. It is now a plugin limitation, but WordPress has separate database tables for taxonomy terms on each multisite blog. Terms are stored by IDs and are not distinctive across the sites – so a term by ID=123 can be “category X” on one site and something else on another (or it may not even exist).
    That makes filtering/excluding by term IDs virtually impossible on multisite networks. I’m am not aware of any possible solution to this at this moment, I’m sorry.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #42777
    Troy Eccles
    Troy Eccles
    Participant

    Hi Ernest.

    I really REALLY appreciate your help and I’m about 98% of the way to getting it how I want.
    I’ll find a solution to the filter on the main site so let’s forget that for now.
    On each subsite though, I’ll use your filter.

    So, to test this, I’ve built a staging site and I’d love you to have a look as there are a couple of things I cannot figure out.
    Link is here: https://artwaiter.redsquirreldesigns.com/

    Obviously you’ll see how I’ve set things up but can you help with the following:
    1. Is there a way of removing the “Settings Icon” and leaving the filter box open at all times (I don’t need it to be expandable)?
    2. Is there a way of magnifying the resulting images when they’re hovered over? (let’s say by 30%). If so, it’s fine if the resulting ‘zoom’ overlaps the other images…that’d look cool).
    3. How to increase the font size of the headings like “Filter by category”
    4. Is there a way of adding a “Add To Cart” option within the image box?

    I’ve a feeling that questions 1 and 3 will be easy for you, question 3 maybe a bit of custom css and question 4 might be impossible.

    Looking forward to hearing from you and, once again, thank you for an amazing product!

    Troy

    #42778
    Troy Eccles
    Troy Eccles
    Participant

    You know what, I forgot 2 more questions (and one of them is a REAL issue!)

    5. How to get rid of the outside box around the images? I got rid of the line by reducing the opacity but there still seems to be a container box?
    6. The filtering is a bit odd and I can’t work it out. If I have a product in 2 categories, if I only include one option in the search, it doesn’t show up.
    Let me give a live example: in my staging site, you’ll see a drawing of a woman in red in Paris. This image is in the categories of ‘Drawings’ and ‘Sets’. If I have both of these options checked, the image displays. If I have only one option checked, it doesn’t. I need the filter to be set so that if just one condition is met, the image will show. Possible?
    Forget this one…I found the answer.

    PS…the staging slight is VERY slow. I’m aware of this…it’s garbage. Sorry.

    Troy.

    • This reply was modified 9 months, 1 week ago by Troy Eccles Troy Eccles.
    • This reply was modified 9 months, 1 week ago by Troy Eccles Troy Eccles.
    • This reply was modified 9 months, 1 week ago by Troy Eccles Troy Eccles.
    #42780
    Troy Eccles
    Troy Eccles
    Participant

    Sorry to spam and edit but I’ve got the multisite filter working (kind of).
    We spoke earlier about this and you said it couldn’t work because it can’t fetch data across the network. However, I have another plugin that does this so your filter works! …almost.

    The searchbar works fine on the HOME page and I’ve set up a filter on a sub-page and it’s working with the price slider.
    However, the other filter options do not show a check box and the search area doesn’t work even though the search bar on the HOME page does. Huh?

    Could you look at it for me and see if you can work out why? The settings I have are almost identical to the filter on the staging site so I don’t get why this is failing.

    EDIT: this MIGHT be a clue(??). Once the filter has completed loading and you see the images, clicking ANYWHERE else on the page kills it.
    Weird huh?

    Home page (search bar near the top): https://artwaiter.com/
    Sub-page with the half-working filter: https://artwaiter.com/scenic/
    Staging site test filter: https://artwaiter.redsquirreldesigns.com/

    Thank you again and so SO sorry for the triple-post.

    Troy

    • This reply was modified 9 months, 1 week ago by Troy Eccles Troy Eccles.
    • This reply was modified 9 months, 1 week ago by Troy Eccles Troy Eccles.
    #42851
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    1. Yes, you can do that here: https://i.imgur.com/1G54wqT.png
    2. Only via custom CSS and transitions, something like:

    .asp_r .item:hover {
        transform: scale(1.05);
    }
    
    .asp_r .item {
        transition: all 0.1s linear !important;
    }

    3. Mostly it’s inherited from the theme, you may need to use custom CSS:

    .asp_ss form fieldset legend {
        font-size: 22px !important;
    }

    4. Only via custom code and to some views. Check this knowledge base.

    5. There is a box shadow around the box, you can remove it here or use this:

    .asp_r .item {
        box-shadow: none !important;
    }

    About the filter. The price range may work, because that is a custom field. Custom fields are stored very simply, those are not objects with IDs, but data in the meta table. If the field name matches in the other database (which does) then it will work. The price range default values may not be fetched as those are stored in the other site table, but if manually set, they will work just fine.
    Unfortunately the other filters are taxonomy terms, those are stored by ID, so this is not possible.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #42879
    Troy Eccles
    Troy Eccles
    Participant

    This is what I don’t understand though, Ernest.
    If I use the ‘search’ bar for an attribute (for example, I have an image size attribute of “8 x 10” and “6000 x 6000”), and use those attributes, it finds the images. So I figure if it’s finding the attributes (because the plugin I’m using is a multisite indexer), then why is it I can’t filter those attributes?

    I could understand it the search bar found nothing but the fact that it’s showing results is what’s confusing me.

    Thank you for your help so far. Amazing. And amazing plugin too!

    Troy

    #42901
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Because of the conflict of IDs for the filter. In case of the search the plugin “switches” database to look within the attribute values.
    In case of filters the values are meaningless, the posts are connected to the attributes via their IDs. It’s sort of a N to N type of connection between unique keys (IDs). Because these keys (IDs) are only unique for each blog then there is currently no way to print the filters and use them because of this conflict.

    In theory there is probably a way to get around it by somehow marking/transforming the terms with the site IDs, but currently there is no modification I can suggest to do that.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #42929
    Troy Eccles
    Troy Eccles
    Participant

    OK I THINK I understand but it’s a bit over my head.

    Again, thank you SO VERY MUCH for your help.

    So can I use Advanced Custom Fields On the subsite stores for the attributes so they can be filtered? I did try and set this up but your plugin couldn’t find the custom fields so I figured I was doing something wrong. I watched your YouTube video and it looked like I did things correctly but maybe Ajax Search Pro can’t find custom fields in a multisite setup??

    2nd question (and I think it might be related as to why the attribute search won’t work):
    I have pages set up to view artwork with specific category names (things like “Abstract”, “Scenic”, “Urban”, etc.). Each product on the subsite store is in one or more or these categories. But how do I set the filter to show ONLY those categories in the results? Currently it shows everything from which I can filter by price but I just wanted it to show only a specific category.

    Possible?

    Regards and thank you again.

    #42931
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    So can I use Advanced Custom Fields On the subsite stores for the attributes so they can be filtered?

    Very likely. If the field name does not show up in the filter input on the backend, you can still use it, it does not have to be found. In fact you can enter anything into that input, the plugin will still use it.

    The category restriction might be doable as well, but only programmatically:

    add_filter("asp_query_args", "asp_query_args_change", 10, 2);
    function asp_query_args_change($args, $search_id) {
    	$args['post_tax_filter'] = array(
    		array(
    			'taxonomy'  => 'product_cat',
    			'include'   => array(1, 2, 3), 
    			'exclude'   => array(),
    			'allow_empty' => false // Don't allow results, which does not have connection with this taxonomy
    		)
    	);
    	return $args;
    }

    The code above will restrict the results to categories 1, 2 and 3 from the product_cat taxonomy. Change that to the category IDs you need from the subsite.

    Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.