Проверка ссылки товара и редирект на норм ссылку (ТЕСТОВАЯ ВЕРСИЯ)
foreach($this->document->_links as $key=>$value){
$url_redirect = $key;
break;
}
if($url_redirect!=JRequest::getURI()){
$current_host="http://".JFactory::getUri()->getHost();
$url_redirect=$current_host.$url_redirect;
JApplication::redirect($url_redirect,'','' ,true);
}
Вывод доп полей на странице списка товаров
if (!empty($product->customfields)) {
foreach ($product->customfields as $k => $custom) {
if (!empty($custom->layout_pos)) {
$product->customfieldsSorted[$custom->layout_pos][] = $custom;
unset($product->customfields[$k]);
}
}
$product->customfieldsSorted['ontop'] = $product->customfields;
unset($product->customfields);
}
foreach($product->customfieldsSorted['ontop'] as $v){
if(!empty($v->display)){
echo 'Field_name:'.$v->n;
echo '
Value:'.$v->display.'
';
}
}
Поменять сортировку
components/com_virtuemart/views/category/view.html.php
if($categoryId == 10){
$productModel->filter_order = 'ordering';
// $productModel->filter_order_Dir = 'DESC';
}
$products = $productModel->getProductsInCategory($categoryId);
Свежие комментарии