Skip to content

Commit

Permalink
Remove check version
Browse files Browse the repository at this point in the history
  • Loading branch information
lqdung-lockon committed Jul 12, 2017
1 parent 40e99f4 commit 7fb8043
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
10 changes: 2 additions & 8 deletions Controller/Admin/RelatedProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Plugin\RelatedProduct\Controller\Admin;

use Eccube\Application;
use Plugin\RelatedProduct\Utils\Version;
use Symfony\Component\HttpFoundation\Request;

/**
Expand Down Expand Up @@ -43,12 +42,7 @@ public function searchProduct(Application $app, Request $request, $page_no = nul
'id' => $request->get('id'),
);
if ($categoryId = $request->get('category_id')) {
$searchData['category_id'] = $app['eccube.repository.category']->find($categoryId);

// New rule for session
if (Version::isSupportNewSession()) {
$searchData['category_id'] = $categoryId;
}
$searchData['category_id'] = $categoryId;
}
$session->set('eccube.plugin.related_product.product.search', $searchData);
$session->set('eccube.plugin.related_product.product.search.page_no', $page_no);
Expand All @@ -61,7 +55,7 @@ public function searchProduct(Application $app, Request $request, $page_no = nul
}
}

if (!empty($searchData['category_id']) && Version::isSupportNewSession()) {
if (!empty($searchData['category_id'])) {
$searchData['category_id'] = $app['eccube.repository.category']->find($searchData['category_id']);
}

Expand Down
12 changes: 1 addition & 11 deletions Utils/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,10 @@ public static function isSupportNewHookpoint()
/**
* Check version to support new log function.
*
* @return boo
* @return bool
*/
public static function isSupportLogFunction()
{
return version_compare(Constant::VERSION, '3.0.12', '>=');
}

/**
* Check version to support new session function.
*
* @return bool
*/
public static function isSupportNewSession()
{
return version_compare(Constant::VERSION, '3.0.15', '>=');
}
}

0 comments on commit 7fb8043

Please sign in to comment.