View Single Post
Old 08-18-2022, 09:52 PM
xcartdev2 xcartdev2 is offline

Advanced Member
Join Date: Nov 2011
Posts: 43

Default Re: Front end (Customer) product search logic and search results - worse than X-Cart 4?

Yes - I agree with you. It should be a module (and it will be) but just tinkering.

However this would not change the overall outcome. I would need to call GetData with byTitle set to 'Y' and then call it again with byTitle set to 'NULL'. That's two database calls.

Better would be one call which also collects all product info such as the name, description, attributes, etc. Then manipulate this array as needed.

The other issue is that getData is only called after the <head> area has been executed (it is called by getPageData). That's too late if you want to include specific info about a product (say the cheapest one) in the <title> or meta description.

So I'm thinking: how to call getPageData at the beginning (in the controller) and then change the twig so it only calls getPageData if a particular array (this.getPageData()) is empty (i.e. the function has not already been called)
Verion 4.7.12
Reply With Quote