Mikko
Forum Replies Created
-
Forum: Plugins
In reply to: [Age Gate] Function and hook reference?Actually, I worked out the following method:
- Refresh page when Age Gate is passed using the JavaScript event:
window.addEventListener(‘age_gate_passed’, function() {? ? location.reload();
}) - Checking if cookie is set in my PHP template; after the refresh it is correctly set:
$age_passed = isset($_COOKIE[‘age_gate’]);
$age_passed is my boolean variable to use on elements to render only when the Age Gate was passed. Does this sound like it would work?
Hi Alex,
I got this working now! I had replaced the original plugin_dir_url(__FILE__) with get_template_directory() + my path to dir. This didn’t work as it produced an absolute path. I then just wrote the whole relative path to my dir starting from /wp-content/ with no preceding functions. This will be my parent theme path and remain the same so it’s OK to hardcode. So it’s solved, thanks for your help!Hi Alex,
Meanwhile, I tried to tinker this and hardcoded the style and script enqueue path in the class-hm-wp-scss-admin.php file, lines 88-89 and 112-113. I got rid of the console errors, but the following error persists in the server log and styles&scripts are not loaded:
CreateFile() "C:/Users/me/Local Sites/mysite/app/public/wp-content/plugins/C:/Users/me/Local Sites/mysite/app/public/wp-content/themes/my-theme/lib/plugins/happy-scss-compiler/admin/js/hm-wp-scss-admin.js" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: , request: "GET /wp-content/plugins/C:/Users/me/Local%20Sites/mysite/app/public/wp-content/themes/my-theme/lib/plugins/happy-scss-compiler/admin/js/hm-wp-scss-admin.js?ver=1.3.10 HTTP/1.0"
Obviously, the path is still wrong somewhere. I’d be grateful if you could point me to the right direction!Hi Alex,
Thanks for your response! Yes, I have error messages! Both in the server log and in the console. It seems the GET method isn’t finding the following files:
/happy-scss-compiler/includes/highlight/styles/ir-black.min.css
/happy-scss-compiler/admin/css/hm-wp-scss-admin.css
/happy-scss-compiler/includes/highlight/highlight.min.js
/happy-scss-compiler/admin/js/hm-wp-scss-admin.js
The path used is definitely wrong. It starts with /wp-content/plugins/ and continues with a full absolute path to my changed plugin directory, something like C:/Users/…/wp-content/themes/my-theme/lib/plugins/happy-scss-compiler/… where the last part is the correct path to where I save and include the plugin in my functions.php. As I wrote earlier, I have moved the plugin away from /wp-content/plugins/ in a subfolder in my theme.
Is there a way to redefine the paths to these asset files for the plugin in some way prior to including the main plugin file?Thanks again Priyanka!
It took me a while to implement the code but now that you had an update I had to do it. And it worked like a charm!
Thanks a lot, great support!
Best regards,
MikkoHi Priyanka,
Thanks a lot, this worked out perfectly. I guess when I update the plugin, these changes are lost?
Best regards,
MikkoForum: Plugins
In reply to: [YITH WooCommerce Ajax Product Filter] No filters showing up at allOh, one more thing, FYI. My configuration is WP 4.9.8. and WC 3.4.4 (newer than yours) and PHP 7.0.30.
Forum: Plugins
In reply to: [YITH WooCommerce Ajax Product Filter] No filters showing up at allThanks for the follow-up.
Between my question and your answer I already disabled all other plugins. The problem still persists with only WooCOmmerce and YITH WooCommerce Ajax Product Filter enabled. I haven’t modified any of my theme files, although I do have some custom CSS defined within the theme (Avant). None of that CSS changed however before YITH Product Filter went bust.
The theme change I didn’t try, and probably will not, since with nothing more to try on my own and with my network, I already went for another product filter. That works on my site now. Don’t want to go and fix anymore anything that works.
Sorry, thanks ?? - Refresh page when Age Gate is passed using the JavaScript event: