New Landing How can we help? Themeforest Theme Support Dante how to get short description with a snippet

Viewing 15 posts - 1 through 15 (of 25 total)
  • Posted in: Dante
  • #120648
    alemarengo
    Member
    Post count: 695

    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.
    #120661
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I am not sure about it. Please try to use this code:-

    global $post;
    $post->post_excerpt
    

    Thanks
    Mohammad

    #120669
    alemarengo
    Member
    Post count: 695

    Hi 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?

    #120695
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I am not sure. Please ask at plugin support.
    Thanks
    Mohammad

    #120698
    alemarengo
    Member
    Post count: 695

    Already done! Many thanks anyway.
    Should I close ticket or just wait to let you know how to fix this?

    #120710
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Where are you checking its working? Any specific url? I need your wordpress admin login detail.
    Thanks
    Mohammad

    #120711
    alemarengo
    Member
    Post count: 695

    Just 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?

    #120712
    alemarengo
    Member
    Post count: 695
    This reply has been marked as private.
    #120715
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this custom php code:-
    $product_description = sf_get_post_meta($post->ID, 'sf_product_description', true);
    Thanks
    Mohammad

    #120717
    alemarengo
    Member
    Post count: 695

    Thanks Mohammad!
    Since I’m not a skilled developer, could you be so kind to tell me where should I put that code?
    Thanks!

    #120719
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    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
    Mohammad

    #120725
    alemarengo
    Member
    Post count: 695

    Nice, 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.

    #120726
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Its ok and let me know your feedback.
    Thanks
    Mohammad

    #121300
    alemarengo
    Member
    Post count: 695

    Hi 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 Support

    Please, 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.
    #121304
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Where is this plugin code? Which specific information field do you want to display? In which field did you insert this information ?
    Thanks
    Mohammad

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register