Digital experiences for all disciplines
New Landing › How can we help? › Atelier › get_post_meta() doesn't work when this theme is active..??
New Landing › How can we help? › Atelier › get_post_meta() doesn't work when this theme is active..??
- This topic has 10 replies, 3 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Atelier
-
July 6, 2015 at 2:09 pm #192021
I am the developer of the Offers for WooCommerce plugin. A user of the plugin that is using this theme reported that the plugin was not working correctly, but only when this theme was enabled. It works fine with other themes.
Upon researching the issue it seems that the get_post_meta() function is not returning any data for us within the plugin. I also notice that the theme seems to be using sf_get_post_meta() instead (and uses that same prefix in front of pretty much every function I see being used.)
I’m a little bit confused on how to handle this. Am I supposed to check to see if the Swift Framework is being used, and if so, add the sf_ prefix to all the core WP functions we use? That seems like an odd thing to have to do. Is there some other way I should be handling this so that my plugins work properly with your themes/framework?
Any information on this would be greatly appreciated. Thanks!
July 6, 2015 at 2:17 pm #192025Hi,
Will have to forward this one to our head developer.
Thanks-Rui
July 6, 2015 at 2:40 pm #192045Hi @AntRubano1
Thanks for reaching out to us. sf_get_post_meta does not override get_post_meta in any way, it simply retrieves the theme meta by making one call to the get_post_meta function, rather than tens/hundreds of times.
We’ll happily check the plugin here and see where the issue lies if you can attach it for us.
Thanks,
– Ed
July 6, 2015 at 2:45 pm #192048Here is the plugin
Attachments:
You must be logged in to view attached files.July 6, 2015 at 7:37 pm #192167I get these errors when enabling offers on a product – https://www.dropbox.com/s/vp0hvdxyecjob4s/Screenshot%202015-07-06%2019.37.28.png?dl=0
Same with T15 theme.
– Ed
July 6, 2015 at 8:04 pm #192171Well, that is very strange. We are unable to reproduce that here on any theme.
Can you please go into the Settings -> Offers for WooCommerce -> Display and just click save. Maybe we forgot to set defaults in the database and they aren’t holding until you save, by chance..??
Sorry, I know that has nothing to do with your theme/framework, but I’m thinking maybe that’s the only problem, and then you can reproduce what we’re seeing with the theme.
July 6, 2015 at 8:19 pm #192172That was it, thanks.
Tested again on both Atelier/T15, and when I submit the form, I get:
Uncaught SyntaxError: Unexpected token < dev/:1
– Ed
July 6, 2015 at 9:18 pm #192183Hi Ed,
I appreciate your responsiveness on this. Thank you.
The issue that we’re experiencing is that when we submit the offer we’re getting the following error back in the JSON response, which then makes it a bad response.
<b>Fatal error</b>: Call to a member function get_formatted_name() on a non-object in <b>/home/angelley
/sandbox_woocommerce/wp-content/plugins/offers-for-woocommerce/public/class-offers-for-woocommerce.php
</b> on line <b>955</b><br />When we trace that back what it comes down to is that the values we’re loading with get_post_meta() are empty, but it only happens with this theme. I guess you’re getting something different?
As for the error you’ve now mentioned here, can you tell me exactly where you’re seeing that? That’s another one I haven’t seen myself. Is submitting the offer what generates the error you mentioned? That would different than what we’re seeing on multiple setups, which is what I explained above.
Thanks again for your help with this. Really want to get this working so our stuff can work nicely along-side yours. ๐
July 6, 2015 at 11:51 pm #192193That is the exact same issue I’m getting here, only on Twenty 15 – https://www.dropbox.com/s/ph6mzyuiavt65ri/Screenshot%202015-07-06%2023.51.17.png?dl=0
EDIT: On both Atelier & Twenty 15.
– Ed
July 7, 2015 at 3:00 pm #192444Thank you so much for your time. I think we got it figured out here. I was able to make some adjustments and now offers are submitting as expected with the Atelier theme. ๐
July 7, 2015 at 10:55 pm #192562That’s great. Thanks Ed.
-Rui -
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.