I run my B2C biz via Wix store, we are now launching B2B.
The B2B products are different than the B2C, hence I would need 2 different Wix Store product gallery pages, one for B2C and one for B2B. P roducts cannot show mixed among themselves.
The issue is that when I create a product in the Wix Store dashboard, it is created as a general product. Ideally, I would have added an attribute to the Product Table like “Segment” populated with “B2B” or “B2C” for each product and while the page is loading I would have filtered the collection by this attribute to show either the B2B or the B2C products only.
The point is that I cannot touch the Product table schema, so I was thinking about a workaround like creating a B2B and a B2C collection and filter on load by collection, but again I do not know how much I can customize the default product gallery to show up prefiltered by collection type. Hence I was thinking about doing this with a normal dynamic page or a repeater reading from the Product table. In that case, can I retrieve the dynamic URL of every product in the B2B collection and populate buttons pointing to the individual product pages?
Overall do you see any smarter way to achieve this?
Before start coding and find potential blockers, I just wanted to double-check with some experts if this is feasible.
How about a new collection of productSegments with segments B2B and B2C. Each segment has its own product collection as property. So you just have to create dynamic pages based on collection productSegments.
Thanks a lot for your reply. This is definitely an option I am evaluating, just wanted to make sure that by doing it through a dynamic page and not using the wix store product gallery I can retrieve the dynamic url for each individual product page. I guess so but just wanted to double check before putting any effort in doing this.
My collection is called “B2B”, I have a dropdown where I can choose “B2B” or “B2C”. I am aware the the collections field of a Wix Store product object is a reference and accepts only the function hasSome().
Wrote the following simple code
export function dropdown1_change(event) {
let myValue = $w( “#dropdown1” ).value;
console.log(myValue); //this is correctly logged “B2B”
$w( “#dynamicDataset” ).setFilter(wixData.filter()
.hasSome( “collections” , myValue)
);
$w( “#dynamicDataset” ).refresh()
.then(() => {
console.log( “Done refreshing the dataset” );
});
}
but it is not working, the dataset refreshes on the onchange event of the dropdown but it is empty.