Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › how to get short description with a snippet
New Landing › How can we help? › Themeforest Theme Support › Dante › how to get short description with a snippet
Tagged: Google product feed, product short description, XML
- This topic has 24 replies, 2 voices, and was last updated 9 years by Mohammad – SUPPORT.
-
Posted in: Dante
-
October 16, 2014 at 7:15 am #120648
Hi there!
Guys, I need your help.
I purchased Google Product Feed from woothemes.com. It works pretty well. It accepts snippets and I tried the two ones its developer suggests in order to export short_description as a description in the xml file for google merchant center. The problem is that both get_the_excerpt() and get_the_content() will return a void content. I temporarily use get_the_title() in order to export something acceptable for google merchant center.
I opened a ticket to woothemes support for this topic. Since I got no useful suggestion, I decided to ask for this to you.
Is there something like get_post_meta(); or what in order to get short description?
Many thanks in advance for your help!Attachments:
You must be logged in to view attached files.October 16, 2014 at 7:50 am #120661Hi,
I am not sure about it. Please try to use this code:-global $post; $post->post_excerpt
Thanks
MohammadOctober 16, 2014 at 8:00 am #120669Hi Mohammad,
thanks for your reply.
If only you could help me in this, the following is the snippet to edit:function lw_woocommerce_gpf_description( $description, $ID ) { global $post; $save_post = $post; // $post = get_post( $ID ); $post->post_excerpt; setup_postdata( $post ); $excerpt = get_the_excerpt(); $post = $save_post; return $excerpt; } add_filter( 'woocommerce_gpf_description', 'lw_woocommerce_gpf_description', 10, 2 );
I tried, but I’m sure I was wrong, to add your code in that.
Nothing happened unfortunately… ๐
I forwarded to plugin’s support too.
What do you think about?October 16, 2014 at 9:11 am #120695Hi,
I am not sure. Please ask at plugin support.
Thanks
MohammadOctober 16, 2014 at 9:16 am #120698Already done! Many thanks anyway.
Should I close ticket or just wait to let you know how to fix this?October 16, 2014 at 9:28 am #120710Hi,
Where are you checking its working? Any specific url? I need your wordpress admin login detail.
Thanks
MohammadOctober 16, 2014 at 9:29 am #120711Just a thing: since it seems impossible to retrieve short description nor by get_the_content(); neither by get_the_excerpt();, does it have to do with meta box content or whatever?
October 16, 2014 at 9:31 am #120712This reply has been marked as private.October 16, 2014 at 9:40 am #120715Hi,
Please use this custom php code:-
$product_description = sf_get_post_meta($post->ID, 'sf_product_description', true);
Thanks
MohammadOctober 16, 2014 at 9:45 am #120717Thanks Mohammad!
Since I’m not a skilled developer, could you be so kind to tell me where should I put that code?
Thanks!October 16, 2014 at 9:47 am #120719Hi,
Please use this code:-function lw_woocommerce_gpf_description( $description, $ID ) { $product_description = sf_get_post_meta($ID, 'sf_product_description', true); return $product_description; } add_filter( 'woocommerce_gpf_description', 'lw_woocommerce_gpf_description', 10, 2 );
Thanks
MohammadOctober 16, 2014 at 10:02 am #120725Nice, but it doesn’t work. ๐ ๐ ๐
Mohammad, thanks anyway for your useful help!
I forwarded your snippet to plugin’s developer and I’m waiting for his reply.October 16, 2014 at 10:03 am #120726Hi,
Its ok and let me know your feedback.
Thanks
MohammadOctober 20, 2014 at 5:39 am #121300Hi Mohammad.
attached you can find a piece of woothemes support’s reply to this problem (i’m on mobile now and cannot take a full screenshot).
Anyway, this is what they wrote to me:Hey Alessandro,
As we suspected, the theme you’re using is not using the standard ‘short description’ field at all. It’s created its own description field, leading to this problem.
However, it’s definitely possible to do, it’s just that the theme developers need to figure out the code to use in the snippets we gave below.
If they just replace the code in our snippet with the code the theme uses to get the short description, it should work.
Sorry, themes really shouldn’t be doing that, causing you these problems ๐
Thanks!
Bryce (@bryceadams) – WooCommerceNinja
WooThemes SupportPlease, forward this to Ed. I need to know how to fix this thing.
Many thanks!Attachments:
You must be logged in to view attached files.October 20, 2014 at 6:00 am #121304Hi,
Where is this plugin code? Which specific information field do you want to display? In which field did you insert this information ?
Thanks
Mohammad -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.