mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
709bb4d8e4
@ -98,7 +98,7 @@ return [
|
||||
'title' => 'visiosoft.module.advs::section.filter',
|
||||
'fields' => [
|
||||
'hide_filter_section', 'hide_price_filter', 'hide_date_filter', 'hide_photo_filter', 'hide_map_filter',
|
||||
'hide_listing_header', 'user_filter_limit',
|
||||
'hide_listing_header', 'user_filter_limit','hide_out_of_stock_products_without_listing'
|
||||
],
|
||||
],
|
||||
'translations' => [
|
||||
|
||||
@ -479,5 +479,11 @@ return [
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
]
|
||||
],
|
||||
'hide_out_of_stock_products_without_listing' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
@ -286,5 +286,9 @@ return [
|
||||
'show_input_flag' => [
|
||||
'name' => 'Show Flags on Input',
|
||||
'instructions' => 'Show flag and description on translatable inputs'
|
||||
]
|
||||
],
|
||||
'hide_out_of_stock_products_without_listing' => [
|
||||
'name' => 'Hide out of stock products without listing',
|
||||
'instructions' => 'Hides out-of-stock GET products from listing and homepage'
|
||||
],
|
||||
];
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<td>
|
||||
<a href="{{ adv.detail_url }}">
|
||||
<img src="{{ img('visiosoft.theme.base::images/no-image.png').url }}" class="rounded lazy"
|
||||
alt="{{ adv.name }}" data-src="{{ adv.cover_photo }}">
|
||||
alt="{{ adv.name }}" data-src="{{ adv.thumbnail }}">
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-left pl-2">
|
||||
|
||||
@ -395,6 +395,15 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
$latest_advs = $this->model->currentAds()
|
||||
->limit(setting_value('visiosoft.module.advs::latest-limit'))
|
||||
->get();
|
||||
|
||||
if (setting_value('visiosoft.module.advs::hide_out_of_stock_products_without_listing')) {
|
||||
$latest_advs = $latest_advs->filter(
|
||||
function ($entry) {
|
||||
return (($entry->is_get_adv == true && $entry->stock > 0) || ($entry->is_get_adv == false));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return $this->model->getLocationNames($latest_advs);
|
||||
}
|
||||
|
||||
|
||||
@ -240,6 +240,14 @@ class AdvsController extends PublicController
|
||||
), 301);
|
||||
}
|
||||
|
||||
if (setting_value('visiosoft.module.advs::hide_out_of_stock_products_without_listing')) {
|
||||
$advs = $advs->filter(
|
||||
function ($entry) {
|
||||
return (($entry->is_get_adv == true && $entry->stock > 0) || ($entry->is_get_adv == false));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($advs as $index => $ad) {
|
||||
$advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
|
||||
$advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
|
||||
@ -1096,6 +1104,15 @@ class AdvsController extends PublicController
|
||||
$advModel = new AdvModel();
|
||||
|
||||
$advs = $repository->searchAdvs('map', $param, $customParameters);
|
||||
|
||||
if (setting_value('visiosoft.module.advs::hide_out_of_stock_products_without_listing')) {
|
||||
$advs = $advs->filter(
|
||||
function ($entry) {
|
||||
return (($entry->is_get_adv == true && $entry->stock > 0) || ($entry->is_get_adv == false));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($advs as $index => $ad) {
|
||||
$advs[$index]->seo_link = $advModel->getAdvDetailLinkByModel($ad, 'list');
|
||||
$advs[$index] = $advModel->AddAdsDefaultCoverImage($ad);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user