I have a view where I need to use a shortcode attribute to filter. So, I created another view that gives me what I need. When I add that to the first view it terminates the first view and only shows the second...
My View: [wpv-view name="first-view" brand="[wpv-view name='second-view']"]
The output on the page looks like this: [wpv-view name="first-view" brand="12,73,194,16"]
So the second view executes but the first view doesn't. Any idea why, and how to get both to execute?
Its not possible to have a view as a parameter like this. The brand ID numbers are generated from ?
This seems better to be a nested view setup rather than passing the second view as a parameter, please provide some more details on what you're trying to achieve.
I think what I would need then is a wrapper shortcode that would strip out duplicates.
I need to get the woocommerce taxonomy back (brands is the attribute). So I have the view that queries all products and the output is the brand ID (taxonomy ID). The only problem is that it outputs for each product, which means 20 duplicates for each brand ID.
Can I wrap this in a shortcode that will reduce the dupliactes and only output unique values?
So you child view is being filtered by a fixed number of Brands ID ? Because you can just add a taxonomy filter to your products view and then set the fixed taxonomies that this view should return the products for.
What I see you're doing is filtering your child view by the Brand ID's when you can just add a filter for it and select the brands that you want to display products for.
Can I wrap this in a shortcode that will reduce the dupliactes and only output unique values?
I would not rule out the possibility of this but I would try other alternative methods first.
The ultimate goal is filtering a taxonomy (brand) of products that are within a single category.
So I figure I need to get all products filtered by category. This gives me a reduced list.
Then I need to output the brand. This gives me a list of brands - but if there are 4 brands and 100 products I could potentially get each brand listed 25 times.
I need to go into a category and output all brands that are in that category (and child category) for the category's products. In the above example, it should output 4 brands.
Its best if you nest them. This means you will add your first view into your second view so your first view is filtered by the second view. For a tutorial on how to do nesting of your views please have a look at the link below.