• sami_ch

    (@sami_ch)


    Hi,
    I’ve tested the plugin with only one product, the image URL is correctly displayed in dashboard after saving the page, but in the front-office your plugin is showing the media ID instead of the complete URL
    Here is my exemple :
    https://www.spi-tunisie.com/fr/lame-volet-roulant-en-aluminium-injecte/lame-alugix-39-5bombee/
    And here is the generated code :

    <script type="application/ld+json">{
        "@context": "https://schema.org",
        "@type": "Product",
        "name": "Alugix 39.5 Bomb\u00e9e",
        <strong>"image": "622"</strong>,

    How can I fix that ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • +1 for this, same issue. Would be great to get a solution as this is a top little plugin.

    I made a dirty hack to get around this until the plugins updated for this:

    Line 245 of KcSeoSchemaModel.php change this:

    if ( ! empty( $metaData['image'] ) ) {
         $product["image"] = $KcSeoWPSchema->sanitizeOutPut( $metaData['image'] );
    }

    to this:

    if ( ! empty( $metaData['image'] ) ) {	
        $image = wp_get_attachment_image_src( get_post_thumbnail_id( $loop->post->ID ), 'full' );
        $product["image"] = $image[0];
    }

    Worked for me and image URL’s for products now showing in the Schema as needed.

    Hope this helps.

    For me it was:

    
    $image_attributes = wp_get_attachment_image_src( $metaData['image'], 'full' );
    $product["image"] = $image_attributes[0];
    
    Plugin Author kcseopro

    (@kcseopro)

    This issue is fixed at our 2.1 version, Please use our latest version.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Image URL is wrong !’ is closed to new replies.