Skip to content

Commit

Permalink
Added a default limit on TopCustomers widget
Browse files Browse the repository at this point in the history
  • Loading branch information
bymayo committed Aug 9, 2019
1 parent b008364 commit 29e5c52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Commerce Widgets Changelog

## 2.0.18 - 2019-08-09

### Fixed
- Added a default limit on `TopCustomers` widget to fix issue where it pulls all customers in if the widget already existed on the dashboard

## 2.0.17 - 2019-08-09

{warning} This plugin now requires Craft CMS 3.2.x or higher due to the way it now deals with trashed orders. It's also recommended to now use a `commerce-widgets.php` config file for the plugin settings since this version doesn't include the ability to modify settings via the CP.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bymayo/commerce-widgets",
"description": "Insightful dashboard widgets for your Craft Commerce 2 store.",
"type": "craft-plugin",
"version": "2.0.17",
"version": "2.0.18",
"keywords": [
"craft",
"cms",
Expand Down
6 changes: 4 additions & 2 deletions src/widgets/TopCustomers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TopCustomers extends Widget
public $includeGuests;
public $orderBy;
public $groupBy; // Remove
public $limit = 5;
public $limit;

// Static Methods
// =========================================================================
Expand Down Expand Up @@ -106,8 +106,10 @@ public function rules()
$rules,
[
[['includeGuests', 'orderBy'], 'string'],
[['limit'], 'integer'],
['includeGuests', 'default', 'value' => 'yes'],
['orderBy', 'default', 'value' => 'totalRevenue']
['orderBy', 'default', 'value' => 'totalRevenue'],
['limit', 'default', 'value' => 5]
]
);

Expand Down

0 comments on commit 29e5c52

Please sign in to comment.