Merge pull request #1056 from openclassify/muammertop

need to items in cart for new oc-theme
This commit is contained in:
Dia Shalabi 2021-04-26 11:42:42 +02:00 committed by GitHub
commit 728ce68aba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 2 deletions

View File

@ -28,6 +28,7 @@ return [
'popular_ads_limit',
'ads_image_limit',
'default_view_type',
'show_price_to_members_only',
'price_area_hidden',
'hide_listing_standard_price',
'hide_zero_price',

View File

@ -443,4 +443,10 @@ return [
'default_value' => false,
]
],
'show_price_to_members_only' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
];

View File

@ -264,5 +264,8 @@ return [
],
'show_subcats_mobile' => [
'name' => 'Show subcategories on mobile view',
]
],
'show_price_to_members_only' => [
'name' => 'Show Price To Members Only',
],
];

View File

@ -1,5 +1,6 @@
<div class="slider-text">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row
{{ setting_value('visiosoft.module.advs::show_price_to_members_only') ? (not auth_check() ? 'd-none') }}">
{% set standardPrice = adv.standard_price.value %}
{% if standardPrice and standardPrice > 0 %}
<div class="d-flex flex-wrap align-items-center">

View File

@ -1108,6 +1108,16 @@ class AdvsController extends PublicController
$response['status'] = "success";
$count = $cart->getItems()->count;
$response['count'] = $count;
$response['item'] = [
'id' => $cart->getItems()->last->id,
'adv_id' => $cart->getItems()->last->entry_id,
'photo' => url($cart->getItems()->last->entry->cover_photo),
'url' => $thisModel->getAdvDetailLinkByAdId($adv->id),
'name' => $adv->name,
'quantity' => $cart->getItems()->last->quantity,
'price' => app(Currency::class)->format($cart->getItems()->last->price, $cart->getItems()->last->currency),
'subtotal' => app(Currency::class)->format($cart->subtotal, setting_value('streams::currency'))
];
} else {
$response['status'] = "error";
$response['msg'] = trans('visiosoft.module.advs::message.error_added_cart');