diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php
index 02fcc351b..437c4ef36 100755
--- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php
@@ -83,7 +83,7 @@
-
+
@endforeach
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php
index 5b494956e..8c4a83752 100755
--- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php
@@ -108,7 +108,7 @@
-
+
@endforeach
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php
index da768aecb..d0d3b9e4c 100755
--- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php
@@ -52,7 +52,7 @@
-
+
@{{ errors.first('{!!$locale!!}[name]') }}
@@ -180,23 +180,23 @@
-
+
-
+
@{{ errors.first('{!!$locale!!}[slug]') }}
-
+
-
+
{!! view_render_event('bagisto.admin.catalog.category.edit_form_accordian.seo.controls.after', ['category' => $category]) !!}
@@ -220,7 +220,7 @@
-
+
@{{ errors.first('{!!$locale!!}[description]') }}
diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php
index 8d772a56c..b95c40dba 100755
--- a/packages/Webkul/Checkout/src/Cart.php
+++ b/packages/Webkul/Checkout/src/Cart.php
@@ -720,22 +720,22 @@ class Cart {
}
$taxRates = $taxCategory->tax_rates()->where([
- 'state' => $address->state,
'country' => $address->country,
])->orderBy('tax_rate', 'desc')->get();
- if (count( $taxRates) > 0) {
+ if ($taxRates->count()) {
foreach ($taxRates as $rate) {
$haveTaxRate = false;
+ if ($rate->state != '' && $rate->state != $address->state)
+ break;
+
if (! $rate->is_zip) {
- if ($rate->zip_code == '*' || $rate->zip_code == $address->postcode) {
+ if ($rate->zip_code == '*' || $rate->zip_code == $address->postcode)
$haveTaxRate = true;
- }
} else {
- if ($address->postcode >= $rate->zip_from && $address->postcode <= $rate->zip_to) {
+ if ($address->postcode >= $rate->zip_from && $address->postcode <= $rate->zip_to)
$haveTaxRate = true;
- }
}
if ($haveTaxRate) {
diff --git a/packages/Webkul/Product/src/Listeners/ProductFlat.php b/packages/Webkul/Product/src/Listeners/ProductFlat.php
index ecb8ffe9a..338ade5fd 100644
--- a/packages/Webkul/Product/src/Listeners/ProductFlat.php
+++ b/packages/Webkul/Product/src/Listeners/ProductFlat.php
@@ -230,7 +230,7 @@ class ProductFlat
}
}
- $productFlat->{$attribute->code} = $productAttributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]];
+ $productFlat->{$attribute->code} = $productAttributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]] ?? null;
if ($attribute->type == 'select') {
$attributeOption = $this->attributeOptionRepository->find($product->{$attribute->code});
diff --git a/packages/Webkul/Product/src/Models/Product.php b/packages/Webkul/Product/src/Models/Product.php
index dcf8f4673..ce9ab9d08 100755
--- a/packages/Webkul/Product/src/Models/Product.php
+++ b/packages/Webkul/Product/src/Models/Product.php
@@ -327,7 +327,7 @@ class Product extends Model implements ProductContract
}
}
- return $attributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]];
+ return $attributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]] ?? null;
}
/**
diff --git a/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php b/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php
index 0bc539456..e67ca4d39 100755
--- a/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php
+++ b/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php
@@ -77,7 +77,6 @@ class TaxRateController extends Controller
'zip_code' => 'sometimes|required_without:is_zip',
'zip_from' => 'nullable|required_with:is_zip',
'zip_to' => 'nullable|required_with:is_zip,zip_from',
- 'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric|min:0.0001'
]);
@@ -125,7 +124,6 @@ class TaxRateController extends Controller
'is_zip' => 'sometimes',
'zip_from' => 'nullable|required_with:is_zip',
'zip_to' => 'nullable|required_with:is_zip,zip_from',
- 'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric|min:0.0001'
]);