skip to Main Content

i have problem when share a link my product or image on whatsapp not working. but the meta tittle and meta description work’s normally.

sample of product on opencart 3.x product like this:
https://safiramedia.com/headset-headphone-handsfree-jbl-c100si-mic-extra-bass-stereo-earphone-safiramedia

it make me headache. i need your help

2

Answers


  1. Chosen as BEST ANSWER

    i just follow article like this :

    first step, Dir File catalog/controller/product/product.php

    Blockquote put this script: $this->document->addMeta($product_info['meta_image'], $product_info['meta_title']); Blockquote putting script before: $this->document->setImage($product_info['meta_image']);

    second step: Dir File controller/common/header.php

    Blockquote putting script after: $data['keywords'] = $this->document->getKeywords();

    Blockquote put script like this: $data['links'] = $this->document->getLinks();

    Blockquote// $data['thumb'] = $this->document->getImage(); // $data['price'] = $this->document->getPrice();

    Blockquote putting script after: $data['styles'] = $this->document->getStyles();

    Blockquote putting this script: $data['metas'] = $this->document->getMeta();


  2. and the last step :

    dir file template>common>header.twig
    
    putting this script after:
    <title>{{ title }}</title>
    
    putting this script:
    <base href="{{ base }}" />
    {% if images %}
    <meta name="image" content="{{ image }}" />
    {% endif %}
    {% if description %}
    <meta name="description" content="{{ description }}" />
    {% endif %}
    {% if keywords %}
    <meta name="keywords" content="{{ keywords }}" />
    {% endif %}
    
    putting script after :
    <script src="catalog/view/javascript/common.js" type="text/javascript"></script>
    
    put script like this :
    {% for image in images %}
    <meta property="{{ meta.image }}" content="{{ meta.image }}" />
    {% endfor %}
    {% for image in thumb %}
    <meta property="{{ meta.image }}" content="{{ meta.thumb }}" />
    {% endfor %}
    {% for meta in metas %}
    <meta property="{{ meta.keyword }}" content="{{ meta.value }}" />
    {% endfor %}
    {% for link in links %}
    <link href="{{ link.href }}" rel="{{ link.rel }}" />
    {% endfor %}
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search