Skip to content

Commit

Permalink
Fixed issue with dates and trim product titles
Browse files Browse the repository at this point in the history
  • Loading branch information
bymayo committed Jul 10, 2019
1 parent bcb6a71 commit 79f8eff
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Commerce Widgets Changelog

## 2.0.16 - 2019-07-10
### Fixed
- Completed carts value on `CartAbandonment` widget not grouped by month and year, not just month
- The 'Today' value now matches the current day, not the first day of the week on `TotalRevenueOrders` widget

### Changed
- Product titles now trim if they are above 40 characters

## 2.0.15 - 2019-06-03
### Fixed
- Fixed step count issue by removing step value on `CartAbandonment` widget
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.15",
"version": "2.0.16",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/templates/widgets/ProductsRecent/body.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="label">
<span class="title">
<a href="{{ product.cpEditUrl }}">
{{ product.title }}
{{ product.title|length > 40 ? product.title|slice(0, 40) ~ '...' : product.title }}
</a>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/widgets/ProductsTop/body.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="label">
<span class="title">
<a href="{{ element.cpEditUrl }}">
{{ element.title }}
{{ element.title|length > 40 ? element.title|slice(0, 40) ~ '...' : element.title }}
</a>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/CartAbandonment.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function getCartTotalRevenue($isCompleted)
->where(
[
'orders.isCompleted' => $isCompleted,
'MONTH(orders.dateCreated)' => date('n')
'DATE_FORMAT(orders.dateCreated, "%c-%Y")' => date('n-Y')
]
);

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/TotalRevenueOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getTimeFrames()
return array(
array(
'label' => 'Today',
'date' => date('d M Y', strtotime('monday this week'))
'date' => date('d M Y')
),
array(
'label' => 'Week',
Expand Down

0 comments on commit 79f8eff

Please sign in to comment.