diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig index 4348ceced..ab26ee08f 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig @@ -35,14 +35,16 @@ {{ addBlock('ad-detail/seller/action',{'seller_id':adv.owner_id})|raw }} -
- - {{ trans('visiosoft.module.advs::field.ad_id') }}:{{ adv.id }} -
-
- - {{ adv.created_at|date('d/m/Y') }} -
+ {% if setting_value('visiosoft.module.advs::market_place') %} +
+ + {{ trans('visiosoft.module.advs::field.ad_id') }}:{{ adv.id }} +
+
+ + {{ adv.created_at|date('d/m/Y') }} +
+ {% endif %} {{ addBlock('ad-detail/details',{'adv':adv, 'options':options, 'configurations':configurations})|raw }} diff --git a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig index 6d2661063..b40d8f829 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig @@ -25,7 +25,6 @@
-

#{{ adv.id }}

{{ adv.name }}
@@ -36,9 +35,11 @@

{% endif %} {% if showLocation %} -

{{ adv.country_name}} / {{ adv.city_name }}

+

{{ adv.country_name }} / {{ adv.city_name }}

+ {% endif %} + {% if setting_value('visiosoft.module.advs::market_place') %} +

{{ adv.publish_at.value|date('d/m/Y') }}

{% endif %} -

{{ adv.publish_at.value|date('d F Y') }}

diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig index f2b170a79..019a7fa2d 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig @@ -4,66 +4,70 @@
- - - {% if listLocation %} - - {% endif %} + + + {% if listLocation %} + + {% endif %} + {% if setting_value('visiosoft.module.advs::market_place') %} - - + {% endif %} + + - {{ addBlock('ad-list/partials/ads', {'featured_advs': featured_advs, 'vars': _context})|raw }} + {{ addBlock('ad-list/partials/ads', {'featured_advs': featured_advs, 'vars': _context})|raw }} - {% for adv in advs %} - - + + + {% if listLocation %} + - - {% if listLocation %} - - {% endif %} + {% endif %} + {% if setting_value('visiosoft.module.advs::market_place') %} - - - {% endfor %} + {% endif %} +

+ {{ adv.price != '0' ? currency_format(adv.price,adv.currency) : trans('visiosoft.module.advs::field.free') }} +

+ + + {% endfor %}
{{ trans('visiosoft.module.advs::field.ad_title') }} - {{ trans('visiosoft.module.advs::field.city.name') }} / {{ trans('visiosoft.module.advs::field.district.name') }} -
{{ trans('visiosoft.module.advs::field.ad_title') }} + {{ trans('visiosoft.module.advs::field.city.name') }} + / {{ trans('visiosoft.module.advs::field.district.name') }} + {{ trans('visiosoft.module.advs::field.listing_date') }}{{ trans('visiosoft.module.advs::field.price.name') }}
{{ trans('visiosoft.module.advs::field.price.name') }}
- - {{ adv.name }} - + {% for adv in advs %} +
+ + {{ adv.name }} + + +
+ {{ adv.name }} +
+

{{ adv.cat1_name }} /{{ adv.cat2_name }}

+
+ + {{ addBlock('list/extra-actions', {'ad': adv, 'vars': _context})|raw }} + +
+
+

{{ adv.country_name }}

+

{{ adv.city_name }}

-

#{{ adv.id }}

-
- {{ adv.name }} -
-

{{ adv.cat1_name }} /{{ adv.cat2_name }}

-
- - {{ addBlock('list/extra-actions', {'ad': adv, 'vars': _context})|raw }} - -
-
-

{{ adv.country_name }}

-

{{ adv.city_name }}

-
-

{{ adv.publish_at.value|date('d F') }}

+

{{ adv.publish_at.value|date('d/m') }}

{{ adv.publish_at.value|date('Y') }}

- {% if not hideStandard %} -

- - {{ adv.standard_price != adv.price and adv.standard_price != '0' ? currency_format(adv.standard_price,adv.currency) : '' }} - -

- {% endif %} + {% endif %} +
+ {% if not hideStandard %}

- {{ adv.price != '0' ? currency_format(adv.price,adv.currency) : trans('visiosoft.module.advs::field.free') }} + + {{ adv.standard_price != adv.price and adv.standard_price != '0' ? currency_format(adv.standard_price,adv.currency) : '' }} +

-
diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php index e443c4b7f..f0cb05b3f 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php @@ -258,11 +258,11 @@ class AdvsController extends PublicController $advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list'); $advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad); - $foreign_currencies = json_decode($advs[$index]->foreign_currencies, true); - if (isset($_COOKIE['currency']) && $advs[$index]->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) { - $advs[$index]->currency = $_COOKIE['currency']; - $advs[$index]->price = $foreign_currencies[$_COOKIE['currency']]; - } + $foreign_currencies = json_decode($advs[$index]->foreign_currencies, true); + if (isset($_COOKIE['currency']) && $advs[$index]->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) { + $advs[$index]->currency = $_COOKIE['currency']; + $advs[$index]->price = $foreign_currencies[$_COOKIE['currency']]; + } } $seenList = array(); @@ -280,15 +280,8 @@ class AdvsController extends PublicController if ($category) { - $mainCats = $this->category_repository->getParentCategoryById($category->id); - $subCats = $this->category_repository->getCategoryById($category->id); - - //if there is no subcategory - if (count($subCats) < 1 and count($mainCats) > 1) { - //fetch subcategories of the last category - $subCats = $this->category_repository->getCategoryById($mainCats[1]['id']); - unset($mainCats[0]);//remove last category - } + $mainCats = $this->category_repository->getParentCategoryByOrder($category->id); + $subCats = $category->getSubCategories(); $allCats = false; } else { $mainCats = $this->category_repository->getMainCategories(); @@ -586,11 +579,11 @@ class AdvsController extends PublicController $configurations = $this->optionConfigurationRepository->getConf($adv->id); - $foreign_currencies = json_decode($adv->foreign_currencies, true); - if (isset($_COOKIE['currency']) && $_COOKIE['currency'] && $adv->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) { - $adv->currency = $_COOKIE['currency']; - $adv->price = $foreign_currencies[$_COOKIE['currency']]; - } + $foreign_currencies = json_decode($adv->foreign_currencies, true); + if (isset($_COOKIE['currency']) && $_COOKIE['currency'] && $adv->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) { + $adv->currency = $_COOKIE['currency']; + $adv->price = $foreign_currencies[$_COOKIE['currency']]; + } // Check if hide price $hidePrice = false; @@ -1034,7 +1027,7 @@ class AdvsController extends PublicController } $adv->update($params); - $this->event->dispatch(new EditedAdCategory($before_editing_ad_params,$adv)); + $this->event->dispatch(new EditedAdCategory($before_editing_ad_params, $adv)); $this->messages->success(trans('visiosoft.module.advs::message.updated_category_msg')); return redirect('/advs/edit_advs/' . $id); } @@ -1106,6 +1099,7 @@ class AdvsController extends PublicController } return $response; } + public function stockControl(Request $request, AdvRepositoryInterface $advRepository) { $quantity = $request->quantity; diff --git a/addons/default/visiosoft/cats-module/resources/views/ads-list/partials/cat-filter.twig b/addons/default/visiosoft/cats-module/resources/views/ads-list/partials/cat-filter.twig index 88b2d9ad7..6a18a9285 100644 --- a/addons/default/visiosoft/cats-module/resources/views/ads-list/partials/cat-filter.twig +++ b/addons/default/visiosoft/cats-module/resources/views/ads-list/partials/cat-filter.twig @@ -4,7 +4,7 @@
  • - {% if (not categoryId) or (loop.first and categoryId) %} + {% if (not category) or (loop.first and category) %} {% set categoryIcon = (maincat.icon.value) ? maincat.icon.value : img('visiosoft.module.advs::images/listing/sample-cat-icon.svg').url %} {{ main_category.name }} {% endif %} diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php b/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php index 2ca855067..69fbd4f8c 100644 --- a/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php @@ -102,12 +102,16 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn $parents_count++; } } - return $parents; } return null; } + public function getParentCategoryByOrder($id) + { + return array_reverse($this->getParentCategoryById($id)); + } + public function getLevelById($id) { $parents = $this->getParentCategoryById($id); diff --git a/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryRepositoryInterface.php b/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryRepositoryInterface.php index a7852f6fb..750acb5ef 100644 --- a/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryRepositoryInterface.php +++ b/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryRepositoryInterface.php @@ -16,6 +16,8 @@ interface CategoryRepositoryInterface extends EntryRepositoryInterface public function getParentCategoryById($id); + public function getParentCategoryByOrder($id); + public function getLevelById($id); public function getDeletedCategories(); diff --git a/addons/default/visiosoft/singlefile-field_type/src/Table/ValueTableBuilder.php b/addons/default/visiosoft/singlefile-field_type/src/Table/ValueTableBuilder.php index 39c49ba39..f868dd2f1 100644 --- a/addons/default/visiosoft/singlefile-field_type/src/Table/ValueTableBuilder.php +++ b/addons/default/visiosoft/singlefile-field_type/src/Table/ValueTableBuilder.php @@ -64,7 +64,7 @@ class ValueTableBuilder extends TableBuilder 'show_headers' => false, 'sortable_headers' => false, 'table_view' => 'anomaly.field_type.file::table', - 'no_results_message' => 'visiosoft.field_type.singlefile::message.no_file_selected', + 'no_results_message' => null, ]; /**