mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
bb11499435
@ -219,14 +219,16 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="product-options">
|
||||
<label for="productOptions">
|
||||
{{ trans('visiosoft.module.advs::field.product_option.name') }}
|
||||
</label>
|
||||
<div class="mt-3 form-group mb-0">
|
||||
{{ form.fields.product_options_value.configSet('cat1', adv.cat1).input|raw }}
|
||||
{% if is_options %}
|
||||
<div class="product-options">
|
||||
<label for="productOptions">
|
||||
{{ trans('visiosoft.module.advs::field.product_option.name') }}
|
||||
</label>
|
||||
<div class="mt-3 form-group mb-0">
|
||||
{{ form.fields.product_options_value.configSet('cat1', adv.cat1).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv\Command;
|
||||
|
||||
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
|
||||
|
||||
class IsOptionsByCategory
|
||||
{
|
||||
|
||||
protected $cat_id;
|
||||
|
||||
public function __construct($cat_id)
|
||||
{
|
||||
$this->cat_id = $cat_id;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$option_repository = app(ProductoptionRepositoryInterface::class);
|
||||
$value_repository = app(ProductoptionsValueRepositoryInterface::class);
|
||||
|
||||
$options_id = $option_repository->getWithCategoryId($this->cat_id)->pluck('id')->all();
|
||||
|
||||
return count($value_repository->getWithOptionsId($options_id));
|
||||
}
|
||||
}
|
||||
@ -10,6 +10,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Cookie;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Visiosoft\AdvsModule\Adv\Command\IsOptionsByCategory;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\Adv\Event\ChangedStatusAd;
|
||||
use Visiosoft\AdvsModule\Adv\Event\CreatedAd;
|
||||
@ -21,6 +22,8 @@ use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder;
|
||||
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel;
|
||||
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
|
||||
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
|
||||
use Visiosoft\LocationModule\City\CityModel;
|
||||
use Visiosoft\LocationModule\City\CityRepository;
|
||||
@ -992,9 +995,14 @@ class AdvsController extends PublicController
|
||||
$hidePrice = in_array($adv['cat1'], $hidePriceCats);
|
||||
}
|
||||
|
||||
/* Check Options
|
||||
* Added to query if there are product options.
|
||||
*/
|
||||
$is_options = dispatch_now(new IsOptionsByCategory($adv['cat1']));
|
||||
|
||||
return $this->view->make(
|
||||
'visiosoft.module.advs::new-ad/new-create',
|
||||
compact('id', 'cats_d', 'cats', 'adv', 'custom_fields', 'options', 'hidePrice')
|
||||
compact('id', 'cats_d', 'cats', 'adv', 'custom_fields', 'options', 'hidePrice','is_options')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user