Spinbox Posted May 20, 2024 Posted May 20, 2024 I'm having problems with retrieving attributes for Variants. This hook seems to not triggering for me: $this->addHook("/find-padloper_product_attributes/", $this, 'hookFindPadloperProductAttributesOptions'); When trying to find attributes it returns a 404. I'm using multilingual fields. 1
kongondo Posted May 20, 2024 Posted May 20, 2024 (edited) Hi @Spinbox, Please confirm if your ProcessWire is running off a sub-directory. I have tested on a ML site where Dutch is the main language and English the 'other' language and the hook works fine. What language are you searching in? Maybe it doesn't matter but just want to be sure. Thanks. Edited May 20, 2024 by kongondo
Spinbox Posted May 20, 2024 Author Posted May 20, 2024 Hi @kongondo, no I am not running of a sub-directory. I haven't changed anything, so I assume it uses the default language (in my case Dutch). I'm not sure it has anything to do with language. Isn't it just looking for the default language values?
kongondo Posted May 20, 2024 Posted May 20, 2024 Hi @Spinbox, Thanks for the login details. You have a 5 errors that are showing during the Ajax call. These are coming from your templates and func files. I think they are interfering with the response. I'll fix this on your site and test again.
kongondo Posted May 20, 2024 Posted May 20, 2024 Nope; that was not it. Still investigating. Maybe something in your ready.php hijacking the request.
kongondo Posted May 20, 2024 Posted May 20, 2024 Yep. The hook is not even firing. Something else is handling the request. I'll check ready.php and similar. 1
kongondo Posted May 20, 2024 Posted May 20, 2024 Nothing wrong with ready.php I think this is what is happening: Padloper is using virtual URL hooks. It means it needs to handle the 404s in the backend for the requested URL. On your site, something is preventing this from happening meaning ProcessWire returns 404s for those virtual URLs. I don't know what that 'thing' is on your site ...yet?. 1
Spinbox Posted May 20, 2024 Author Posted May 20, 2024 Thanks for looking into it, I'm going to check what could be the problem..
kongondo Posted May 20, 2024 Posted May 20, 2024 No worries. I'll PM with details of the changes I made to your func and template files that were throwing errors.
Spinbox Posted May 21, 2024 Author Posted May 21, 2024 Thank you @kongondo, You got me on the right path and I have found the issue. My homepage template has url segments enabled. Once I disable this, the url works. Not sure if this contributes to the problem but I use TemplateEngineFactory. To keep url segments I used a regex to allow anything but paths that start with find-padloper in the template settings. regex:^(?!find-padloper).*$ 1
kongondo Posted May 21, 2024 Posted May 21, 2024 @Spinbox, also check if the frontend works. Padloper uses virtual URLs in other places. E.g. to add items to the cart, downloads, etc.
alexm Posted June 28, 2024 Posted June 28, 2024 Hey @kongondo and @Spinbox. Did you get the add to cart feature etc working with URL segments on on the homepage? I too have an instance, where the homepage has URL segments enabled and when enabled the padloper/add/ segments aren't processed correctly. When disabled, of course addToCart and the url segments are handled correctly. The thing is, I'd ideally like URL segments enabled as they convert LoginRegister's get url params to url segments.
alexm Posted June 28, 2024 Posted June 28, 2024 I've worked around this by running LoginRegister's processes on another template, so all good for me now ?? 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now