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 20, 2014 at 6:21 am #121306
Hi Mohammad.
Plugin code is located at the quite bottom of the functions.php file, dante-child theme.
I’d like to display Short Description, the one you can write once you click on Meta Options tab>Product Meta>Product short description, first text field.
Not the second one, which is for long description and I left blank.Attachments:
You must be logged in to view attached files.October 20, 2014 at 6:52 am #121309Hi,
In which url will you check this short description? Actually i am testing so where to check this?
Thanks
MohammadOctober 20, 2014 at 7:00 am #121310This reply has been marked as private.October 20, 2014 at 7:07 am #121311Hi,
You just completed your question so i just resolved it so please check it now.
Code Used:-function lw_woocommerce_gpf_description( $description, $ID ) { $product_description = sf_get_post_meta($ID, 'sf_product_short_description', true); return $product_description; } add_filter( 'woocommerce_gpf_description', 'lw_woocommerce_gpf_description', 10, 2 );
Thanks
MohammadOctober 20, 2014 at 7:30 am #121315Hi Mohammad!
I’m testing right now.
It seems quite working, but not fully. In fact, the provided url retrieves broken data.
Is there a way to put $product_description within the plugin’s snippet?
Now it seems that description will be added in a separate way. ๐
I’ll forward this to plugin’s developer and let you know! ๐October 20, 2014 at 7:35 am #121316Hi,
Dont worry. I just solved it. Just say and we are here to help.
Thanks
MohammadJanuary 6, 2015 at 10:04 am #139270Sorry for delay!
To whoever may need this kind of info, especially who purchased and use Google Product Feed, I solved that with the following snippet in functions.php:function lw_woocommerce_gpf_description( $description, $ID ) { $product_description = strip_tags ( sf_get_post_meta($ID, 'sf_product_short_description', true) ); if ( $product_description ) { $desc = $product_description; } else { $desc = get_the_title( $ID ); } return $desc; } add_filter( 'woocommerce_gpf_description', 'lw_woocommerce_gpf_description', 10, 2 );
January 6, 2015 at 10:07 am #139273Hi,
I am glad that you managed to resolve the issue. Thanks for sharing the script.
Thanks
MohammadFebruary 5, 2015 at 9:28 pm #147699Hi guys!
Sorry to bother you.
I know this topic has been marked as closed, but I’d like you to help me with the following:
$product_description = sf_get_post_meta($post->ID, 'sf_product_description', true);
conflicts or gets in trouble with another snippet that points to$post->ID
.
Conflict generates when trying to inject a shortcode within the_content throught snippet in a group of specific posts.
My question is: is there another way to retrieve (short) description or to point out an array of posts? I have to do one of these two without using the same$post->ID
method. Can you help me with a useful hint?
I hope so, guys! .)February 6, 2015 at 8:51 am #147745Hi,
There is no another way to o retrieve (short) description.
Thanks
Mohammad -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.