[Résolu] Problème de langue dans le module minislider
Publié: 17 Juin 2011, 08:32
Bonjour
J'ai trouvé sur le forum anglais un module permettant de faire défiler les produits d'une boutique. Ce module se nomme "Minislider". voir exemple sur ma boutique : http://www.decapod.fr/boutique. il fonctionne très bien, mais le problème est qu'il inscrit mes produits en anglais et non en français, car je travail actuellement sur la traduction de mon site en langue anglaise. La langue par défaut dans opencart est le français. Voici le code de la partie catalog.
Quelqu'un pourrait il me dire ce qu'il manque dans ce code pour avoir la description de mes produits en français.
Grand merci par avance.
J'ai trouvé sur le forum anglais un module permettant de faire défiler les produits d'une boutique. Ce module se nomme "Minislider". voir exemple sur ma boutique : http://www.decapod.fr/boutique. il fonctionne très bien, mais le problème est qu'il inscrit mes produits en anglais et non en français, car je travail actuellement sur la traduction de mon site en langue anglaise. La langue par défaut dans opencart est le français. Voici le code de la partie catalog.
- Code: Tout sélectionner
<?php
class ControllerModuleminislider extends Controller {
public function index() {
if ($this->config->get('iconmodule_status')) {
$this->data['iconmodule'] = html_entity_decode($this->config->get('iconmodule_code'), ENT_QUOTES);
} else {
$this->data['iconmodule'] = '';
}
$this->load->model('catalog/minislider');
$this->load->model('catalog/product');
$this->load->model('catalog/review');
$this->load->model('tool/seo_url');
$this->load->model('tool/image');
$this->data['heading_title'] = htmlspecialchars_decode($this->config->get('minislider_title'));
$this->data['show_category'] = $this->config->get('minislider_category');
$this->data['show_effect'] = $this->config->get('minislider_effect');
$this->data['products'] = array();
foreach ($this->model_catalog_minislider->getRandomProductByCategoryId($this->data['show_category']) as $result) {
if ($result['image']) {
$image = $result['image'];
} else {
$image = 'no_image.jpg';
}
$rating = $this->model_catalog_review->getAverageRating($result['product_id']);
$special = FALSE;
$discount = $this->model_catalog_product->getProductDiscount($result['product_id']);
if ($discount) {
$price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
$special = $this->model_catalog_product->getProductSpecial($result['product_id']);
if ($special) {
$special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
}
}
$this->data['products'][] = array(
'name' => $result['name'],
'model' => $result['model'],
'rating' => $rating,
'stars' => sprintf($this->language->get('text_stars'), $rating),
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')),
'price' => $price,
'special' => $special,
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id'])
);
}
if (!$this->config->get('config_customer_price')) {
$this->data['display_price'] = TRUE;
} elseif ($this->customer->isLogged()) {
$this->data['display_price'] = TRUE;
} else {
$this->data['display_price'] = FALSE;
}
$this->id = 'minislider';
$this->template = $this->config->get('config_template') . '/template/module/minislider.tpl';
$this->render();
}
}
?>
Quelqu'un pourrait il me dire ce qu'il manque dans ce code pour avoir la description de mes produits en français.
Grand merci par avance.