mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
commit
709bb4d8e4
@ -98,7 +98,7 @@ return [
|
|||||||
'title' => 'visiosoft.module.advs::section.filter',
|
'title' => 'visiosoft.module.advs::section.filter',
|
||||||
'fields' => [
|
'fields' => [
|
||||||
'hide_filter_section', 'hide_price_filter', 'hide_date_filter', 'hide_photo_filter', 'hide_map_filter',
|
'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' => [
|
'translations' => [
|
||||||
|
|||||||
@ -479,5 +479,11 @@ return [
|
|||||||
'config' => [
|
'config' => [
|
||||||
'default_value' => false,
|
'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' => [
|
'show_input_flag' => [
|
||||||
'name' => 'Show Flags on Input',
|
'name' => 'Show Flags on Input',
|
||||||
'instructions' => 'Show flag and description on translatable inputs'
|
'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>
|
<td>
|
||||||
<a href="{{ adv.detail_url }}">
|
<a href="{{ adv.detail_url }}">
|
||||||
<img src="{{ img('visiosoft.theme.base::images/no-image.png').url }}" class="rounded lazy"
|
<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>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-left pl-2">
|
<td class="text-left pl-2">
|
||||||
|
|||||||
@ -395,6 +395,15 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
$latest_advs = $this->model->currentAds()
|
$latest_advs = $this->model->currentAds()
|
||||||
->limit(setting_value('visiosoft.module.advs::latest-limit'))
|
->limit(setting_value('visiosoft.module.advs::latest-limit'))
|
||||||
->get();
|
->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);
|
return $this->model->getLocationNames($latest_advs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -240,6 +240,14 @@ class AdvsController extends PublicController
|
|||||||
), 301);
|
), 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) {
|
foreach ($advs as $index => $ad) {
|
||||||
$advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
|
$advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
|
||||||
$advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
|
$advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
|
||||||
@ -1096,6 +1104,15 @@ class AdvsController extends PublicController
|
|||||||
$advModel = new AdvModel();
|
$advModel = new AdvModel();
|
||||||
|
|
||||||
$advs = $repository->searchAdvs('map', $param, $customParameters);
|
$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) {
|
foreach ($advs as $index => $ad) {
|
||||||
$advs[$index]->seo_link = $advModel->getAdvDetailLinkByModel($ad, 'list');
|
$advs[$index]->seo_link = $advModel->getAdvDetailLinkByModel($ad, 'list');
|
||||||
$advs[$index] = $advModel->AddAdsDefaultCoverImage($ad);
|
$advs[$index] = $advModel->AddAdsDefaultCoverImage($ad);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user