Merge branch 'master' into check-if-item-in-cart-is-deactivated
This commit is contained in:
commit
58269996b2
|
|
@ -23,5 +23,15 @@ return [
|
|||
'name' => 'Velocity',
|
||||
'parent' => 'default'
|
||||
],
|
||||
],
|
||||
|
||||
'admin-default' => 'default',
|
||||
|
||||
'admin-themes' => [
|
||||
'default' => [
|
||||
'views_path' => 'resources/admin-themes/default/views',
|
||||
'assets_path' => 'public/admin-themes/default/assets',
|
||||
'name' => 'Default'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\API\\AdminServiceProvider"
|
||||
"Webkul\\API\\Providers\\APIServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Admin\\AdminServiceProvider"
|
||||
"Webkul\\Admin\\Providers\\AdminServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ return [
|
|||
'value' => 'kgs',
|
||||
],
|
||||
],
|
||||
'channel_based' => true,
|
||||
'channel_based' => true
|
||||
],
|
||||
],
|
||||
], [
|
||||
|
|
@ -41,24 +41,28 @@ return [
|
|||
'type' => 'text',
|
||||
'validation' => 'required|max:50',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.from.name'),
|
||||
], [
|
||||
'name' => 'shop_email_from',
|
||||
'title' => 'admin::app.admin.system.shop-email-from',
|
||||
'type' => 'text',
|
||||
'validation' => 'required|email',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.from.address'),
|
||||
], [
|
||||
'name' => 'admin_name',
|
||||
'title' => 'admin::app.admin.system.admin-name',
|
||||
'type' => 'text',
|
||||
'validation' => 'required|max:50',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.admin.name'),
|
||||
], [
|
||||
'name' => 'admin_email',
|
||||
'title' => 'admin::app.admin.system.admin-email',
|
||||
'type' => 'text',
|
||||
'validation' => 'required|email',
|
||||
'channel_based' => true,
|
||||
'default_value' => config('mail.admin.address'),
|
||||
],
|
||||
],
|
||||
], [
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace Webkul\Admin\DataGrids;
|
|||
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Core\Models\Channel;
|
||||
|
||||
class ProductDataGrid extends DataGrid
|
||||
{
|
||||
|
|
@ -27,19 +28,30 @@ class ProductDataGrid extends DataGrid
|
|||
{
|
||||
parent::__construct();
|
||||
|
||||
/* locale */
|
||||
$this->locale = request()->get('locale') ?? 'all';
|
||||
|
||||
/* channel */
|
||||
$this->channel = request()->get('channel') ?? 'all';
|
||||
|
||||
/* finding channel name */
|
||||
if ($this->channel !== 'all') {
|
||||
$this->channel = Channel::find($this->channel);
|
||||
$this->channel = $this->channel ? $this->channel->code : 'all';
|
||||
}
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
/* query builder */
|
||||
$queryBuilder = DB::table('product_flat')
|
||||
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')
|
||||
->leftJoin('attribute_families', 'products.attribute_family_id', '=', 'attribute_families.id')
|
||||
->leftJoin('product_inventories', 'product_flat.product_id', '=', 'product_inventories.product_id')
|
||||
->select(
|
||||
'product_flat.product_id as product_id',
|
||||
'product_flat.locale',
|
||||
'product_flat.channel',
|
||||
'product_flat.product_id',
|
||||
'products.sku as product_sku',
|
||||
'product_flat.name as product_name',
|
||||
'products.type as product_type',
|
||||
|
|
@ -49,15 +61,9 @@ class ProductDataGrid extends DataGrid
|
|||
DB::raw('SUM(DISTINCT ' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')
|
||||
);
|
||||
|
||||
if ($this->locale !== 'all') {
|
||||
$queryBuilder->where('product_flat.locale', $this->locale);
|
||||
}
|
||||
|
||||
if ($this->channel !== 'all') {
|
||||
$queryBuilder->where('product_flat.channel', $this->channel);
|
||||
}
|
||||
|
||||
$queryBuilder->groupBy('product_flat.product_id');
|
||||
$queryBuilder->groupBy('product_flat.product_id', 'product_flat.locale', 'product_flat.channel');
|
||||
$queryBuilder->where('locale', $this->locale !== 'all' ? $this->locale : 'en');
|
||||
$queryBuilder->where('channel', $this->channel !== 'all' ? $this->channel : 'default');
|
||||
|
||||
$this->addFilter('product_id', 'product_flat.product_id');
|
||||
$this->addFilter('product_name', 'product_flat.name');
|
||||
|
|
|
|||
|
|
@ -23,17 +23,19 @@ class Order
|
|||
*/
|
||||
public function sendNewOrderMail($order)
|
||||
{
|
||||
$customerLocale = $this->getLocale($order);
|
||||
|
||||
try {
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-order';
|
||||
if (core()->getConfigData($configKey))
|
||||
Mail::queue(new NewOrderNotification($order));
|
||||
if (core()->getConfigData($configKey)) {
|
||||
$this->prepareMail($customerLocale, new NewOrderNotification($order));
|
||||
}
|
||||
|
||||
/* email to admin */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-admin';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
app()->setLocale(env('APP_LOCALE'));
|
||||
Mail::queue(new NewAdminNotification($order));
|
||||
$this->prepareMail(env('APP_LOCALE'), new NewAdminNotification($order));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -48,15 +50,17 @@ class Order
|
|||
*/
|
||||
public function sendNewInvoiceMail($invoice)
|
||||
{
|
||||
$customerLocale = $this->getLocale($invoice);
|
||||
|
||||
try {
|
||||
if ($invoice->email_sent) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-invoice';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewInvoiceNotification($invoice));
|
||||
$this->prepareMail($customerLocale, new NewInvoiceNotification($invoice));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -71,11 +75,13 @@ class Order
|
|||
*/
|
||||
public function sendNewRefundMail($refund)
|
||||
{
|
||||
try {
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-refund';
|
||||
$customerLocale = $this->getLocale($refund);
|
||||
|
||||
try {
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-refund';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewRefundNotification($refund));
|
||||
$this->prepareMail($customerLocale, new NewRefundNotification($refund));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -90,21 +96,23 @@ class Order
|
|||
*/
|
||||
public function sendNewShipmentMail($shipment)
|
||||
{
|
||||
$customerLocale = $this->getLocale($shipment);
|
||||
|
||||
try {
|
||||
if ($shipment->email_sent) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-shipment';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewShipmentNotification($shipment));
|
||||
$this->prepareMail($customerLocale, new NewShipmentNotification($shipment));
|
||||
}
|
||||
|
||||
/* email to admin */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-inventory-source';
|
||||
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewInventorySourceNotification($shipment));
|
||||
$this->prepareMail(env('APP_LOCALE'), new NewInventorySourceNotification($shipment));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -117,18 +125,19 @@ class Order
|
|||
*/
|
||||
public function sendCancelOrderMail($order)
|
||||
{
|
||||
$customerLocale = $this->getLocale($order);
|
||||
|
||||
try {
|
||||
/* email to customer */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.cancel-order';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new CancelOrderNotification($order));
|
||||
$this->prepareMail($customerLocale, new CancelOrderNotification($order));
|
||||
}
|
||||
|
||||
/* email to admin */
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-admin';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
app()->setLocale(env('APP_LOCALE'));
|
||||
Mail::queue(new CancelOrderAdminNotification($order));
|
||||
$this->prepareMail(env('APP_LOCALE'), new CancelOrderAdminNotification($order));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -141,14 +150,43 @@ class Order
|
|||
*/
|
||||
public function sendOrderCommentMail($comment)
|
||||
{
|
||||
$customerLocale = $this->getLocale($comment);
|
||||
|
||||
if (! $comment->customer_notified) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Mail::queue(new OrderCommentNotification($comment));
|
||||
/* email to customer */
|
||||
$this->prepareMail($customerLocale, new OrderCommentNotification($comment));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the locale of the customer if somehow item name changes then the english locale will pe provided.
|
||||
*
|
||||
* @param object \Webkul\Sales\Contracts\Order|\Webkul\Sales\Contracts\Invoice|\Webkul\Sales\Contracts\Refund|\Webkul\Sales\Contracts\Shipment|\Webkul\Sales\Contracts\OrderComment
|
||||
* @return string
|
||||
*/
|
||||
private function getLocale($object)
|
||||
{
|
||||
if ($object instanceof \Webkul\Sales\Contracts\OrderComment) {
|
||||
$object = $object->order;
|
||||
}
|
||||
|
||||
$objectFirstItem = $object->items->first();
|
||||
return isset($objectFirstItem->additional['locale']) ? $objectFirstItem->additional['locale'] : 'en';
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare Mail.
|
||||
* @return void
|
||||
*/
|
||||
private function prepareMail($locale, $notification)
|
||||
{
|
||||
app()->setLocale($locale);
|
||||
Mail::queue($notification);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
@if ($field['type'] == 'text')
|
||||
|
||||
<input type="text" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: core()->getConfigData($name) }}" data-vv-as=""{{ trans($field['title']) }}"">
|
||||
<input type="text" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: (core()->getConfigData($name) ? core()->getConfigData($name) : (isset($field['default_value']) ? $field['default_value'] : '')) }}" data-vv-as=""{{ trans($field['title']) }}"">
|
||||
|
||||
@elseif ($field['type'] == 'password')
|
||||
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
@elseif ($field['type'] == 'boolean')
|
||||
|
||||
<?php $selectedOption = core()->getConfigData($name) ?? ''; ?>
|
||||
|
||||
|
||||
<label class="switch">
|
||||
<input type="hidden" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="0" />
|
||||
<input type="checkbox" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="1" {{ $selectedOption ? 'checked' : '' }}>
|
||||
|
|
|
|||
|
|
@ -159,8 +159,6 @@ class AttributeController extends Controller
|
|||
$suppressFlash = true;
|
||||
|
||||
$this->attributeRepository->delete($value);
|
||||
} else {
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -174,7 +172,7 @@ class AttributeController extends Controller
|
|||
if ($suppressFlash) {
|
||||
session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success', ['resource' => 'attributes']));
|
||||
} else {
|
||||
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'attributes']));
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "bagisto/laravel-booking-product",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"bagisto/laravel-core": "dev-master",
|
||||
"bagisto/laravel-rule": "dev-master",
|
||||
"bagisto/laravel-sales": "dev-master",
|
||||
"bagisto/laravel-product": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\BookingProduct\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\BookingProduct\\Providers\\BookingProductServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "bagisto/laravel-cart-rule",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"bagisto/laravel-core": "dev-master",
|
||||
"bagisto/laravel-rule": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\CartRule\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\CartRule\\Providers\\CartRuleServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "bagisto/laravel-catalog-rule",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"bagisto/laravel-core": "dev-master",
|
||||
"bagisto/laravel-rule": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\CatalogRule\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\CatalogRule\\Providers\\CatalogRuleServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Checkout\\CheckoutServiceProvider"
|
||||
"Webkul\\Checkout\\Providers\\CheckoutServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -940,6 +940,8 @@ class Cart
|
|||
*/
|
||||
public function prepareDataForOrderItem($data): array
|
||||
{
|
||||
$locale = ['locale' => core()->getCurrentLocale()->code];
|
||||
|
||||
$finalData = [
|
||||
'product' => $this->productRepository->find($data['product_id']),
|
||||
'sku' => $data['sku'],
|
||||
|
|
@ -958,7 +960,7 @@ class Cart
|
|||
'discount_percent' => $data['discount_percent'],
|
||||
'discount_amount' => $data['discount_amount'],
|
||||
'base_discount_amount' => $data['base_discount_amount'],
|
||||
'additional' => $data['additional'],
|
||||
'additional' => is_array($data['additional']) ? array_merge($data['additional'], $locale) : $locale,
|
||||
];
|
||||
|
||||
if (isset($data['children']) && $data['children']) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Inventory\\InventoryServiceProvider"
|
||||
"Webkul\\Inventory\\Providers\\InventoryServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "bagisto/laravel-paypal",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\Payment\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Paypal\\Providers\\PaypalServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -555,8 +555,10 @@ abstract class AbstractType
|
|||
if ($haveSpecialPrice) {
|
||||
$this->product->special_price = min($this->product->special_price, $customerGroupPrice);
|
||||
} else {
|
||||
$haveSpecialPrice = true;
|
||||
$this->product->special_price = $customerGroupPrice;
|
||||
if ($customerGroupPrice !== $this->product->price) {
|
||||
$haveSpecialPrice = true;
|
||||
$this->product->special_price = $customerGroupPrice;
|
||||
}
|
||||
}
|
||||
|
||||
return $haveSpecialPrice;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "bagisto/laravel-rule",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\Rule\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Rule\\Providers\\RuleServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ class InvoiceRepository extends Repository
|
|||
return $invoice;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* @param \Webkul\Sales\Contracts\Invoice $invoice
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
; DO NOT EDIT (unless you know what you are doing)
|
||||
;
|
||||
; This subdirectory is a git "subrepo", and this file is maintained by the
|
||||
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
|
||||
;
|
||||
[subrepo]
|
||||
remote = git@github.com:bagistobrasil/core-shop.git
|
||||
branch = master
|
||||
commit =
|
||||
method = merge
|
||||
cmdver = 0.4.1
|
||||
|
|
@ -25,13 +25,13 @@
|
|||
$comparableAttributes = $comparableAttributes->toArray();
|
||||
|
||||
array_splice($comparableAttributes, 1, 0, [[
|
||||
'code' => 'image',
|
||||
'admin_name' => 'Product Image'
|
||||
'admin_name' => 'Product Image',
|
||||
'type' => 'product_image'
|
||||
]]);
|
||||
|
||||
array_splice($comparableAttributes, 2, 0, [[
|
||||
'code' => 'addToCartHtml',
|
||||
'admin_name' => 'Actions'
|
||||
'admin_name' => 'Actions',
|
||||
'type' => 'action'
|
||||
]]);
|
||||
@endphp
|
||||
|
||||
|
|
@ -42,70 +42,67 @@
|
|||
</td>
|
||||
|
||||
<td :key="`title-${index}`" v-for="(product, index) in products">
|
||||
@switch ($attribute['code'])
|
||||
@case('name')
|
||||
@switch ($attribute['type'])
|
||||
@case('text')
|
||||
<a :href="`${baseUrl}/${product.url_key}`" class="unset remove-decoration active-hover">
|
||||
<h3 class="fw6 fs18" v-text="product['{{ $attribute['code'] }}']"></h3>
|
||||
</a>
|
||||
@break;
|
||||
|
||||
@case('textarea')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']"></span>
|
||||
@break;
|
||||
|
||||
@case('price')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']"></span>
|
||||
@break;
|
||||
|
||||
@case('boolean')
|
||||
<span
|
||||
v-text="product.product['{{ $attribute['code'] }}']
|
||||
? '{{ __('velocity::app.shop.general.yes') }}'
|
||||
: '{{ __('velocity::app.shop.general.no') }}'"
|
||||
></span>
|
||||
@break;
|
||||
|
||||
@case('select')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']" class="fs16"></span>
|
||||
@break;
|
||||
|
||||
@case('multiselect')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']" class="fs16"></span>
|
||||
@break
|
||||
|
||||
@case('file')
|
||||
<a v-if="product.product['{{ $attribute['code'] }}']" :href="`${baseUrl}/storage/${product.product['{{ $attribute['code'] }}']}`">
|
||||
<span v-text="product.product['{{ $attribute['code'] }}'].substr(product.product['{{ $attribute['code'] }}'].lastIndexOf('/') + 1)" class="fs16"></span>
|
||||
<i class='icon sort-down-icon download'></i>
|
||||
</a>
|
||||
<span v-else class="fs16">__</span>
|
||||
@break;
|
||||
|
||||
@case('image')
|
||||
<img v-if="product.product['{{ $attribute['code'] }}']" :src="`${baseUrl}/storage/${product.product['{{ $attribute['code'] }}']}`">
|
||||
@break;
|
||||
|
||||
@case('product_image')
|
||||
<a :href="`${baseUrl}/${product.url_key}`" class="unset">
|
||||
<img
|
||||
class="image-wrapper"
|
||||
:src="product['{{ $attribute['code'] }}']"
|
||||
:src="product['product_image']"
|
||||
:onerror="`this.src='${baseUrl}/vendor/webkul/ui/assets/images/product/large-product-placeholder.png'`" />
|
||||
</a>
|
||||
@break
|
||||
@break
|
||||
|
||||
@case('price')
|
||||
<span v-html="product['priceHTML']"></span>
|
||||
@break
|
||||
|
||||
@case('addToCartHtml')
|
||||
@case('action')
|
||||
<div class="action">
|
||||
<div v-html="product.defaultAddToCart"></div>
|
||||
|
||||
<span class="icon white-cross-sm-icon remove-product" @click="removeProductCompare(product.id)"></span>
|
||||
</div>
|
||||
@break
|
||||
@break;
|
||||
|
||||
@case('color')
|
||||
<span v-html="product.color_label" class="fs16"></span>
|
||||
@break
|
||||
|
||||
@case('size')
|
||||
<span v-html="product.size_label" class="fs16"></span>
|
||||
@break
|
||||
|
||||
@case('description')
|
||||
<span v-html="product.description"></span>
|
||||
@break
|
||||
|
||||
@default
|
||||
@switch ($attribute['type'])
|
||||
@case('boolean')
|
||||
<span
|
||||
v-text="product.product['{{ $attribute['code'] }}']
|
||||
? '{{ __('velocity::app.shop.general.yes') }}'
|
||||
: '{{ __('velocity::app.shop.general.no') }}'"
|
||||
></span>
|
||||
@break;
|
||||
@case('file')
|
||||
<a v-if="product.product['{{ $attribute['code'] }}']" :href="`${baseUrl}/storage/${product.product['{{ $attribute['code'] }}']}`">
|
||||
<span v-text="product.product['{{ $attribute['code'] }}'].substr(product.product['{{ $attribute['code'] }}'].lastIndexOf('/') + 1)" class="fs16"></span>
|
||||
<i class='icon sort-down-icon download'></i>
|
||||
</a>
|
||||
<a v-else class="fs16">__</span>
|
||||
@break;
|
||||
@default
|
||||
<span v-html="product['{{ $attribute['code'] }}'] ? product['{{ $attribute['code'] }}'] : product.product['{{ $attribute['code'] }}'] ? product.product['{{ $attribute['code'] }}'] : '__'" class="fs16"></span>
|
||||
@break;
|
||||
@endswitch
|
||||
|
||||
@break
|
||||
|
||||
@endswitch
|
||||
@endswitch
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "bagisto/laravel-social-login",
|
||||
"description": "Shipping Package for Shipping Method",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "rahulshukla-webkul",
|
||||
"email": "rahulshukla.symfony517@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\SocialLogin\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\SocialLogin\\Providers\\SocialLoginServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Theme\\ThemeServiceProvider"
|
||||
"Webkul\\Theme\\Providers\\ThemeServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace Webkul\Theme;
|
|||
|
||||
use Webkul\Theme\Facades\Themes;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\View\FileViewFinder;
|
||||
|
||||
class ThemeViewFinder extends FileViewFinder
|
||||
|
|
@ -19,7 +20,7 @@ class ThemeViewFinder extends FileViewFinder
|
|||
// Extract the $view and the $namespace parts
|
||||
list($namespace, $view) = $this->parseNamespaceSegments($name);
|
||||
|
||||
if ($namespace != 'admin') {
|
||||
if (! Str::contains(request()->route()->uri, 'admin/')) {
|
||||
$paths = $this->addThemeNamespacePaths($namespace);
|
||||
|
||||
try {
|
||||
|
|
@ -34,7 +35,23 @@ class ThemeViewFinder extends FileViewFinder
|
|||
return $this->findInPaths($view, $paths);
|
||||
}
|
||||
} else {
|
||||
return $this->findInPaths($view, $this->hints[$namespace]);
|
||||
$themes = app('themes');
|
||||
|
||||
$themes->set(config('themes.admin-default'));
|
||||
|
||||
$paths = $this->addThemeNamespacePaths($namespace);
|
||||
|
||||
try {
|
||||
return $this->findInPaths($view, $paths);
|
||||
} catch(\Exception $e) {
|
||||
if ($namespace != 'admin') {
|
||||
if (strpos($view, 'admin.') !== false) {
|
||||
$view = str_replace('admin.', 'admin.' . Themes::current()->code . '.', $view);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->findInPaths($view, $paths);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -84,19 +101,6 @@ class ThemeViewFinder extends FileViewFinder
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string contents of the view.
|
||||
*
|
||||
* @param callable|null $callback
|
||||
* @return array|string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function render(callable $callback = null)
|
||||
{
|
||||
dd(111);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the array of paths where the views are being searched.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Webkul\Theme;
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Str;
|
||||
use Webkul\Theme\Theme;
|
||||
|
||||
class Themes
|
||||
|
|
@ -42,9 +43,15 @@ class Themes
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->laravelViewsPath = Config::get('view.paths');
|
||||
$routeURI = request()->route()->uri;
|
||||
|
||||
$this->defaultThemeCode = Config::get('themes.default', null);
|
||||
if (Str::contains(request()->route()->uri, 'admin/')) {
|
||||
$this->defaultThemeCode = Config::get('themes.admin-default', null);
|
||||
} else {
|
||||
$this->defaultThemeCode = Config::get('themes.default', null);
|
||||
}
|
||||
|
||||
$this->laravelViewsPath = Config::get('view.paths');
|
||||
|
||||
$this->loadThemes();
|
||||
}
|
||||
|
|
@ -85,7 +92,11 @@ class Themes
|
|||
{
|
||||
$parentThemes = [];
|
||||
|
||||
$themes = config('themes.themes', []);
|
||||
if (Str::contains(request()->route()->uri, 'admin/')) {
|
||||
$themes = config('themes.admin-themes', []);
|
||||
} else {
|
||||
$themes = config('themes.themes', []);
|
||||
}
|
||||
|
||||
foreach ($themes as $code => $data) {
|
||||
$this->themes[] = new Theme(
|
||||
|
|
@ -140,6 +151,7 @@ class Themes
|
|||
Config::set('view.paths', $paths);
|
||||
|
||||
$themeViewFinder = app('view.finder');
|
||||
|
||||
$themeViewFinder->setPaths($paths);
|
||||
|
||||
return $theme;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"/js/velocity.js": "/js/velocity.js?id=25493b80bfd55a858726",
|
||||
"/js/velocity.js": "/js/velocity.js?id=1cccc6e984773916257d",
|
||||
"/css/velocity-admin.css": "/css/velocity-admin.css?id=612d35e452446366eef7",
|
||||
"/css/velocity.css": "/css/velocity.css?id=21237e38e6fdd0b9cd2b"
|
||||
"/css/velocity.css": "/css/velocity.css?id=72cf9eb7824c25e1dad8"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ class Helper extends Review
|
|||
|
||||
$productMetaDetails = [];
|
||||
$productMetaDetails['slug'] = $product->url_key;
|
||||
$productMetaDetails['image'] = $formattedProduct['image'];
|
||||
$productMetaDetails['product_image'] = $formattedProduct['image'];
|
||||
$productMetaDetails['priceHTML'] = $formattedProduct['priceHTML'];
|
||||
$productMetaDetails['new'] = $formattedProduct['new'];
|
||||
$productMetaDetails['addToCartHtml'] = $formattedProduct['addToCartHtml'];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="col-12 lg-card-container list-card product-card row" v-if="list">
|
||||
<div class="product-image" style="margin: auto;">
|
||||
<div class="product-image">
|
||||
<a :title="product.name" :href="`${baseUrl}/${product.slug}`">
|
||||
<img
|
||||
:src="product.image"
|
||||
|
|
|
|||
|
|
@ -1686,6 +1686,7 @@
|
|||
|
||||
&.new {
|
||||
background-color: $theme-color;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -480,7 +480,6 @@
|
|||
|
||||
> div {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
{{ __('velocity::app.responsive.header.greeting', ['customer' => auth()->guard('customer')->user()->first_name]) }}
|
||||
</a>
|
||||
@endauth
|
||||
|
||||
|
||||
<i
|
||||
@click="closeDrawer()"
|
||||
class="material-icons pull-right text-dark">
|
||||
|
|
@ -175,6 +175,16 @@
|
|||
</a>
|
||||
@endguest
|
||||
</li>
|
||||
|
||||
<li>
|
||||
@guest('customer')
|
||||
<a
|
||||
class="unset"
|
||||
href="{{ route('customer.register.index') }}">
|
||||
<span>{{ __('shop::app.header.sign-up') }}</span>
|
||||
</a>
|
||||
@endguest
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -493,7 +503,7 @@
|
|||
|
||||
toggleMetaInfo: function (metaKey) {
|
||||
this.rootCategories = ! this.rootCategories;
|
||||
|
||||
|
||||
this[metaKey] = !this[metaKey];
|
||||
},
|
||||
|
||||
|
|
@ -532,7 +542,7 @@
|
|||
console.log(this.__('error.something_went_wrong'));
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
formatCategories: function (categories) {
|
||||
let slicedCategories = categories;
|
||||
let categoryCount = this.categoryCount ? this.categoryCount : 9;
|
||||
|
|
|
|||
|
|
@ -84,17 +84,16 @@
|
|||
@endpush
|
||||
|
||||
@if ($addresses->isEmpty())
|
||||
<style>
|
||||
<style>
|
||||
a#add-address-button {
|
||||
position: absolute;
|
||||
margin-top: 92px;
|
||||
}
|
||||
|
||||
a#add-address-button {
|
||||
position: absolute;
|
||||
margin-top: 92px;
|
||||
}
|
||||
|
||||
.address-button {
|
||||
position: absolute;
|
||||
margin-top: 92px;
|
||||
}
|
||||
|
||||
</style>
|
||||
.address-button {
|
||||
position: absolute;
|
||||
z-index: 1 !important;
|
||||
margin-top: 110px !important;
|
||||
}
|
||||
</style>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@
|
|||
$comparableAttributes = $comparableAttributes->toArray();
|
||||
|
||||
array_splice($comparableAttributes, 1, 0, [[
|
||||
'code' => 'image',
|
||||
'admin_name' => __('velocity::app.customer.compare.product_image')
|
||||
'admin_name' => 'Product Image',
|
||||
'type' => 'product_image'
|
||||
]]);
|
||||
|
||||
array_splice($comparableAttributes, 2, 0, [[
|
||||
'code' => 'addToCartHtml',
|
||||
'admin_name' => __('velocity::app.customer.compare.actions')
|
||||
'admin_name' => 'Actions',
|
||||
'type' => 'action'
|
||||
]]);
|
||||
@endphp
|
||||
|
||||
|
|
@ -56,76 +56,67 @@
|
|||
</td>
|
||||
|
||||
<td :key="`title-${index}`" v-for="(product, index) in products">
|
||||
@switch ($attribute['code'])
|
||||
@case('name')
|
||||
<a :href="`${$root.baseUrl}/${product.url_key}`" class="unset remove-decoration active-hover">
|
||||
<h1 class="fw6 fs18" v-text="product['{{ $attribute['code'] }}']"></h1>
|
||||
@switch ($attribute['type'])
|
||||
@case('text')
|
||||
<a :href="`${baseUrl}/${product.url_key}`" class="unset remove-decoration active-hover">
|
||||
<h3 class="fw6 fs18" v-text="product['{{ $attribute['code'] }}']"></h3>
|
||||
</a>
|
||||
@break;
|
||||
|
||||
@case('textarea')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']"></span>
|
||||
@break;
|
||||
|
||||
@case('price')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']"></span>
|
||||
@break;
|
||||
|
||||
@case('boolean')
|
||||
<span
|
||||
v-text="product.product['{{ $attribute['code'] }}']
|
||||
? '{{ __('velocity::app.shop.general.yes') }}'
|
||||
: '{{ __('velocity::app.shop.general.no') }}'"
|
||||
></span>
|
||||
@break;
|
||||
|
||||
@case('select')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']" class="fs16"></span>
|
||||
@break;
|
||||
|
||||
@case('multiselect')
|
||||
<span v-html="product.product['{{ $attribute['code'] }}']" class="fs16"></span>
|
||||
@break
|
||||
|
||||
@case('file')
|
||||
<a v-if="product.product['{{ $attribute['code'] }}']" :href="`${baseUrl}/storage/${product.product['{{ $attribute['code'] }}']}`">
|
||||
<span v-text="product.product['{{ $attribute['code'] }}'].substr(product.product['{{ $attribute['code'] }}'].lastIndexOf('/') + 1)" class="fs16"></span>
|
||||
<i class='icon sort-down-icon download'></i>
|
||||
</a>
|
||||
<span v-else class="fs16">__</span>
|
||||
@break;
|
||||
|
||||
@case('image')
|
||||
<a :href="`${$root.baseUrl}/${product.url_key}`" class="unset">
|
||||
<img v-if="product.product['{{ $attribute['code'] }}']" :src="`${baseUrl}/storage/${product.product['{{ $attribute['code'] }}']}`">
|
||||
@break;
|
||||
|
||||
@case('product_image')
|
||||
<a :href="`${baseUrl}/${product.url_key}`" class="unset">
|
||||
<img
|
||||
class="image-wrapper"
|
||||
:src="product['{{ $attribute['code'] }}']"
|
||||
onload="window.updateHeight ? window.updateHeight() : ''"
|
||||
:onerror="`this.src='${$root.baseUrl}/vendor/webkul/ui/assets/images/product/large-product-placeholder.png'`" />
|
||||
:src="product['product_image']"
|
||||
:onerror="`this.src='${baseUrl}/vendor/webkul/ui/assets/images/product/large-product-placeholder.png'`" />
|
||||
</a>
|
||||
@break
|
||||
@break
|
||||
|
||||
@case('price')
|
||||
<span v-html="product['priceHTML']"></span>
|
||||
@break
|
||||
|
||||
@case('addToCartHtml')
|
||||
@case('action')
|
||||
<div class="action">
|
||||
<vnode-injector :nodes="getDynamicHTML(product.addToCartHtml)"></vnode-injector>
|
||||
<div v-html="product.defaultAddToCart"></div>
|
||||
|
||||
<i
|
||||
class="material-icons cross fs16"
|
||||
@click="removeProductCompare(product.id)">
|
||||
|
||||
close
|
||||
</i>
|
||||
<span class="icon white-cross-sm-icon remove-product" @click="removeProductCompare(product.id)"></span>
|
||||
</div>
|
||||
@break
|
||||
@break;
|
||||
|
||||
@case('color')
|
||||
<span v-html="product.color_label" class="fs16"></span>
|
||||
@break
|
||||
|
||||
@case('size')
|
||||
<span v-html="product.size_label" class="fs16"></span>
|
||||
@break
|
||||
|
||||
@case('description')
|
||||
<span v-html="product.description"></span>
|
||||
@break
|
||||
|
||||
@default
|
||||
@switch ($attribute['type'])
|
||||
@case('boolean')
|
||||
<span
|
||||
v-text="product.product['{{ $attribute['code'] }}']
|
||||
? '{{ __('velocity::app.shop.general.yes') }}'
|
||||
: '{{ __('velocity::app.shop.general.no') }}'"
|
||||
></span>
|
||||
@break;
|
||||
@case('file')
|
||||
<a v-if="product.product['{{ $attribute['code'] }}']" :href="`${$root.baseUrl}/storage/${product.product['{{ $attribute['code'] }}']}`">
|
||||
<span v-text="product.product['{{ $attribute['code'] }}'].substr(product.product['{{ $attribute['code'] }}'].lastIndexOf('/') + 1)" class="fs16"></span>
|
||||
<i class='material-icons'>arrow_downward</i>
|
||||
</a>
|
||||
<a v-else class="fs16">__</span>
|
||||
@break;
|
||||
@default
|
||||
<span v-html="product['{{ $attribute['code'] }}'] ? product['{{ $attribute['code'] }}'] : product.product['{{ $attribute['code'] }}'] ? product.product['{{ $attribute['code'] }}'] : '__'" class="fs16"></span>
|
||||
@break;
|
||||
@endswitch
|
||||
|
||||
@break
|
||||
|
||||
@endswitch
|
||||
@endswitch
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
@ -218,6 +209,7 @@
|
|||
if (productId == "all") {
|
||||
updatedItems = [];
|
||||
this.$set(this, 'products', []);
|
||||
|
||||
window.showAlert(
|
||||
`alert-success`,
|
||||
this.__('shop.general.alert.success'),
|
||||
|
|
@ -226,6 +218,7 @@
|
|||
} else {
|
||||
updatedItems = existingItems.filter(item => item != productId);
|
||||
this.$set(this, 'products', this.products.filter(product => product.id != productId));
|
||||
|
||||
window.showAlert(
|
||||
`alert-success`,
|
||||
this.__('shop.general.alert.success'),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
navigation-enabled="hide"
|
||||
pagination-enabled="hide"
|
||||
id="upsell-products-carousel"
|
||||
:slides-count="{{ sizeof($products) }}">
|
||||
:slides-count="{{ $product->cross_sells()->count() }}">
|
||||
|
||||
@foreach($products as $product)
|
||||
@foreach ($product->cross_sells()->paginate(2) as $index => $crossSellProduct)
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<div class="carousel-products vc-small-screen">
|
||||
<carousel-component
|
||||
:slides-count="{{ sizeof($products) }}"
|
||||
:slides-count="{{ $product->cross_sells()->count() }}"
|
||||
slides-per-page="2"
|
||||
id="upsell-products-carousel"
|
||||
navigation-enabled="hide"
|
||||
|
|
|
|||
Loading…
Reference in New Issue