Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-kuendig committed Nov 28, 2024
2 parents 947ccd4 + 7ee89c9 commit ff299f4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions classes/customer/DefaultSignUpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
13 changes: 10 additions & 3 deletions components/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function setData()
/**
* The user updated the quantity of a specific cart item.
*
* @return void
* @return array
*/
public function onUpdateQuantity()
{
Expand All @@ -193,17 +193,24 @@ public function onUpdateQuantity()
$product = $this->getProductFromCart($cart, $id);

if (!$product) {
return;
return [];
}

try {
$cart->setQuantity($product->id, (int)input('quantity'));
} 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,
];
}
}

Expand Down
1 change: 1 addition & 0 deletions components/ProductsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions models/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class PaymentMethod extends Model
public $translatable = [
'name',
'description',
'instructions',
];

/**
Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'

0 comments on commit ff299f4

Please sign in to comment.