T
T
The_Beginer2020-02-13 10:27:26
opencart
The_Beginer, 2020-02-13 10:27:26

Doesn't show the characteristics of the product card in OpenCart?

The site supports 3 languages ​​(Russian, English, Georgian) There was a problem in this

In the product card, in the Georgian version, the Characteristics tab is missing.
picture-1.thumb.jpg.262d258105f7e446aff2

picture-2.jpg.10e332a74c1b8b149d82ee7603

picture-3.jpg.2c72a4bf683bcfec845521d228

At the same time, if I switch this page to Russian or English, then the "Characteristics" tab is visible

.

<a href="#tab-specification" data-toggle="tab" aria-expanded="true" style="background-color: rgb(255, 255, 255); color: rgb(119, 119, 119); border-color: rgb(119, 119, 119);">Характеристики</a>


lNI0p.png

nYxnT.png

Dxkiq.png

Please tell me which file I need to go to and solve the problem of view/theme/template/product/product.tpl? or in another?

AND FINALLY -The template developer

said about arrays but did not say where to find them...
-All attributes and characteristics are translated into 3 languages ​​and everything is displayed in the admin panel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
liza2019, 2020-02-29
@The_Beginer

attributes are selected by 2 parameters $product_id and $this->config->get('config_language_id')

$product_attribute_group_query = $this->db->query("SELECT ag.attribute_group_id, agd.name FROM " . DB_PREFIX . "product_attribute pa LEFT JOIN " . DB_PREFIX . "attribute a ON (pa.attribute_id = a.attribute_id) LEFT JOIN " . DB_PREFIX . "attribute_group ag ON (a.attribute_group_id = ag.attribute_group_id) LEFT JOIN " . DB_PREFIX . "attribute_group_description agd ON (ag.attribute_group_id = agd.attribute_group_id) WHERE pa.product_id = '" . (int)$product_id . "' AND agd.language_id = '" . (int)$this->config->get('config_language_id') . "' GROUP BY ag.attribute_group_id ORDER BY ag.sort_order, agd.name");

    foreach ($product_attribute_group_query->rows as $product_attribute_group) {
      $product_attribute_data = array();

      $product_attribute_query = $this->db->query("SELECT a.attribute_id, ad.name, pa.text FROM " . DB_PREFIX . "product_attribute pa LEFT JOIN " . DB_PREFIX . "attribute a ON (pa.attribute_id = a.attribute_id) LEFT JOIN " . DB_PREFIX . "attribute_description ad ON (a.attribute_id = ad.attribute_id) WHERE pa.product_id = '" . (int)$product_id . "' AND a.attribute_group_id = '" . (int)$product_attribute_group['attribute_group_id'] . "' AND ad.language_id = '" . (int)$this->config->get('config_language_id') . "' AND pa.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY a.sort_order, ad.name");

if you have them in 2 languages ​​and not in the third one, then $this->config->get('config_language_id') is defined incorrectly,
try the following line in the controller
$data['attribute_groups'] = $this->model_catalog_product->getProductAttributes ($this->request->get['product_id']);
write
print_r($data['attribute_groups']); exit;
and reload the card page in different languages. most likely in Georgian you will have an empty array.
then look for the problem why the language id does not match the language id by attributes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question