diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php
index 2d6d88a69..0c9081ea4 100644
--- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php
+++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php
@@ -60,7 +60,6 @@ return [
'hide_standard_price_field',
'hide_options_field',
'hide_village_field',
- 'hide_configurations',
'make_all_fields_required',
'make_map_required',
'show_breadcrumb_when_creating_ad',
diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php
index e3a092c52..3c1cf4ab6 100644
--- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php
+++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php
@@ -146,13 +146,6 @@ return [
'mode' => 'checkbox'
]
],
- 'hide_configurations' => [
- 'type' => 'anomaly.field_type.boolean',
- 'config' => [
- 'default_value' => false,
- 'mode' => 'checkbox'
- ]
- ],
'make_all_fields_required' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
diff --git a/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss b/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss
index f93008c30..139cbef8c 100644
--- a/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss
+++ b/addons/default/visiosoft/advs-module/resources/css/new-create-new.scss
@@ -133,7 +133,7 @@ label {
color: #4A4A4A;
font-weight: 600;
- input {
+ input, textarea {
box-shadow: 0 calc(1rem / 16) calc(2rem / 16) rgba(0, 0, 0, .04);
font-size: calc(17rem / 16);
padding: 1.1rem 1.5rem;
diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig
index a6bd38144..760e4c697 100644
--- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig
+++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig
@@ -79,7 +79,7 @@
{% if setting_value('visiosoft.module.advs::market_place') %}
- {{ addBlock('new-ad/fields', {'adv': adv})|raw }}
+ {{ addBlock('new-ad/fields', {'adv': adv, 'rawClassified': rawClassified})|raw }}
{% endif %}
diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php
index dc33073a6..81148d09f 100644
--- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php
+++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php
@@ -551,4 +551,23 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
->where('status', '=', 'approved')
->where('slug', '!=', '');
}
+
+ public function setConfig($key, $value)
+ {
+ $config = $this->config;
+ $config = $config ? (array) json_decode($config) : [];
+
+ $config[$key] = $value;
+
+ $this->config = json_encode($config);
+ $this->save();
+ }
+
+ public function getConfig($key)
+ {
+ $config = $this->config;
+ $config = $config ? (array) json_decode($config) : [];
+
+ return $config[$key] ?? null;
+ }
}
diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
index 9ca14836a..70abc6a69 100644
--- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
+++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
@@ -277,7 +277,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
->where('advs_advs.id', $id)
->leftJoin('users_users as u1', 'advs_advs.created_by_id', '=', 'u1.id')
->select('advs_advs.*', 'u1.first_name as first_name', 'u1.last_name as last_name', 'u1.id as owner_id')
- ->inRandomOrder()
->first();
if ($adv) {
diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php
index 8d7913146..4db2bd4f3 100644
--- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php
+++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php
@@ -99,4 +99,8 @@ interface AdvInterface extends EntryInterface
public function lastCategory();
public function scopeCurrent($query);
+
+ public function setConfig($key, $value);
+
+ public function getConfig($key);
}
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 526f83d9c..b8046c2ed 100644
--- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php
+++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php
@@ -769,7 +769,8 @@ class AdvsController extends PublicController
}
return $this->view->make('visiosoft.module.advs::new-ad/new-create', compact(
- 'request', 'formBuilder', 'cats_d', 'custom_fields'));
+ 'formBuilder', 'cats_d', 'custom_fields'
+ ));
}
public function store
@@ -840,6 +841,10 @@ class AdvsController extends PublicController
$adv->is_get_adv = ($this->request->is_get_adv and $get_categories_status) ? true : false;
$adv->save();
+ if ($adv->is_get_adv) {
+ $orderNote = \request('order_note') ?? '';
+ $adv->setConfig('order_note', trim($orderNote));
+ }
//Todo Create Event
if (is_module_installed('visiosoft.module.customfields')) {
@@ -956,6 +961,7 @@ class AdvsController extends PublicController
public function edit($id)
{
$adv = $this->adv_repository->find($id);
+ $rawClassified = $adv;
if (is_null($adv)) {
$this->messages->error(trans('visiosoft.module.advs::message.no_add_found'));
@@ -1011,7 +1017,10 @@ class AdvsController extends PublicController
return $this->view->make(
'visiosoft.module.advs::new-ad/new-create',
- compact('id', 'cats_d', 'cats', 'adv', 'custom_fields', 'options', 'hidePrice','is_options', 'configurations')
+ compact(
+ 'id', 'cats_d', 'cats', 'adv', 'custom_fields', 'options',
+ 'hidePrice','is_options', 'configurations', 'rawClassified'
+ )
);
}