I have a basic wix store. It uses the Products and Collections store tables. I am trying to figure out how to filter a dynamic dataset to include only products that belong to a collection. The collection is provided as a query string, so it should be loaded dynamically. The products and collections are many-to-many.
Example: If I want my dataset to be populated with all "clearance" products, the url would look like /collection/clearance, and the product dataset would contain only products tagged with the clearance collection; of /collection/fuzzy would show only products that were in the fuzzy collection.
There seems to be no relational data in these pre-built tables.
Thanks!
Old post closed.
This is because if you look at the Wix Stores app Product collection, then you will see that the collections field is a reference field and can only be filtered through code with the hasSome query function.
https://support.wix.com/en/article/corvid-wix-stores-product-collection-fields#collections-collections
Collections (collections)
Description: The collections the product belongs to. Type: Reference (Multiple Items) Can connect to data: No Can use in dynamic page URL: No Can be sorted: No Can be filtered: hasSome Read-only: Yes
To understand more about using and displaying reference fields, then that is already well explained in the Wix Support pages.
https://support.wix.com/en/article/about-reference-fields-in-database-collections
https://support.wix.com/en/article/field-type-support-and-limitations-in-the-data-manager
https://support.wix.com/en/article/displaying-content-from-multiple-database-collections-using-reference-fields-4034931
https://support.wix.com/en/article/working-with-multiple-item-reference-fields
https://support.wix.com/en/article/displaying-content-from-multiple-database-collections-using-reference-fields
I was able to filter a Stores/Products dataset by Collection to display products in a repeater on a dynamic page I created. But in order for it to work, I had to add TWO datasets: One for Products and one for Collections. Then cross filter them.
Everyone’s situation is different. But hope this helps.
Any Comment from a Moderator. This thread is still unresolved and not sure why this functionality exists on all wixdata, but not on wixdata from wix stores?
Wix allow to add product dataset filter is 'collections' reference field, but can't connect it to a dropdown list. I don't understand Wix :( This is a basic function, at least in products searching :(
i have the same problem,
i'm wondering to have a one shopping page , with the horizontal menu bar contain links to each collections, then products gallery/repeater underneath which will change based on the collection selected in the horizontal menu bar, so that visitor don't need to change the collections display with filter.
and instead of "LOAD MORE" button, it will good if it has a numbered page underneath the products gallery.
also when i have a different amount of products in collections, and i change the filter from "most product" collections to "less products" collection, the distance of the page to footer didn't update, which make a huge blank space between product gallery and the footer.
Hope wix will make an update, which answers much feature-requests that have so much votes already, so that wix will not only good and easy for making a landing page but also good and easy for making an ecommerce websites, or even any type of website.
Hi @Bryan Vagis and @Gaspar Melsión, I think I figured out a solution possibly with the standard store setup. Let me know if you would like to discuss . You can contact me at tomjohnson@johnsonsflorists.com . It maybe to long of discussion for here. I thought maybe we could collaborate there and then post later if everything looks good.
Tom
I wish I had better news to tell you guys, but the best solution I came up with is not a good one. The details are explained in my previous post.
The long term result of this will be my avoidance of using Wix for clients who want eCommerce websites. They have a good platform, but the lack of basic, expected functionality is a deal breaker.
Cheers!
Bryan
Hi @Bryan Vagis, I am looking for the exact same functionality which you described and also wondering if you did any work around for this? It's crazy to think how you would have to change x number of product pages for little edit and to think how many more you are going to do. Like for your instance if you made 50 edits, that end up being 2,500 edits you would have to do....:) I think you are right to the fact that they are purposely hiding this functionality, but I don't understand why. But how else can they display collection sets on the store grids? And how does it display all the different products in the different collections in the store products page if they are not already linked together. I just don't understand why you would hide this. I was going to create a separate table to link the two together. Then will have to create some process to re link the two each time I do an import of products.
There could be some functionality that is not there yet for other dynamic stuff to work.
Hello Bryan,
Thank you very much for your detailed and super fast response! I appreciate it very much.
Exactly what I didn't want to hear, but what I was expecting... It is really a missing feature and feels that should be adapted to the dynamic pages thing.
Let's see if we can get it anytime soon.
Thanks again!
Gaspar
#feature #request
Hi Gaspar,
Unfortunately I never did find an acceptable solution. This seems like a huge feature missing from the framework. It would appear that the relation between the two tables was purposely hidden. I'm not sure why.
I ended up creating a dynamic page that didn't filter by category for search results, and separate pages for each of the categories my client wanted to display. So now there are about 30 product pages that are all exactly the same, but just display a different category. I didn't have time in the budget to keep messing with it.
This is likely not what you want to hear, but I couldn't come up with a better solution without some major re-work.
Cheers!
Bryan
Hello @Bryan Vagis,
I am looking for the exact same functionality you asked here, and was wondering if you have found any workaround in the end to prevent building separate pages for each collection?
Thank you beforehand!
cc @Sapir (wix) @Sapir Hamtzani
It would be great if I could use the product gallery and dynamically change which collection it displays. However, this seems to be left out of it's abilities for some reason. It is not practical to have users search for one of the many collections defined in these filter settings to display what I want. I'm sure this works great for stores with just a few items in them, but we have lots of products, and a large number of collections.
What I am trying to achieve is having one page that can display any product collection I send to it. Customers should be able to click on links for a certain collection, or use the search function to find products. I want only one products page to that I have to maintain, instead of 50. If I decide to change the style of one product collection page at the moment, all the others still use the old style until they are manually edited one by one. This is not practical or maintainable especially since the store will continue to grow.
Searching and displaying only products from a single category is critical. It is amazing to me that these features are not part of the wix store. How often do you go to Amazon.com or Ebay.com, or any other online retailer without using the search function? My guess is very rarely if not never.
My product display page should be able to take in a category, and an optional search parameter. Wix seems to go out of their way to make this difficult. The optimum solution would be to be able to use the product grid gallery, and dynamically change which category is displayed. This seems like it should be a simple function for it. On top of that, setting a search filter would be fantastic. However, since it cannot do these things, I need to create a separate page to do so.
Hi,
I understand what you're trying to achieve and instead of writing your own code ( what will make it more complicated for you) I suggest you to use this wix store built in feature:
https://support.wix.com/en/article/adding-sort-and-filter-options-to-a-wix-stores-product-gallery
Best,
Sapir
Thank you for the reply. Unless I'm missing something, that will not work. Again, I am using the standard, built-in products and collections tables. If I look at the database tables, there is no relational information that I can find between the two. The products do not seem to have a "collection" field that I can set the filter on. Each product can belong to many collections, each collection can have many products in it. If I export the product list, it does have a collection column with a semi-colon separated list in it. However, this column does not appear in the table
Hi Bryan,
You can use setFilter() function.
Add an onReady() function to the dataset and inside the handler add the setFilter() function.
$w.onReady(function () { $w("#dataset").onReady(() => { $w("#dataset").setFilter(wixData.filter() .eq("the field name", "The collection name (the string)") .then(() => ( }) }); });
If there is a problem, please send us a URL to your site and specify the name of the page.
Which page is the one that lead to the page that you wish to present the products there?
Best,
Sapir