this works fine but I’d like to remove the productid part.
The issue is that the landing page uses repeat regions tied to the productid so I’m struggling to get the page to load content by using e.g. productseo
If the productid is used to filter your database queries, then if yo remove it from the url, the queries won't receive any filter value so they won't be filtered correctly.
You can remove productid from the url, but then you need to pass some other value to filter your queries and you need to edit them to setup the new value as a filter.
Yes, this is the issue, I am using productid for the other nested repeats on that page from 3 other tables so the productid might have to stay unless I can work something else out.
if I swap the query to match productseo, this will bring the page up but it will break the groupName, keywordName and colourName as those tables only have a shared productID.
Is there a way to create a separate query that links them together?
message: "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `productID` in (?)) ORDER BY `groupName` ASC' at line 1"
If you only need it for a single product then first do a query on the main product table and then in a second step query the subtable using the id retrieved in the first query.
That’s what I’m aiming to do but the productid is the only thing that references in the sub-tables so I cant use the e.g. productseo reference for those
You don’t need to handle this on the page - it's better to do it server-side.
Filter your initial query using the producttypeseo URL parameter (assuming it’s unique). Then, use the returned productid from that query to filter the remaining queries on the server.
Finally, output the results on the page without applying any additional filters, since the data is already filtered server-side.
Could you show the query as you had it where you get the error. It should also work with a single query where you have them as sub tables. Make sure to include the productID in the output of the query.
Solved. I started building the page queries again and took it down to a single query.
The issue was that I had my main filter set (changed to productseo), this worked of course.
Then, the issue was that I also had filters set for the e.g. colours table using the productid of the product table which caused a 500 error.
The solution was (probably obvious to more experience Wapplers), was to completely remove the filter for e.g. colours table as it couldnt find product id.
This now ran with success.
I then adjusted the nested repeats accordingly and it worked.
Big lesson for me, I thought that I needed to keep adding queries when it could all be done in one query.