diff --git a/classes/customer/DefaultSignUpHandler.php b/classes/customer/DefaultSignUpHandler.php index cd01dcc62..f7d3a96be 100644 --- a/classes/customer/DefaultSignUpHandler.php +++ b/classes/customer/DefaultSignUpHandler.php @@ -185,13 +185,13 @@ protected function signUp(array $data) */ protected function validate(array $data) { - $rules = self::rules(); + $rules = static::rules(); if ($this->asGuest) { unset($rules['password'], $rules['password_repeat']); } - $messages = self::messages(); + $messages = static::messages(); $validation = Validator::make($data, $rules, $messages); diff --git a/components/Cart.php b/components/Cart.php index 5912af353..9a3230f95 100644 --- a/components/Cart.php +++ b/components/Cart.php @@ -183,7 +183,7 @@ public function setData() /** * The user updated the quantity of a specific cart item. * - * @return void + * @return array */ public function onUpdateQuantity() { @@ -193,7 +193,7 @@ public function onUpdateQuantity() $product = $this->getProductFromCart($cart, $id); if (!$product) { - return; + return []; } try { @@ -201,9 +201,16 @@ public function onUpdateQuantity() } catch (OutOfStockException $exc) { Flash::error(trans('offline.mall::lang.common.out_of_stock', ['quantity' => $exc->product->stock])); - return; + return []; } finally { $this->setData(); + + return [ + 'item' => $this->dataLayerArray($product->product, $product->variant), + 'quantity' => optional($product)->quantity ?? 0, + 'new_items_count' => optional($this->cart->products)->count() ?? 0, + 'new_items_quantity' => optional($this->cart->products)->sum('quantity') ?? 0, + ]; } } diff --git a/components/ProductsFilter.php b/components/ProductsFilter.php index d70ba1ded..bc299f3ea 100644 --- a/components/ProductsFilter.php +++ b/components/ProductsFilter.php @@ -439,6 +439,7 @@ protected function setPriceRange() protected function setBrands() { $brands = DB::table('offline_mall_products') + ->where('offline_mall_products.published', '=', true) ->whereIn('offline_mall_category_product.category_id', $this->categories->pluck('id')) ->select('offline_mall_brands.*') ->distinct() diff --git a/models/PaymentMethod.php b/models/PaymentMethod.php index 1f54a01e1..9a9d62afc 100644 --- a/models/PaymentMethod.php +++ b/models/PaymentMethod.php @@ -71,6 +71,7 @@ class PaymentMethod extends Model public $translatable = [ 'name', 'description', + 'instructions', ]; /** diff --git a/updates/version.yaml b/updates/version.yaml index 783cef705..fd0309345 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -623,3 +623,5 @@ v3.5.10: - 'Fixed attaching/detaching of property groups to categories' v3.5.11: - 'Various small bugfixes' +v3.5.12: + - 'Various small additions (thanks to @RickAcb and @rubenvanerk)'