Добрый день!
В карточке товара есть поле «Расположение», которое хочется задействовать под свои цели, а именно: поменять ссылку «Купить» на внешнюю ссылку. Собственно, на странице товара это сделать получилось, а нужно еще исправить в категории, на главной («Рекомендуем») и в поиске. Не пойму, почему не передается этот параметр для отображения в категории.
/catalog/controller/product/category.php (добавлено 'location' => $result['location'],)
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'location' => $result['location'],
'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,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);
/catalog/view/theme/default/template/product/category.twig (ссылка изменена на onclick="location.href = '{{ location }}'")
<button type="button" onclick="location.href = '{{ location }}'"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md">{{ button_cart }}</span></button>
По факту ничего не выводится:
Всем заранее спасибо за помощь!