Skip to content

Commit

Permalink
Change product / variant images to crop using mode fit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tam committed Jul 18, 2019
1 parent cdfd7eb commit dee9aaf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## [Unreleased] 1.1.4
## 1.1.4 - 2019-07-18
### Added
- Add section showing all synced products

### Changed
- Product / variant images crop using mode fit

## 1.1.3 - 2019-07-11
### Fixed
- Fix product sync error when some products are soft deleted (Fixes #3 again)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ether/mailchimp-commerce",
"description": "Mailchimp integration with Craft Commerce",
"version": "1.1.3",
"version": "1.1.4",
"type": "craft-plugin",
"keywords": [
"mailchimp",
Expand Down
7 changes: 5 additions & 2 deletions src/services/ProductsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ public function getSyncedFromMailchimp ($offset = 0)
{
Craft::error($error, 'mailchimp-commerce');
Craft::$app->getSession()->setError('An error occurred, please check the log');
return [];
return [
'items' => [],
'total' => 0,
];
}

return [
Expand Down Expand Up @@ -430,7 +433,7 @@ private function _getImages (Element $element)
$transform = Craft::$app->getAssetTransforms()->getTransformByUid($transform);

if (!$transform)
$transform = ['width' => 1000];
$transform = ['width' => 1000, 'mode' => 'fit'];

return array_map(function (Asset $asset) use ($isVariant, $element, $transform) {
return [
Expand Down

0 comments on commit dee9aaf

Please sign in to comment.