I have a design for an ecommerce store using Woocommerce, and on the home page there are 2 sections, Discounted Items and Latest Products. I am quite new to bricks, I have only built one site with it - a simple non ecommerce site.
I have been playing around with the query builder but I cant seem to figure out how to get them to work. I have attached the design so you can see what I want to achieve.
For the newer products, there is a setting in Bricks settings in the Dashboard, to show the “New” badge for products less than xxx days, configured by you (if you want to show the badge).
Now for the Query I am not sure if I have the correct answer but one approach should be the Query Loop and setting the “Order By” to descending Publich date, as presented in Bricks documentation Query Loop – Bricks Academy (bricksbuilder.io)
Even simpler follow the 1st solution above, without toggling the “On sale” button, and just set the “Order By” to descending Publish date again.
Maybe another solution could be to add a custom field in each product (using Advanced Custom Fields for example), and manually set which product you wish to present as “New”, and query only those products.
I am curious as well about someone else’s better solution about the Newer products!
I am actually a developer who despises Wordpress, and this is why…all of this I could have solved with React very easily…agggg!!
Okay, so 2 issues:
I am getting products listed that don’t have prices. Some products on the site need to be enquired about, so no price, but they still showing when I do the above.
Is it possible to put these products in a carousel…if not…can I create a custom query loop with divs, headings, etc to custom build it out?
I understand what you mean, but I guess there is always a tradeoff. The same as if you were trying to build an e-commerce from scratch using only React or Next or PHP/JS or anything else! Well now:
You can always use custom code inside your pages, or globally, PHP or JS or both. So I guess, IF there is no other built-in solution, you could rely on that!
You can create an element called “Slider (Nestable)”, and inside each Slide you can insert a “Products” element, or just a custom query loop following the documentation on how to build this loop.
P.S. I am not a Wordpress or Bricks expert user. I am always checking out and testing as many approaches I can so that I can conlcude to what I like the most. So, there could always be other, better or easier ways to apply what you describe. I just like this public exchange of info/knowledge!
So just have a little patience and hopefully someone else gives you a more viable solution!
There are always trade offs…in this instance its my sanity. I am having a really hard time wrapping my head around Bricks and Woocommerce, this query loop builder is just confusing. I built a simple woocommerce store with Nextjs, using the Woo rest api, and I was able to get a functioning store up and running in a week. I can’t get even the basic stuff to show in this store with Bricks, I am about to quit my job, I really do hate Wordpress. The solutions to most of the troubles I am having I know exactly how I would solve it in React/nextjs, but with this query loop builder and all these different options, I am completely lost and utterly frustrated.
Okay…rant over…I will give your solution a go and see how I can make it work. Though it seems your way of thinking about this problem will probably be the best solution.