Merge branch 'master' of https://github.com/bagisto/bagisto into development
This commit is contained in:
commit
4ecfaac44d
|
|
@ -61,6 +61,7 @@ class GenerateProducts extends Command
|
|||
try {
|
||||
$result = $this->generateProduct->create();
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class CustomerController extends Controller
|
|||
try {
|
||||
Mail::queue(new NewCustomerNotification($customer, $password));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Customer']));
|
||||
|
|
|
|||
|
|
@ -10,13 +10,15 @@ use Webkul\Admin\Mail\NewShipmentNotification;
|
|||
use Webkul\Admin\Mail\NewInventorySourceNotification;
|
||||
use Webkul\Admin\Mail\CancelOrderNotification;
|
||||
use Webkul\Admin\Mail\NewRefundNotification;
|
||||
|
||||
/**
|
||||
* Order event handler
|
||||
*
|
||||
* @author Jitendra Singh <jitendra@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class Order {
|
||||
class Order
|
||||
{
|
||||
|
||||
/**
|
||||
* @param mixed $order
|
||||
|
|
@ -30,7 +32,7 @@ class Order {
|
|||
|
||||
Mail::queue(new NewAdminNotification($order));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,12 +44,13 @@ class Order {
|
|||
public function sendNewInvoiceMail($invoice)
|
||||
{
|
||||
try {
|
||||
if ($invoice->email_sent)
|
||||
if ($invoice->email_sent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Mail::queue(new NewInvoiceNotification($invoice));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +64,7 @@ class Order {
|
|||
try {
|
||||
Mail::queue(new NewRefundNotification($refund));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,25 +76,28 @@ class Order {
|
|||
public function sendNewShipmentMail($shipment)
|
||||
{
|
||||
try {
|
||||
if ($shipment->email_sent)
|
||||
if ($shipment->email_sent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Mail::queue(new NewShipmentNotification($shipment));
|
||||
|
||||
Mail::queue(new NewInventorySourceNotification($shipment));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* @param mixed $order
|
||||
* */
|
||||
public function sendCancelOrderMail($order){
|
||||
try{
|
||||
*
|
||||
*/
|
||||
public function sendCancelOrderMail($order)
|
||||
{
|
||||
try {
|
||||
Mail::queue(new CancelOrderNotification($order));
|
||||
}catch (\Exception $e){
|
||||
\Log::error('Error occured when sending email '.$e->getMessage());
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.catalog.categories.name') }}</label>
|
||||
<input type="text" v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as=""{{ __('admin::app.catalog.categories.name') }}""/>
|
||||
<input type="text" v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as=""{{ __('admin::app.catalog.categories.name') }}"" v-slugify-target="'slug'"/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('{{$locale}}[name]') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.catalog.categories.name') }}</label>
|
||||
<input type="text" v-validate="'required'" class="control" id="name" name="{{$locale}}[name]" value="{{ old($locale)['name'] ?? $category->translate($locale)['name'] }}" data-vv-as=""{{ __('admin::app.catalog.categories.name') }}""/>
|
||||
<input type="text" v-validate="'required'" class="control" id="name" name="{{$locale}}[name]" value="{{ old($locale)['name'] ?? $category->translate($locale)['name'] }}" data-vv-as=""{{ __('admin::app.catalog.categories.name') }}"" v-slugify-target="'slug'"/>
|
||||
<span class="control-error" v-if="errors.has('{{$locale}}[name]')">@{{ errors.first('{!!$locale!!}[name]') }}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" data-vv-as=""{{ $attribute->admin_name }}"" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }}/>
|
||||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }} data-vv-as=""{{ $attribute->admin_name }}"" {{ $attribute->code == 'name' ? 'v-slugify-target=\'url_key\'' : '' }} />
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@
|
|||
<div class="control-group" :class="[errors.has('direction') ? 'has-error' : '']">
|
||||
<label for="direction" class="required">{{ __('admin::app.settings.locales.direction') }}</label>
|
||||
<select v-validate="'required'" class="control" id="direction" name="direction" data-vv-as=""{{ __('admin::app.settings.locales.direction') }}"">
|
||||
<option value="ltr" selected title="Text direction left to right">ltr</option>
|
||||
<option value="rtl" title="Text direction right to left">rtl</option>
|
||||
<option value="ltr" selected title="Text direction left to right">LTR</option>
|
||||
<option value="rtl" title="Text direction right to left">RTL</option>
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('direction')">@{{ errors.first('direction') }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@
|
|||
<div class="control-group" :class="[errors.has('direction') ? 'has-error' : '']">
|
||||
<label for="direction" class="required">{{ __('admin::app.settings.locales.direction') }}</label>
|
||||
<select v-validate="'required'" class="control" id="direction" name="direction" data-vv-as=""{{ __('admin::app.settings.locales.direction') }}"">
|
||||
<option value="ltr" {{ old('direction') == 'ltr' ? 'selected' : '' }} title="Text direction left to right">ltr</option>
|
||||
<option value="rtl" {{ old('direction') == 'rtl' ? 'selected' : '' }} title="Text direction right to left">rtl</option>
|
||||
<option value="ltr" {{ (old('direction') ?: $locale->direction) == 'ltr' ? 'selected' : '' }}>LTR</option>
|
||||
<option value="rtl" {{ (old('direction') ?: $locale->direction) == 'rtl' ? 'selected' : '' }}>RTL</option>
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('direction')">@{{ errors.first('direction') }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ class AttributeController extends Controller
|
|||
$this->attributeRepository->delete($value);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
$suppressFlash = true;
|
||||
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,8 @@ class AttributeFamilyController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
session()->flash('error', trans( 'admin::app.response.delete-failed', ['name' => 'Family']));
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Family']));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -177,16 +178,18 @@ class AttributeFamilyController extends Controller
|
|||
try {
|
||||
$this->attributeFamilyRepository->delete($value);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
$suppressFlash = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $suppressFlash)
|
||||
if (!$suppressFlash) {
|
||||
session()->flash('success', ('admin::app.datagrid.mass-ops.delete-success'));
|
||||
else
|
||||
} else {
|
||||
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Attribute Family']));
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class CatalogRuleIndex
|
|||
|
||||
$this->catalogRuleProductPriceHelper->indexRuleProductPrice(1000);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ class CatalogRuleIndex
|
|||
try {
|
||||
if (! $product->getTypeInstance()->priceRuleCanBeApplied())
|
||||
return;
|
||||
|
||||
|
||||
$productIds = $product->getTypeInstance()->isComposite()
|
||||
? $product->getTypeInstance()->getChildrenIds()
|
||||
: [$product->id];
|
||||
|
|
@ -93,7 +93,7 @@ class CatalogRuleIndex
|
|||
|
||||
$this->catalogRuleProductPriceHelper->indexRuleProductPrice(1000, $product);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ class CurrencyController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Currency']));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ class ExchangeRateController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-error', ['name' => 'Exchange rate']));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ class SubscriptionController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Subscriber']));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ class ForgotPasswordController extends Controller
|
|||
['email' => trans($response)]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans($e->getMessage()));
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -114,18 +114,19 @@ class RegistrationController extends Controller
|
|||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
try {
|
||||
Mail::queue(new RegistrationEmail(request()->all()));
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify')); //customer registered successfully
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
|
||||
}
|
||||
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success'));
|
||||
}
|
||||
|
||||
|
|
@ -177,6 +178,7 @@ class RegistrationController extends Controller
|
|||
\Cookie::queue(\Cookie::forget('email-for-resend'));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('shop::app.customer.signup-form.verification-not-sent'));
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ class WishlistController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('warning', $e->getMessage());
|
||||
|
||||
return redirect()->route('shop.productOrCategory.index', $wishlistItem->product->url_key);
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ class InventorySourceController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Inventory source']));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ return [
|
|||
'cashondelivery' => [
|
||||
'code' => 'cashondelivery',
|
||||
'title' => 'Cash On Delivery',
|
||||
'description' => 'shop::app.checkout.onepage.cash-desc',
|
||||
'description' => 'Cash On Delivery',
|
||||
'class' => 'Webkul\Payment\Payment\CashOnDelivery',
|
||||
'active' => true,
|
||||
'sort' => 1
|
||||
|
|
@ -12,7 +12,7 @@ return [
|
|||
'moneytransfer' => [
|
||||
'code' => 'moneytransfer',
|
||||
'title' => 'Money Transfer',
|
||||
'description' => 'shop::app.checkout.onepage.money-desc',
|
||||
'description' => 'Money Transfer',
|
||||
'class' => 'Webkul\Payment\Payment\MoneyTransfer',
|
||||
'active' => true,
|
||||
'sort' => 2
|
||||
|
|
@ -21,7 +21,7 @@ return [
|
|||
'paypal_standard' => [
|
||||
'code' => 'paypal_standard',
|
||||
'title' => 'Paypal Standard',
|
||||
'description' => 'shop::app.checkout.onepage.paypal-desc',
|
||||
'description' => 'Paypal Standard',
|
||||
'class' => 'Webkul\Paypal\Payment\Standard',
|
||||
'sandbox' => true,
|
||||
'active' => true,
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ class ProductController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Product']));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ class ReviewController extends Controller
|
|||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('success', trans('admin::app.response.delete-failed', ['name' => 'Review']));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@ class ProductForm extends FormRequest
|
|||
'sku' => ['required', 'unique:products,sku,' . $this->id, new \Webkul\Core\Contracts\Validations\Slug],
|
||||
'images.*' => 'mimes:jpeg,jpg,bmp,png',
|
||||
'special_price_from' => 'nullable|date',
|
||||
'special_price_to' => 'nullable|date|after_or_equal:special_price_from'
|
||||
'special_price_to' => 'nullable|date|after_or_equal:special_price_from',
|
||||
'special_price' => ['nullable', new \Webkul\Core\Contracts\Validations\Decimal, 'lt:price']
|
||||
]);
|
||||
|
||||
foreach ($product->getEditableAttributes() as $attribute) {
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ class CartController extends Controller
|
|||
'message' => trans('shop::app.checkout.total.invalid-coupon')
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => trans('shop::app.checkout.total.coupon-apply-issue')
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class SubscriptionController extends Controller
|
|||
|
||||
session()->flash('success', trans('shop::app.subscription.subscribed'));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('error', trans('shop::app.subscription.not-subscribed'));
|
||||
|
||||
$mailSent = false;
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ class TaxRateController extends Controller
|
|||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
$failure = new Failure(1, 'rows', [0 => trans('admin::app.export.enough-row-error')]);
|
||||
|
||||
session()->flash('error', $failure->errors()[0]);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@
|
|||
"jquery": "^3.4.1",
|
||||
"laravel-mix": "^5.0.0",
|
||||
"laravel-mix-merge-manifest": "^0.1.2",
|
||||
"vue": "^2.6.10"
|
||||
"sass": "^1.24.4",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue": "^2.6.10",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "^7.7.0",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=ed9978ac7d054203f0bc",
|
||||
"/js/ui.js": "/js/ui.js?id=d6802d7d61cdbdfc21e5",
|
||||
"/css/ui.css": "/css/ui.css?id=0895b560bbc19259cee8"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import ImageUpload from './components/image/image-upload';
|
|||
import ImageWrapper from './components/image/image-wrapper';
|
||||
import ImageItem from './components/image/image-item';
|
||||
import Slugify from './directives/slugify';
|
||||
import SlugifyTarget from './directives/slugify-target';
|
||||
import Code from './directives/code';
|
||||
import Alert from './directives/alert';
|
||||
import DatetimeComponent from './components/datetime';
|
||||
|
|
@ -35,6 +36,7 @@ Vue.component('image-upload', ImageUpload);
|
|||
Vue.component('image-wrapper', ImageWrapper);
|
||||
Vue.component('image-item', ImageItem);
|
||||
Vue.directive('slugify', Slugify);
|
||||
Vue.directive('slugify-target', SlugifyTarget);
|
||||
Vue.directive('code', Code);
|
||||
Vue.directive('alert', Alert);
|
||||
Vue.component('datetime', DatetimeComponent);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
export default {
|
||||
bind(el, binding, vnode) {
|
||||
let handler = function (e) {
|
||||
setTimeout(function () {
|
||||
var target = document.getElementById(binding.value);
|
||||
|
||||
target.value = e.target.value.toString()
|
||||
.toLowerCase()
|
||||
.replace(/[^\w- ]+/g, '')
|
||||
|
||||
// replace whitespaces with dashes
|
||||
.replace(/ +/g, '-')
|
||||
|
||||
// avoid having multiple dashes (---- translates into -)
|
||||
.replace('![-\s]+!u', '-')
|
||||
.trim();
|
||||
}, 100);
|
||||
};
|
||||
|
||||
el.addEventListener('input', handler);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue