Serving Size Not Changing Ingredients
-
Hi,
We have noticed that the servings size change is not changing the recipe quantities any more. Is this a known issue or unique to our setup? (running Cooked plugin Version 1.7.15.3 )
-
@flinty2000 Thanks for bringing this up. Will be pushing out a fix today.
@flinty2000 I released v1.7.15.4. Can you take a look as see if this fixes your problem?
Hi,
Updated but the issue still there: https://greedy-panda.com/2024/02/mexican-taco-soup/
@flinty2000 I can see that your website is still serving a cached version of the JavaScript files using LiteSpeed Cache: https://greedy-panda.com/wp-content/litespeed/js/087d72295a04d759df241adb8e701d53.js?ver=01d53
Can you try to clear the cache and let me know what happens?
Hi.
Litespeed and browser cache cleared twice. Same issue happening:
I still see the old code on your website for some reason. The JavaScript URL is still the same: https://greedy-panda.com/wp-content/litespeed/js/087d72295a04d759df241adb8e701d53.js?ver=01d53 and the contents inside it have not changed.
Additionally there is also some other 3rd party functionality on your site that is overriding the URL when you scroll. I’m not sure if this is causing any issues or how it relates to the problem. But the first order of operation is to make sure you have the 1.7.15.4 version and also making sure that cache is cleared successfully.
Hi,
I’m at a loss. The plugin is updated to 1.7.15.4 and I even tried turning the cache off to see if the serving suggestions worked correctly but they still didn’t.
Regards
Interesting, it looks like the assets on your site are loaded form a separate directory and not the Cooked one. For example the JavaScript files are being loaded from https://greedy-panda.com/wp-content/plugins/pixwell-core/assets/cooked-reload.js?ver=1.0. So it seems like its the Pixwell Core plugin that has cooked-reload.js.
This is weird, It is probably related to the fact that the Cooked plugin was packaged with that theme.
I was able to track the issue down by downloading the Pixwell theme. It looks like there is code in that theme to remove the Cooked JavaScript file and replace it with its own.
if ( ! function_exists( 'pixwell_remove_default_cooked' ) ) { function pixwell_remove_default_cooked() { if ( is_plugin_active( 'cooked/cooked.php' ) ) { wp_deregister_script( 'cooked-functions-js' ); wp_register_script( 'cooked-functions-js', PIXWELL_CORE_URL . 'assets/cooked-reload.js', array( 'jquery' ), '1.0', true ); } } }I can give you the relevant code change that you need to make to the theme, if you are comfortable doing that yourself.
Hi.
Thank you for looking into this further for me. Sure I can try a code change.
Regards
@flinty2000 If you open up wp-content\plugins\pixwell-core\assets\cooked-reload.js and go down to about line #82 you should see this code:
if ($('.cooked-servings').length) { var servingsSelectField = $('.cooked-servings').find('select'); servingsSelectField.on('change', function (e) { e.preventDefault(); var thisVal = servingsSelectField.find('option:selected').val(); window.location = thisVal; }); }Replace that with this:
if ($('.cooked-servings').length) { var servingsSelectField = $('.cooked-servings').find('select'); servingsSelectField.on('change', function (e) { e.preventDefault(); var servings = $(this).children("option:selected").val(); const url = new URL(window.location.href); url.searchParams.set('servings', servings); window.location.href = url.toString(); }); }Hi.
Perfect! That fixed the issue.
Keep up the great work!
One small thing I’ve noticed is that the Pixwell coloured category menu isn’t appearing for all recipes. (some recipes show it and some don’t).
-
This reply was modified 2 years, 1 month ago by
flinty2000.
-
This reply was modified 2 years, 1 month ago by
flinty2000.
-
This reply was modified 2 years, 1 month ago by
flinty2000.
-
This reply was modified 2 years, 1 month ago by
flinty2000.
Ignore my last post. All is okay.
Thank you again and best wishes
Awesome, I’m glad it worked.
-
This reply was modified 2 years, 1 month ago by
The topic ‘Serving Size Not Changing Ingredients’ is closed to new replies.