Skip to content

Commit

Permalink
Merge pull request #7 from Oksydan/develop
Browse files Browse the repository at this point in the history
New version 1.0.1
  • Loading branch information
Oksydan authored Sep 11, 2023
2 parents b9367b7 + d89fa11 commit 3d8e8ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
12 changes: 6 additions & 6 deletions controllers/front/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private function checkProductExistence(): bool
$exists = $this->getFavoriteProductService()->productExists($idProduct, $idProductAttribute, $this->context->shop->id);

if (!$exists) {
$this->errors[] = $this->module->getTranslator()->trans('Product does not exist in store', [], 'Modules.IsFavoriteProducts.Front');
$this->errors[] = $this->module->getTranslator()->trans('Product does not exist in store', [], 'Modules.Isfavoriteproducts.Front');
}

return $exists;
Expand All @@ -39,7 +39,7 @@ private function checkLimit(): bool
if ($reached) {
$this->errors[] = $this->module->getTranslator()->trans('You have reached limit of %number% products in your favorite list. Login or create an account to add more products.', [
'%number%' => $this->getFavoriteProductService()->getFavoriteLimit(),
], 'Modules.IsFavoriteProducts.Front');
], 'Modules.Isfavoriteproducts.Front');
}

return $reached;
Expand Down Expand Up @@ -72,7 +72,7 @@ public function displayAjaxAddFavoriteProduct(): void
$favoriteProduct = $this->createFavoriteProductDto();

if (empty($this->errors) && $this->getFavoriteProductService()->isProductAlreadyInFavorites($favoriteProduct)) {
$this->errors[] = $this->module->getTranslator()->trans('Product already exists in your favorite list', [], 'Modules.IsFavoriteProducts.Front');
$this->errors[] = $this->module->getTranslator()->trans('Product already exists in your favorite list', [], 'Modules.Isfavoriteproducts.Front');
}

if (empty($this->errors)) {
Expand All @@ -84,7 +84,7 @@ public function displayAjaxAddFavoriteProduct(): void
}

if (empty($this->errors)) {
$this->message[] = $this->module->getTranslator()->trans('Product added to your favorite list', [], 'Modules.IsFavoriteProducts.Front');
$this->message[] = $this->module->getTranslator()->trans('Product added to your favorite list', [], 'Modules.Isfavoriteproducts.Front');
}

$this->renderResponse();
Expand All @@ -97,7 +97,7 @@ public function displayAjaxRemoveFavoriteProduct(): void
$favoriteProduct = $this->createFavoriteProductDto();

if (empty($this->errors) && !$this->getFavoriteProductService()->isProductAlreadyInFavorites($favoriteProduct)) {
$this->errors[] = $this->module->getTranslator()->trans('Product don\'t exists in your favorite list', [], 'Modules.IsFavoriteProducts.Front');
$this->errors[] = $this->module->getTranslator()->trans('Product don\'t exists in your favorite list', [], 'Modules.Isfavoriteproducts.Front');
}

if (empty($this->errors)) {
Expand All @@ -109,7 +109,7 @@ public function displayAjaxRemoveFavoriteProduct(): void
}

if (empty($this->errors)) {
$this->message[] = $this->module->getTranslator()->trans('Product removed from your favorite list', [], 'Modules.IsFavoriteProducts.Front');
$this->message[] = $this->module->getTranslator()->trans('Product removed from your favorite list', [], 'Modules.Isfavoriteproducts.Front');
}

$this->renderResponse();
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/favorite.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct()

public function getListingLabel()
{
return $this->module->getTranslator()->trans('Favorite products', [], 'Modules.IsFavoriteProducts.Front');
return $this->module->getTranslator()->trans('Favorite products', [], 'Modules.Isfavoriteproducts.Front');
}

public function initContent()
Expand Down
13 changes: 9 additions & 4 deletions is_favoriteproducts.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,22 @@ public function __construct()
$this->name = 'is_favoriteproducts';

$this->author = 'Igor Stępień';
$this->version = '1.0.0';
$this->version = '1.0.1';
$this->need_instance = 0;

$this->controllers = ['favorite'];
$this->bootstrap = true;
parent::__construct();

$this->displayName = 'Favorite products module';
$this->description = 'Favorite products module';
$this->displayName = $this->trans('Favorite products module', [], 'Modules.Isfavoriteproducts.Admin');
$this->description = $this->trans('Falcon theme favorite products module', [], 'Modules.Isfavoriteproducts.Admin');
$this->ps_versions_compliancy = ['min' => '8.0.0', 'max' => _PS_VERSION_];
}

public function isUsingNewTranslationSystem(): bool
{
return true;
}

private function getModuleInstaller(): ModuleInstaller
{
return new ModuleInstaller($this);
Expand Down

0 comments on commit 3d8e8ce

Please sign in to comment.