Sort by price not working correctly in bookable products - woocommerce-bookings

It seems the sorting filter doesn’t work correctly with the bookable products, the conflict was with the booking plugin, I added simple products and tested the sorting it works.
Now, Can you help me to make it work correctly with the bookable products? or can you suggest another plugin for sorting work with bookable products.

Related

Advanced Search in Rails 5 with checkbox

I'm trying to make an advanced form in Rails.
I have two tables: Category and Tip. Each Tip has several Categories, and a Category can have several Tips. All relationships are done correctly (checked in console).
My goal is to create a form where a user can search for Tips according to one (or more) categories he has selected. I would like to do this in the form of a check box.
Do you have a tutorial to recommend? I'm trying to find some, but either they're under an old version of Rails with obsolete functions, or it doesn't meet my request.
After that, I would like to combine several search criteria (by city, by price range etc.).

Get User Stories with more than 5 Bugs in TFS

I want to select user stories with more than 5 bugs as children.
Using below query I can get user stories with at least one bug but filtering out the ones with less than 5 I'm lost.
How can I do this? Or is there any other way I can get this output? i.e: TFS extension
There is no build-in feature to count/filter linked work item's count of a specific work item type.
As a workaround, you could export tfs query results to Excel and manage the results in excel side. With the help of excel, you should be able to filter out those work items you needs.
Another way is using TFS API to get the work items and their linked work items with bug type, finally count the number of linked work items. About how to use API, please take a look at this related question: Retrieving work items and their linked work items in a single query using the TFS APIs
You can use in the query in "Related Link Count" field:

Rails how to sort search results based on popularity

Im working on the search feature for my app and I would like to give users the option for some sorting of viewing the recipes. Im trying to make a popular feature but Im not entirely sure where to start and if I need to make any modifications to my schema. Ive read this post http://sorentwo.com/2013/12/30/let-postgres-do-the-work.html and get the jist of what its doing. My main question is how do I track when a page is viewed and use that in the calculations? And also track views over time?
Also for using things like comments as a weight is it better to count the number of comments dynamically (query the comment table and add them up) or keep a column in the recipe table that gets added to whenever a comment is added?

Amazon Product API - How to get items for sale by price?

I have a strage requirement from a client, he needs to display a ramdom selection (100 - 200 items from mixed categories) of products for sale on & shipped by Amazon but ordered by price. The idea is to allow people find gift ideas based a user input price point.
I have been looking through the API docs but cannot see an obvious way to find search by price, I am thinking of writing a script to "copy" large parts of the amazon product catalogue into a local database & have it update every few weeks, then use this for user searches, but this does not feel right / their must be a better way.
Has anyone any experience with this type of problem? Thanks!
You would want to use the Amazon Product Advertising API. Using this API you would want to perform a SearchIndex-ItemSearch query. Possible parameters to ItemSearch are available on the API Docs here
You can see in the docs that you cannot query by MinimumPrice and MaximumPrice on SearchIndex: All. However, if you search specific indexes, it allows you to do a price related search.
I would guess that you can agree with your client which categories should the items be from. Then you can just query them one by one.
Amazon's database changes very often. Hence, caching data for a week without updating may not be desirable.

Rails joins with select issue

I am trying to follow the mantra of "select only what you need" when making database calls in my rails applications. Currently I am eager loading all users against their posts, however I notice that this selects every column from the user table for each users.
I have tried to use a join instead which offers a much easier way to select what specific attributes I need, however I am using paperclip and the user has_attached_file. I currently haven't found a way to include this in the join.
I was just wondering if anyone had any suggestions or tips on what the best way to load both users and posts is in terms of database performance?
Currently to retrieve users I am simply using this sort of syntax:
Post.all.includes(:user)
Have you tried Post.eager_load(:user)? Should fetch all the Post fields and all the User fields in a single query, and instantiate AR objects for each. Paperclip attachment would be stored in the user table under 4-5 fields starting with the same prefix. Those should be loaded through Post.eager_load(:user).
The only reason this wouldn't work is if the association between Post and User is polymorphic.

Resources