Merge branch 'master' of https://github.com/openclassify/openclassify into muammertop

This commit is contained in:
Muammer Top 2021-08-16 09:48:25 +03:00
commit d883ae5993
7 changed files with 43 additions and 8 deletions

View File

@ -16,6 +16,7 @@
</p>
{% endif %}
</div>
<div class="preview-actions text-center">
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %}
{% set continueLink = url_route('visiosoft.module.packages::add_package', [adv.id]) %}
@ -24,6 +25,13 @@
{% else %}
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
{% endif %}
{% if isActive('shipping') %}
<a href="{{ url_route('visiosoft.module.shipping::create_shipping',{'id':adv.id}) }}"
class="btn btn-outline-primary shadow-sm mr-4">
<i class="fa fa-truck"></i>
{{ trans('visiosoft.module.shipping::button.create_shipping_information') }}
</a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }}
@ -37,6 +45,13 @@
<div class="preview-overlay position-absolute"></div>
</div>
<div class="preview-actions text-center">
{% if isActive('shipping') %}
<a href="{{ url_route('visiosoft.module.shipping::create_shipping',{'id':adv.id}) }}"
class="btn btn-outline-primary shadow-sm mr-4">
{{ trans('visiosoft.module.shipping::button.create_shipping_information') }}
</a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }}

View File

@ -6,6 +6,7 @@ use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Visiosoft\AdvsModule\Adv\Contract\AdvInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel;
@ -514,4 +515,16 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{
return $this->created_by_id == \auth()->id() || \auth()->user()->isAdmin();
}
public function getCatsIDs()
{
$attr = $this->getAttributes();
return array_filter(
$attr,
function ($key) use ($attr) {
return Str::startsWith($key, 'cat') && $attr[$key];
},
ARRAY_FILTER_USE_KEY
);
}
}

View File

@ -11,12 +11,13 @@ class AdvsImport implements ToModel, WithHeadingRow
{
public function model(array $row)
{
$row['name'] = $row['name'] ?? $row['title'];
if ($row['name'] !== null && $row['price'] !== null && $row['currency'] !== null) {
return new AdvModel([
'name' => $row['name'],
'slug' => Str::slug($row['name']),
'advs_desc' => $row['description'] ?? null,
'standard_price' => $row['standard_price'] ?? null,
'standard_price' => $row['standard_price'] ?? 0,
'price' => $row['price'],
'currency' => $row['currency'],
'country' => $row['country'] ?? null,

View File

@ -93,4 +93,6 @@ interface AdvInterface extends EntryInterface
public function changeStatus($status);
public function canEdit();
public function getCatsIDs();
}

View File

@ -16,9 +16,11 @@ class AddTotalSales
public function handle(CreatedOrderDetail $event)
{
$item = $event->getOrderItem();
$adv = $this->advModel->find($event->getOrderItem()->item_id);
$total = $adv->total_sales + $item->piece;
$adv->total_sales = $total;
$adv->save();
if ($item->item_type === 'adv') {
$adv = $this->advModel->find($event->getOrderItem()->item_id);
$total = $adv->total_sales + $item->piece;
$adv->total_sales = $total;
$adv->save();
}
}
}
}

View File

@ -1,6 +1,8 @@
{% extends "theme::layouts/default" %}
{% block styles %}
<link rel="canonical" href="{{ url() }}"/>
{{ asset_style('visiosoft.theme.base::css/login.css') }}
{% endblock %}
@ -103,4 +105,4 @@
</div>
</div>
{{ asset_add('scripts.js','visiosoft.theme.base::js/login.js') }}
{% endblock %}
{% endblock %}

View File

@ -240,7 +240,7 @@
a {
background-color: unset;
border: 0;
color: #DC3545;
color: #DC3545 !important;
font-family: 'Poppins', sans-serif;
font-weight: 500;
display: inline-flex;