Як завжди, просто швидко…
Товары с нулевым количеством (нет на складе) всегда в конце.
Products with a quantity of zero (out of stock) are always placed at the end.
Міняємо зміст файла /components/com_jshopping/templates/твій_шаблон/list_products/list_products.php
Сhange the content of the file /components/com_jshopping/templates/your_template/list_products/list_products.php
На це:/To this:
<?php
/**
* @version 5.0.0 15.09.2018
* @author MAXXmarketing GmbH
* @package Jshopping
* @copyright Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
* @license GNU/GPL
*/
defined('_JEXEC') or die();
?>
<div class="jshop list_product" id="comjshop_list_product">
<?php print $this->_tmp_list_products_html_start?>
<div class="row-fluid row">
<?php
$available_products = [];
$not_available_products = [];
foreach ($this->rows as $k=>$product) {
if ($product->product_quantity == 0.00) {
$not_available_products[] = $product;
} else {
$available_products[] = $product;
}
}
$products = array_merge($available_products, $not_available_products);
foreach ($products as $k=>$product) : ?>
<div class="d-flex py-3 col-12 col-sm-6 col-md-6 col-lg-4 row-fluid <?php echo $this->count_product_to_row;?> <?php echo ($product->product_quantity == 0.00) ? 'prodnot_available' : 'prod_available'; ?>">
<div class="block_product w-100 p-3 border rounded shadow-sm">
<?php include(dirname(__FILE__)."/".$product->template_block_product);?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php print $this->_tmp_list_products_html_end;?>
</div>