- 28 Abr 2021, 14:20
#89289
Olá amigos, estou com um grande problema!
Eu uso o Open 3.0.3.2 com o thema Journal 3 e preciso de adicionar informações de texto ao lado do valor no grid.
Exemplo> R$ 19,90 à Vista, Sugestão de venda R$ 29,90. Tentei diversas opções, mas sem sucesso! O suporte da Open me orientou a mudar alguns arquivos, mas sem sucesso também! No caso, estou achando que eu que NÃO soube editar!
Gostaria que me ajudassem!
Esses são os códigos que o suporte da Open disse que eu conseguiria resolver!
Segue os cógidos> latest.php
-----------------------------------------//--------------------------------------
latest.twig
------------------------------------// ------------------------------------------------
latest.php PT-BR
Eu uso o Open 3.0.3.2 com o thema Journal 3 e preciso de adicionar informações de texto ao lado do valor no grid.
Exemplo> R$ 19,90 à Vista, Sugestão de venda R$ 29,90. Tentei diversas opções, mas sem sucesso! O suporte da Open me orientou a mudar alguns arquivos, mas sem sucesso também! No caso, estou achando que eu que NÃO soube editar!
Gostaria que me ajudassem!
Esses são os códigos que o suporte da Open disse que eu conseguiria resolver!
Segue os cógidos> latest.php
Código: Selecionar todos
<?php
class ControllerExtensionModuleLatest extends Controller {
public function index($setting) {
$this->load->language('extension/module/latest');
$this->load->model('catalog/product');
$this->load->model('tool/image');
$data['products'] = array();
$filter_data = array(
'sort' => 'p.date_added',
'order' => 'DESC',
'start' => 0,
'limit' => $setting['limit']
);
$results = $this->model_catalog_product->getProducts($filter_data);
if ($results) {
foreach ($results as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']);
} else {
$image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']);
}
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$price = false;
}
if ((float)$result['special']) {
$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$special = false;
}
if ($this->config->get('config_tax')) {
$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);
} else {
$tax = false;
}
if ($this->config->get('config_review_status')) {
$rating = $result['rating'];
} else {
$rating = false;
}
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $rating,
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'])
);
}
return $this->load->view('extension/module/latest', $data);
}
}
}
-----------------------------------------//--------------------------------------
latest.twig
Código: Selecionar todos
<h3>{{ heading_title }}</h3>
<div class="row"> {% for product in products %}
<div class="product-layout col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="product-thumb transition">
<div class="image"><a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" /></a></div>
<div class="caption">
<h4><a href="{{ product.href }}">{{ product.name }}</a></h4>
<p>{{ product.description }}</p>
{% if product.rating %}
<div class="rating">{% for i in 1..5 %}
{% if product.rating < i %} <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span> {% else %} <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span> {% endif %}
{% endfor %}</div>
{% endif %}
{% if product.price %}
<p class="price"> {% if not product.special %}
{{ product.price }}
{% else %} <span class="price-new">{{ product.special}} </span> <span class="price-old">{{ product.price}}</span> {% endif %}
{% if product.tax %} <span class="price-tax">{{ text_tax }} {{ product.tax }}</span> {% endif %} </p>
{% endif %} </div>
<div class="button-group">
<button type="button" onclick="cart.add('{{ product.product_id }}');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md">{{ button_cart }}</span></button>
<button type="button" data-toggle="tooltip" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="fa fa-heart"></i></button>
<button type="button" data-toggle="tooltip" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="fa fa-exchange"></i></button>
</div>
</div>
</div>
{% endfor %} </div>
------------------------------------// ------------------------------------------------
latest.php PT-BR
Código: Selecionar todos
<?php
// Heading
$_['heading_title'] = 'Novidades';
// Text
$_['text_tax'] = 'Sem impostos:';