Description product page not work

#89823
  • Good afternoon. One setting doesn’t work, namely, if you go to settings, Headers and metadata – record types – Products. I specified this information in the product page description “%wc_sku% %wc_brand% %focuskw% ΠΊΡƒΠΏΠΈΡ‚ΡŒ Π² ΠšΡ€Π°ΡΠ½ΠΎΠ΄Π°Ρ€Π΅ %wc_shortdesc%”

    If you go to the product card, go to your SEO settings for the product, namely the description, then the following happens, global settings work in my case if there is no short description of the product at all, if there is a short description of the product, then my settings are not displayed in this form “%wc_sku% %wc_brand% %focuskw% ΠΊΡƒΠΏΠΈΡ‚ΡŒ Π² ΠšΡ€Π°ΡΠ½ΠΎΠ΄Π°Ρ€Π΅ %wc_shortdesc%”

    Interestingly the header works in the settings that are set globally in your plugin namely “ΠšΡƒΠΏΠΈΡ‚ΡŒ %title% ΠΏΠΎ Π»ΡƒΡ‡ΡˆΠ΅ΠΉ Ρ†Π΅Π½Π΅”

    https://yadi.sk/i/vIlkOCKwhkGULA
    https://yadi.sk/i/lCGoun_nASAO2g

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for getting in touch with us.

    This is the order we follow to generate meta descriptions for WooCommerce product:
    1. Content from SEO Description field
    If that is missing, then:
    2. WooCommerce Excerpt or Product Short Description
    If that is missing, then:
    3. Template From General Settings in WordPress Dashboard > Rank Math > Titles & Meta > Products
    If that is missing, then:
    4. Auto generated Content from the product page

    I added the provided filter to your theme functions.php to override WC excerpt and use the Global description settings https://rankmath.com/kb/filters-hooks-api-developer/#use-global-meta-description

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Good afternoon. I just went to the product to see if what you wrote helped, and I see that nothing has changed, my global settings still do not work if there is a short description of the product.

    Hello,

    The code needs to be customized for it to override the existing descriptions. I added the following code to do this, please check and let us know:

    
    /**
     * Use the Description from Global Setting, if the description is missing in the Post metabox
     */
    add_action( 'rank_math/frontend/description', function( $description ) {
     global $post;
     $desc = RankMath\Post::get_meta( 'description', $post->ID );
    
     if ( is_product()) {
     $desc = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" );
     if ( $desc ) {
     return RankMath\Helper::replace_vars( $desc, $post );
     }
     }
    
     return $description;
    });
    

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Good afternoon. I checked, nothing changed.

    Alberto
    Rank Math business

    Hello,

    The login link seems to have expired, could you check it?

    Looking forward to help you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    I checked your site and the globally set description seem s to work from my end. Please note that since you this is modified using a filter, it will only show the correct meta in the front end, not in the preview.

    To confirm this, I made a small modification(reverted later) to you global settings and added some testing text instead. This seemed to update perfectly in the front end of your page, please check the screencast I have added in the sensitive section.

    To confirm if the correct meta is added to your product page, please check your page source or use this tool: https://www.heymeta.com/

    Hoping this helps you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Description product page not work’ is closed to new replies.