Fórum OpenCart Brasil

Por um e-commerce livre, confiável e profissional

#69670
Quem quiser ajudar neste codigo acredito que seja util para todos :D
filtro para fabricantes ..
utilizei 2 codigos que possuia mais os 2 deram mesmo erro no final
dei uma empacada quem puder colaborar erro no final .



esta dando este erro
Fatal error: Uncaught exception 'Exception' with message 'Error: Unknown column 'p.manufacturer' in 'where clause'<br />Error No: 1054<br />SELECT COUNT(DISTINCT p.product_id) AS total FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '2' AND p.manufacturer_id = '16' AND p.manufacturer LIKE '16%'' in /public_html/loja/system/library/db/mysqli.php:40 Stack trace: #0 /public_html/loja/system/library/db.php(16): DB\MySQLi->query('SELECT COUNT(DI...', Array) #1 public_html/loja/system/storage/modification/admin/model/catalog/product.php(740):







Codigo
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Fabricantes filtro admin</name>
<id>Fabricantes filtro admin</id>
<version>1 xml</version>
<author>nos</author>
<link>mailto:</link>
<code>fabricantes_admin_busca</code>
<file path="admin/controller/catalog/product.php">
<operation>
<search index="0,1,2,3,5,6,7,8"><![CDATA[if (isset($this->request->get['filter_model']))]]></search>
<add position="before"><![CDATA[ if (isset($this->request->get['filter_manufacturer'])) {
$url .= '&filter_manufacturer=' . urlencode(html_entity_decode($this->request->get['filter_manufacturer'], ENT_QUOTES, 'UTF-8'));
}
]]></add>
</operation>
<operation>
<search index="4,9"><![CDATA[if (isset($this->request->get['filter_model'])) {]]></search>
<add position="before"><![CDATA[ if (isset($this->request->get['filter_manufacturer'])) {
$filter_manufacturer = $this->request->get['filter_manufacturer'];
} else {
$filter_manufacturer = null;
}
]]></add>
</operation>
<operation>
<search><![CDATA[$data['entry_status']]]></search>
<add position="after"><![CDATA[ $data['entry_manufacturer'] = $this->language->get('entry_manufacturer');]]></add>
</operation>
<operation>
<search><![CDATA[$data['column_action']]]></search>
<add position="after"><![CDATA[ $data['column_manufacturer'] = $this->language->get('column_manufacturer');]]></add>
</operation>
<operation>
<search><![CDATA['filter_model' => $filter_model,]]></search>
<add position="before"><![CDATA[ 'filter_manufacturer' => $filter_manufacturer,]]></add>
</operation>
<operation>
<search><![CDATA[$data['sort_model']]]></search>
<add position="before"><![CDATA[ $data['sort_manufacturer'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.manufacturer' . $url, 'SSL');]]></add>
</operation>
<operation>
<search><![CDATA[if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_model'])) {]]></search>
<add position="replace"><![CDATA[ if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_model']) || isset($this->request->get['filter_manufacturer'])) {]]></add>
</operation>
<operation>
<search><![CDATA[$data['filter_model'] = $filter_model;]]></search>
<add position="before"><![CDATA[ $data['filter_manufacturer'] = $filter_manufacturer;]]></add>
</operation>
<operation>
<search><![CDATA['filter_model' => $filter_model,]]></search>
<add position="before"><![CDATA[ 'filter_manufacturer' => $filter_manufacturer,]]></add>
</operation>
<operation>
<search><![CDATA['model' => $result['model'],]]></search>
<add position="after"><![CDATA[ 'manufacturer' => $result['manufacturer_id'],]]></add>
</operation>
</file>
<file path="admin/language/english/catalog/product.php">
<operation>
<search><![CDATA[$_['column_action']]]></search>
<add position="after"><![CDATA[$_['column_manufacturer'] = 'Fabricantes';]]></add>
</operation>
</file>
<file path="admin/model/catalog/product.php">
<operation>
<search><![CDATA[if (!empty($data['filter_model']))]]></search>
<add position="before"><![CDATA[ if (!empty($data['filter_manufacturer'])) {
$sql .= " AND p.manufacturer LIKE '" . $this->db->escape($data['filter_manufacturer']) . "%'";
}
]]></add>
</operation>
<operation>
<search><![CDATA['p.status',]]></search>
<add position="after"><![CDATA[ 'p.manufacturer',]]></add>
</operation>
</file>
<file path="admin/view/template/catalog/product_list.tpl">
<operation>
<search><![CDATA[<td class="text-left"><?php if ($sort == 'p.status')]]></search>
<add position="before"><![CDATA[<td class="text-left"><?php if ($sort == 'p.manufacturer') { ?>
<a href="<?php echo $sort_manufacturer; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_manufacturer; ?></a>
<?php } else { ?>
<a href="<?php echo $sort_manufacturer; ?>"><?php echo $column_manufacturer; ?></a>
<?php } ?></td>]]></add>
</operation>
<operation>
<search><![CDATA[<td class="text-left"><?php echo $product['status']; ?></td>]]></search>
<add position="before"><![CDATA[<td class="text-left"><?php echo $product['manufacturer']; ?></td>]]></add>
</operation>
<operation>
<search index="1"><![CDATA[<div class="form-group">]]></search>
<add position="before"><![CDATA[ <div class="form-group">
<label class="control-label" for="input-manufacturer"><?php echo $entry_manufacturer; ?></label>
<input type="text" name="filter_manufacturer" value="<?php echo $filter_manufacturer; ?>" placeholder="<?php echo $entry_manufacturer; ?>" id="input-manufacturer" class="form-control" />
</div>]]></add>
</operation>
<operation>
<search><![CDATA[var filter_model]]></search>
<add position="before"><![CDATA[ var filter_manufacturer = $('input[name=\'filter_manufacturer\']').val();
if (filter_manufacturer) {
url += '&filter_manufacturer=' + encodeURIComponent(filter_manufacturer);
}
]]></add>
</operation>
<operation>
<search><![CDATA[$('input[name=\'filter_model\']').autocomplete({
]]></search>
<add position="before"><![CDATA[$('input[name=\'filter_manufacturer\']').autocomplete({
'source': function(request, response) {
$.ajax({
url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_manufacturer=' + encodeURIComponent(request),
dataType: 'json',
success: function(json) {
response($.map(json, function(item) {
return {
label: item['manufacturer'],
value: item['product_id']
}
}));
}
});
},
'select': function(item) {
$('input[name=\'filter_manufacturer\']').val(item['label']);
}
});
]]></add>
</operation>
</file>
</modification>

Olá; Esse método de comprar sem cad[…]

Criar Módulos OpenCart

Bom dia pessoal, tudo bem. Estou a algum tempo pe[…]

Mudar nome do Destaque

Muito obrigado amigo! Resolveu!

obrigado Manoel, me ajudou muito. Então, o […]