magento2 controller error can't open when login custom customer group The Next CEO of Stack Overflowdata: current version - none, required version - 2.0.0Setup version for module 'Sample_CustomController' is not specifiedI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0Trying to uninstall moduleHow to solve Front controller reached 100 router match iterations in magento2Magento 2 Front controller reached 100 router match iterations issueDeleted ShipperHQ module causing error in “All Customers” section of Magento 2“Area code is not set” in var/logwhen click on place order then paypal showing error in Magento2

What connection does MS Office have to Netscape Navigator?

How do I make a variable always equal to the result of some calculations?

What happens if you roll doubles 3 times then land on "Go to jail?"

Bold, vivid family

Why do airplanes bank sharply to the right after air-to-air refueling?

What does "Its cash flow is deeply negative" mean?

In the bitcoin scripting language, how can I access other outputs of the transaction? Or how else can I limit how the coins may be spent?

What happened in Rome, when the western empire "fell"?

Why didn't Khan get resurrected in the Genesis Explosion?

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

Is micro rebar a better way to reinforce concrete than rebar?

How to avoid supervisors with prejudiced views?

Anatomically Correct Strange Women In Ponds Distributing Swords

Does it take more energy to get to Venus or to Mars?

What is "(CFMCC)" on an ILS approach chart?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Sending manuscript to multiple publishers

Indicator light circuit

Why am I allowed to create multiple unique pointers from a single object?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

What was the first Unix version to run on a microcomputer?

Contours of a clandestine nature

Received an invoice from my ex-employer billing me for training; how to handle?

Can you replace a racial trait cantrip when leveling up?



magento2 controller error can't open when login custom customer group



The Next CEO of Stack Overflowdata: current version - none, required version - 2.0.0Setup version for module 'Sample_CustomController' is not specifiedI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0Trying to uninstall moduleHow to solve Front controller reached 100 router match iterations in magento2Magento 2 Front controller reached 100 router match iterations issueDeleted ShipperHQ module causing error in “All Customers” section of Magento 2“Area code is not set” in var/logwhen click on place order then paypal showing error in Magento2










1















I have problem in my controller



when not login my controller is run work



enter image description here



but when login with custom customer group (VIP member) my controller is not work
and redirect to main page (index)



this is my code



 <?php
/**
*
* Copyright © 2015 commerce. All rights reserved.
*/
namespace MoneyokCustommoneyokControllerIndex;
class SortByCat extends MagentoFrameworkAppActionAction

/**
* @var MagentoFrameworkAppCacheTypeListInterface
*/
protected $_cacheTypeList;
/**
* @var MagentoFrameworkAppCacheStateInterface
*/
protected $_cacheState;
/**
* @var MagentoFrameworkAppCacheFrontendPool
*/
protected $_cacheFrontendPool;
/**
* @var MagentoFrameworkViewResultPageFactory
*/
protected $resultPageFactory;
/**
* @param ActionContext $context
* @param MagentoFrameworkAppCacheTypeListInterface $cacheTypeList
* @param MagentoFrameworkAppCacheStateInterface $cacheState
* @param MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkAppCacheTypeListInterface $cacheTypeList,
MagentoFrameworkAppCacheStateInterface $cacheState,
MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool,
MagentoFrameworkViewResultPageFactory $resultPageFactory
)
parent::__construct($context);
$this->_cacheTypeList = $cacheTypeList;
$this->_cacheState = $cacheState;
$this->_cacheFrontendPool = $cacheFrontendPool;
$this->resultPageFactory = $resultPageFactory;


/**
* Flush cache storage
*
*/
public function execute()

$myBlock = MagentoFrameworkAppObjectManager::getInstance()->get('TTHelloBlockHelloWorld');
$currentCategory = $myBlock->getCurrentCategory();
$params = $this->getRequest()->getParams();
// echo "55555;";
$s = $params['s'];
$sortby = $params['sortby'];
$fill = $params['fill'];
$idja = $params['id'];


$productCollection = $myBlock->getProductCollection();

$productCollection->addCategoriesFilter(['eq'=>$idja]);
$productCollection->setPageSize($s);
$productCollection->setOrder($sortby,$fill);
foreach ($productCollection as $product)
$productName=$product->getName();
$productId=$product->getId();
$productImg=$product->getImage();
$productUrl=$product->getProductUrl();
$productPrice=$product->getPrice();
$productSku=$product->getSku();
$price= number_format((float)$productPrice, '2', '.', ',');
$tier_price = $product->getTierPrice();
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
@$ratings = $RatingOb->getSum()/$RatingOb->getCount();
if (!$ratings=="")
$ratings;
else
@$ratings=0;

$json_data[]=array("productId"=>$productId,"productName"=>$productName,"productImg"=>$productImg,"productUrl"=>$productUrl,"productSku"=>$productSku,"productPrice"=>$price);
//"productTierPrice"=>$tier_price,,"ratings"=>@$ratings

$json=json_encode($json_data,JSON_UNESCAPED_UNICODE);
echo $json;





error log



a:4:i:0;s:127:"Notice: Undefined variable: json_data in /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php on line 87";i:1;s:8901:"#0 /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php(87): MagentoFrameworkAppErrorHandler->handler(8, 'Undefined varia...', '/var/www/html/a...', 87, Array)
#1 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(24): MoneyokCustommoneyokControllerIndexSortByCat->execute()
#2 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->execute()
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#4 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callParent('dispatch', Array)
#5 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'customer-app-ac...')
#6 /var/www/html/vendor/magento/module-customer/Model/App/Action/ContextPlugin.php(61): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#7 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoCustomerModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#8 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'contextPlugin')
#9 /var/www/html/vendor/magento/module-store/App/Action/Plugin/Context.php(106): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#10 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginContext->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#11 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'storeCheck')
#12 /var/www/html/vendor/magento/module-store/App/Action/Plugin/StoreCheck.php(44): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#13 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginStoreCheck->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#14 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'tax-app-action-...')
#15 /var/www/html/vendor/magento/module-tax/Model/App/Action/ContextPlugin.php(91): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#16 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoTaxModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'weee-app-action...')
#18 /var/www/html/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoWeeeModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#20 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(39): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callPlugins('dispatch', Array, Array)
#21 /var/www/html/vendor/magento/framework/App/FrontController.php(55): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#22 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#24 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'requestPreproce...')
#25 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#26 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#27 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'install')
#28 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#29 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoFrameworkModulePluginDbStatusValidator->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#31 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#32 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#34 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#35 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoPageCacheModelAppFrontControllerVarnishPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#36 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#37 /var/www/html/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#38 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): MagentoFrameworkAppHttp->launch()
#39 /var/www/html/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttp))
#40 main";s:3:"url";s:24:"/moneyok/index/SortByCat";s:11:"script_name";s:10:"/index.php";









share|improve this question
























  • can you please add error log

    – Vaibhav Ahalpara
    Dec 23 '16 at 5:21












  • @vaibhavahalpara update error

    – tttk
    Dec 23 '16 at 6:11











  • Notice: Undefined variable: json_data I think change $json_data[] to $json_data so a notice will remove then we see what is issued

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:16











  • @vaibhavahalpara but i not login or login with cutomer_group=cutomer my controller is work but i login user customer_group=vip member my controller is not work when to call have redirect to index

    – tttk
    Dec 23 '16 at 6:16











  • some time SortByCat this type of action not working can you can SortByCat to just Sortbycat

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:17















1















I have problem in my controller



when not login my controller is run work



enter image description here



but when login with custom customer group (VIP member) my controller is not work
and redirect to main page (index)



this is my code



 <?php
/**
*
* Copyright © 2015 commerce. All rights reserved.
*/
namespace MoneyokCustommoneyokControllerIndex;
class SortByCat extends MagentoFrameworkAppActionAction

/**
* @var MagentoFrameworkAppCacheTypeListInterface
*/
protected $_cacheTypeList;
/**
* @var MagentoFrameworkAppCacheStateInterface
*/
protected $_cacheState;
/**
* @var MagentoFrameworkAppCacheFrontendPool
*/
protected $_cacheFrontendPool;
/**
* @var MagentoFrameworkViewResultPageFactory
*/
protected $resultPageFactory;
/**
* @param ActionContext $context
* @param MagentoFrameworkAppCacheTypeListInterface $cacheTypeList
* @param MagentoFrameworkAppCacheStateInterface $cacheState
* @param MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkAppCacheTypeListInterface $cacheTypeList,
MagentoFrameworkAppCacheStateInterface $cacheState,
MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool,
MagentoFrameworkViewResultPageFactory $resultPageFactory
)
parent::__construct($context);
$this->_cacheTypeList = $cacheTypeList;
$this->_cacheState = $cacheState;
$this->_cacheFrontendPool = $cacheFrontendPool;
$this->resultPageFactory = $resultPageFactory;


/**
* Flush cache storage
*
*/
public function execute()

$myBlock = MagentoFrameworkAppObjectManager::getInstance()->get('TTHelloBlockHelloWorld');
$currentCategory = $myBlock->getCurrentCategory();
$params = $this->getRequest()->getParams();
// echo "55555;";
$s = $params['s'];
$sortby = $params['sortby'];
$fill = $params['fill'];
$idja = $params['id'];


$productCollection = $myBlock->getProductCollection();

$productCollection->addCategoriesFilter(['eq'=>$idja]);
$productCollection->setPageSize($s);
$productCollection->setOrder($sortby,$fill);
foreach ($productCollection as $product)
$productName=$product->getName();
$productId=$product->getId();
$productImg=$product->getImage();
$productUrl=$product->getProductUrl();
$productPrice=$product->getPrice();
$productSku=$product->getSku();
$price= number_format((float)$productPrice, '2', '.', ',');
$tier_price = $product->getTierPrice();
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
@$ratings = $RatingOb->getSum()/$RatingOb->getCount();
if (!$ratings=="")
$ratings;
else
@$ratings=0;

$json_data[]=array("productId"=>$productId,"productName"=>$productName,"productImg"=>$productImg,"productUrl"=>$productUrl,"productSku"=>$productSku,"productPrice"=>$price);
//"productTierPrice"=>$tier_price,,"ratings"=>@$ratings

$json=json_encode($json_data,JSON_UNESCAPED_UNICODE);
echo $json;





error log



a:4:i:0;s:127:"Notice: Undefined variable: json_data in /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php on line 87";i:1;s:8901:"#0 /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php(87): MagentoFrameworkAppErrorHandler->handler(8, 'Undefined varia...', '/var/www/html/a...', 87, Array)
#1 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(24): MoneyokCustommoneyokControllerIndexSortByCat->execute()
#2 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->execute()
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#4 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callParent('dispatch', Array)
#5 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'customer-app-ac...')
#6 /var/www/html/vendor/magento/module-customer/Model/App/Action/ContextPlugin.php(61): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#7 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoCustomerModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#8 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'contextPlugin')
#9 /var/www/html/vendor/magento/module-store/App/Action/Plugin/Context.php(106): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#10 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginContext->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#11 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'storeCheck')
#12 /var/www/html/vendor/magento/module-store/App/Action/Plugin/StoreCheck.php(44): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#13 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginStoreCheck->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#14 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'tax-app-action-...')
#15 /var/www/html/vendor/magento/module-tax/Model/App/Action/ContextPlugin.php(91): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#16 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoTaxModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'weee-app-action...')
#18 /var/www/html/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoWeeeModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#20 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(39): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callPlugins('dispatch', Array, Array)
#21 /var/www/html/vendor/magento/framework/App/FrontController.php(55): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#22 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#24 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'requestPreproce...')
#25 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#26 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#27 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'install')
#28 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#29 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoFrameworkModulePluginDbStatusValidator->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#31 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#32 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#34 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#35 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoPageCacheModelAppFrontControllerVarnishPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#36 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#37 /var/www/html/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#38 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): MagentoFrameworkAppHttp->launch()
#39 /var/www/html/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttp))
#40 main";s:3:"url";s:24:"/moneyok/index/SortByCat";s:11:"script_name";s:10:"/index.php";









share|improve this question
























  • can you please add error log

    – Vaibhav Ahalpara
    Dec 23 '16 at 5:21












  • @vaibhavahalpara update error

    – tttk
    Dec 23 '16 at 6:11











  • Notice: Undefined variable: json_data I think change $json_data[] to $json_data so a notice will remove then we see what is issued

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:16











  • @vaibhavahalpara but i not login or login with cutomer_group=cutomer my controller is work but i login user customer_group=vip member my controller is not work when to call have redirect to index

    – tttk
    Dec 23 '16 at 6:16











  • some time SortByCat this type of action not working can you can SortByCat to just Sortbycat

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:17













1












1








1








I have problem in my controller



when not login my controller is run work



enter image description here



but when login with custom customer group (VIP member) my controller is not work
and redirect to main page (index)



this is my code



 <?php
/**
*
* Copyright © 2015 commerce. All rights reserved.
*/
namespace MoneyokCustommoneyokControllerIndex;
class SortByCat extends MagentoFrameworkAppActionAction

/**
* @var MagentoFrameworkAppCacheTypeListInterface
*/
protected $_cacheTypeList;
/**
* @var MagentoFrameworkAppCacheStateInterface
*/
protected $_cacheState;
/**
* @var MagentoFrameworkAppCacheFrontendPool
*/
protected $_cacheFrontendPool;
/**
* @var MagentoFrameworkViewResultPageFactory
*/
protected $resultPageFactory;
/**
* @param ActionContext $context
* @param MagentoFrameworkAppCacheTypeListInterface $cacheTypeList
* @param MagentoFrameworkAppCacheStateInterface $cacheState
* @param MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkAppCacheTypeListInterface $cacheTypeList,
MagentoFrameworkAppCacheStateInterface $cacheState,
MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool,
MagentoFrameworkViewResultPageFactory $resultPageFactory
)
parent::__construct($context);
$this->_cacheTypeList = $cacheTypeList;
$this->_cacheState = $cacheState;
$this->_cacheFrontendPool = $cacheFrontendPool;
$this->resultPageFactory = $resultPageFactory;


/**
* Flush cache storage
*
*/
public function execute()

$myBlock = MagentoFrameworkAppObjectManager::getInstance()->get('TTHelloBlockHelloWorld');
$currentCategory = $myBlock->getCurrentCategory();
$params = $this->getRequest()->getParams();
// echo "55555;";
$s = $params['s'];
$sortby = $params['sortby'];
$fill = $params['fill'];
$idja = $params['id'];


$productCollection = $myBlock->getProductCollection();

$productCollection->addCategoriesFilter(['eq'=>$idja]);
$productCollection->setPageSize($s);
$productCollection->setOrder($sortby,$fill);
foreach ($productCollection as $product)
$productName=$product->getName();
$productId=$product->getId();
$productImg=$product->getImage();
$productUrl=$product->getProductUrl();
$productPrice=$product->getPrice();
$productSku=$product->getSku();
$price= number_format((float)$productPrice, '2', '.', ',');
$tier_price = $product->getTierPrice();
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
@$ratings = $RatingOb->getSum()/$RatingOb->getCount();
if (!$ratings=="")
$ratings;
else
@$ratings=0;

$json_data[]=array("productId"=>$productId,"productName"=>$productName,"productImg"=>$productImg,"productUrl"=>$productUrl,"productSku"=>$productSku,"productPrice"=>$price);
//"productTierPrice"=>$tier_price,,"ratings"=>@$ratings

$json=json_encode($json_data,JSON_UNESCAPED_UNICODE);
echo $json;





error log



a:4:i:0;s:127:"Notice: Undefined variable: json_data in /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php on line 87";i:1;s:8901:"#0 /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php(87): MagentoFrameworkAppErrorHandler->handler(8, 'Undefined varia...', '/var/www/html/a...', 87, Array)
#1 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(24): MoneyokCustommoneyokControllerIndexSortByCat->execute()
#2 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->execute()
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#4 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callParent('dispatch', Array)
#5 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'customer-app-ac...')
#6 /var/www/html/vendor/magento/module-customer/Model/App/Action/ContextPlugin.php(61): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#7 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoCustomerModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#8 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'contextPlugin')
#9 /var/www/html/vendor/magento/module-store/App/Action/Plugin/Context.php(106): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#10 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginContext->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#11 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'storeCheck')
#12 /var/www/html/vendor/magento/module-store/App/Action/Plugin/StoreCheck.php(44): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#13 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginStoreCheck->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#14 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'tax-app-action-...')
#15 /var/www/html/vendor/magento/module-tax/Model/App/Action/ContextPlugin.php(91): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#16 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoTaxModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'weee-app-action...')
#18 /var/www/html/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoWeeeModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#20 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(39): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callPlugins('dispatch', Array, Array)
#21 /var/www/html/vendor/magento/framework/App/FrontController.php(55): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#22 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#24 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'requestPreproce...')
#25 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#26 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#27 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'install')
#28 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#29 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoFrameworkModulePluginDbStatusValidator->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#31 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#32 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#34 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#35 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoPageCacheModelAppFrontControllerVarnishPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#36 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#37 /var/www/html/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#38 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): MagentoFrameworkAppHttp->launch()
#39 /var/www/html/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttp))
#40 main";s:3:"url";s:24:"/moneyok/index/SortByCat";s:11:"script_name";s:10:"/index.php";









share|improve this question
















I have problem in my controller



when not login my controller is run work



enter image description here



but when login with custom customer group (VIP member) my controller is not work
and redirect to main page (index)



this is my code



 <?php
/**
*
* Copyright © 2015 commerce. All rights reserved.
*/
namespace MoneyokCustommoneyokControllerIndex;
class SortByCat extends MagentoFrameworkAppActionAction

/**
* @var MagentoFrameworkAppCacheTypeListInterface
*/
protected $_cacheTypeList;
/**
* @var MagentoFrameworkAppCacheStateInterface
*/
protected $_cacheState;
/**
* @var MagentoFrameworkAppCacheFrontendPool
*/
protected $_cacheFrontendPool;
/**
* @var MagentoFrameworkViewResultPageFactory
*/
protected $resultPageFactory;
/**
* @param ActionContext $context
* @param MagentoFrameworkAppCacheTypeListInterface $cacheTypeList
* @param MagentoFrameworkAppCacheStateInterface $cacheState
* @param MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkAppCacheTypeListInterface $cacheTypeList,
MagentoFrameworkAppCacheStateInterface $cacheState,
MagentoFrameworkAppCacheFrontendPool $cacheFrontendPool,
MagentoFrameworkViewResultPageFactory $resultPageFactory
)
parent::__construct($context);
$this->_cacheTypeList = $cacheTypeList;
$this->_cacheState = $cacheState;
$this->_cacheFrontendPool = $cacheFrontendPool;
$this->resultPageFactory = $resultPageFactory;


/**
* Flush cache storage
*
*/
public function execute()

$myBlock = MagentoFrameworkAppObjectManager::getInstance()->get('TTHelloBlockHelloWorld');
$currentCategory = $myBlock->getCurrentCategory();
$params = $this->getRequest()->getParams();
// echo "55555;";
$s = $params['s'];
$sortby = $params['sortby'];
$fill = $params['fill'];
$idja = $params['id'];


$productCollection = $myBlock->getProductCollection();

$productCollection->addCategoriesFilter(['eq'=>$idja]);
$productCollection->setPageSize($s);
$productCollection->setOrder($sortby,$fill);
foreach ($productCollection as $product)
$productName=$product->getName();
$productId=$product->getId();
$productImg=$product->getImage();
$productUrl=$product->getProductUrl();
$productPrice=$product->getPrice();
$productSku=$product->getSku();
$price= number_format((float)$productPrice, '2', '.', ',');
$tier_price = $product->getTierPrice();
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
@$ratings = $RatingOb->getSum()/$RatingOb->getCount();
if (!$ratings=="")
$ratings;
else
@$ratings=0;

$json_data[]=array("productId"=>$productId,"productName"=>$productName,"productImg"=>$productImg,"productUrl"=>$productUrl,"productSku"=>$productSku,"productPrice"=>$price);
//"productTierPrice"=>$tier_price,,"ratings"=>@$ratings

$json=json_encode($json_data,JSON_UNESCAPED_UNICODE);
echo $json;





error log



a:4:i:0;s:127:"Notice: Undefined variable: json_data in /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php on line 87";i:1;s:8901:"#0 /var/www/html/app/code/Moneyok/Custommoneyok/Controller/Index/SortByCat.php(87): MagentoFrameworkAppErrorHandler->handler(8, 'Undefined varia...', '/var/www/html/a...', 87, Array)
#1 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(24): MoneyokCustommoneyokControllerIndexSortByCat->execute()
#2 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->execute()
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#4 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callParent('dispatch', Array)
#5 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'customer-app-ac...')
#6 /var/www/html/vendor/magento/module-customer/Model/App/Action/ContextPlugin.php(61): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#7 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoCustomerModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#8 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'contextPlugin')
#9 /var/www/html/vendor/magento/module-store/App/Action/Plugin/Context.php(106): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#10 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginContext->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#11 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'storeCheck')
#12 /var/www/html/vendor/magento/module-store/App/Action/Plugin/StoreCheck.php(44): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#13 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppActionPluginStoreCheck->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#14 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'tax-app-action-...')
#15 /var/www/html/vendor/magento/module-tax/Model/App/Action/ContextPlugin.php(91): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#16 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoTaxModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Moneyok\Customm...', 'dispatch', Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Array, 'weee-app-action...')
#18 /var/www/html/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoWeeeModelAppActionContextPlugin->aroundDispatch(Object(MoneyokCustommoneyokControllerIndexSortByCatInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#20 /var/www/html/var/generation/Moneyok/Custommoneyok/Controller/Index/SortByCat/Interceptor.php(39): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->___callPlugins('dispatch', Array, Array)
#21 /var/www/html/vendor/magento/framework/App/FrontController.php(55): MoneyokCustommoneyokControllerIndexSortByCatInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#22 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#24 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'requestPreproce...')
#25 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#26 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#27 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'install')
#28 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#29 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoFrameworkModulePluginDbStatusValidator->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#31 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChainclosure(Object(MagentoFrameworkAppRequestHttp))
#32 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor), Array, 'front-controlle...')
#34 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#35 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoPageCacheModelAppFrontControllerVarnishPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#36 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#37 /var/www/html/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#38 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): MagentoFrameworkAppHttp->launch()
#39 /var/www/html/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttp))
#40 main";s:3:"url";s:24:"/moneyok/index/SortByCat";s:11:"script_name";s:10:"/index.php";






magento2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 22 mins ago









Teja Bhagavan Kollepara

3,01241949




3,01241949










asked Dec 23 '16 at 2:05









tttktttk

9818




9818












  • can you please add error log

    – Vaibhav Ahalpara
    Dec 23 '16 at 5:21












  • @vaibhavahalpara update error

    – tttk
    Dec 23 '16 at 6:11











  • Notice: Undefined variable: json_data I think change $json_data[] to $json_data so a notice will remove then we see what is issued

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:16











  • @vaibhavahalpara but i not login or login with cutomer_group=cutomer my controller is work but i login user customer_group=vip member my controller is not work when to call have redirect to index

    – tttk
    Dec 23 '16 at 6:16











  • some time SortByCat this type of action not working can you can SortByCat to just Sortbycat

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:17

















  • can you please add error log

    – Vaibhav Ahalpara
    Dec 23 '16 at 5:21












  • @vaibhavahalpara update error

    – tttk
    Dec 23 '16 at 6:11











  • Notice: Undefined variable: json_data I think change $json_data[] to $json_data so a notice will remove then we see what is issued

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:16











  • @vaibhavahalpara but i not login or login with cutomer_group=cutomer my controller is work but i login user customer_group=vip member my controller is not work when to call have redirect to index

    – tttk
    Dec 23 '16 at 6:16











  • some time SortByCat this type of action not working can you can SortByCat to just Sortbycat

    – Vaibhav Ahalpara
    Dec 23 '16 at 6:17
















can you please add error log

– Vaibhav Ahalpara
Dec 23 '16 at 5:21






can you please add error log

– Vaibhav Ahalpara
Dec 23 '16 at 5:21














@vaibhavahalpara update error

– tttk
Dec 23 '16 at 6:11





@vaibhavahalpara update error

– tttk
Dec 23 '16 at 6:11













Notice: Undefined variable: json_data I think change $json_data[] to $json_data so a notice will remove then we see what is issued

– Vaibhav Ahalpara
Dec 23 '16 at 6:16





Notice: Undefined variable: json_data I think change $json_data[] to $json_data so a notice will remove then we see what is issued

– Vaibhav Ahalpara
Dec 23 '16 at 6:16













@vaibhavahalpara but i not login or login with cutomer_group=cutomer my controller is work but i login user customer_group=vip member my controller is not work when to call have redirect to index

– tttk
Dec 23 '16 at 6:16





@vaibhavahalpara but i not login or login with cutomer_group=cutomer my controller is work but i login user customer_group=vip member my controller is not work when to call have redirect to index

– tttk
Dec 23 '16 at 6:16













some time SortByCat this type of action not working can you can SortByCat to just Sortbycat

– Vaibhav Ahalpara
Dec 23 '16 at 6:17





some time SortByCat this type of action not working can you can SortByCat to just Sortbycat

– Vaibhav Ahalpara
Dec 23 '16 at 6:17










1 Answer
1






active

oldest

votes


















0














Finally i found the bug by myself by following the below code.



// $tier_price = $product->getTierPrice();
// $objectManager = MagentoFrameworkAppObjectManager::getInstance();
// $RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
// @$ratings = $RatingOb->getSum()/$RatingOb->getCount();
// if (!$ratings=="")
// $ratings;
// else
// @$ratings=0;
//





share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f151596%2fmagento2-controller-error-cant-open-when-login-custom-customer-group%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Finally i found the bug by myself by following the below code.



    // $tier_price = $product->getTierPrice();
    // $objectManager = MagentoFrameworkAppObjectManager::getInstance();
    // $RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
    // @$ratings = $RatingOb->getSum()/$RatingOb->getCount();
    // if (!$ratings=="")
    // $ratings;
    // else
    // @$ratings=0;
    //





    share|improve this answer





























      0














      Finally i found the bug by myself by following the below code.



      // $tier_price = $product->getTierPrice();
      // $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      // $RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
      // @$ratings = $RatingOb->getSum()/$RatingOb->getCount();
      // if (!$ratings=="")
      // $ratings;
      // else
      // @$ratings=0;
      //





      share|improve this answer



























        0












        0








        0







        Finally i found the bug by myself by following the below code.



        // $tier_price = $product->getTierPrice();
        // $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        // $RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
        // @$ratings = $RatingOb->getSum()/$RatingOb->getCount();
        // if (!$ratings=="")
        // $ratings;
        // else
        // @$ratings=0;
        //





        share|improve this answer















        Finally i found the bug by myself by following the below code.



        // $tier_price = $product->getTierPrice();
        // $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        // $RatingOb = $objectManager->create('MagentoReviewModelRating')->getEntitySummary($productId);
        // @$ratings = $RatingOb->getSum()/$RatingOb->getCount();
        // if (!$ratings=="")
        // $ratings;
        // else
        // @$ratings=0;
        //






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 27 '16 at 6:28









        Krishna ijjada

        5,85742356




        5,85742356










        answered Dec 23 '16 at 7:18









        tttktttk

        9818




        9818



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f151596%2fmagento2-controller-error-cant-open-when-login-custom-customer-group%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

            Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»

            If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned? The 2019 Stack Overflow Developer Survey Results Are InDoes a zero-damage attack still count as a hit?Damage reduction and damage resistance: how to calculate?If a monk reduces damage to 0 using Deflect Missiles, does the attack still hit?Do damage resistance and temp hit points from False Life and the Heavy Armor Master feat stack?When does Armor of Agathys take effect?Should the damage from an unarmed strike be reduced by Heavy Armor Master?What's the duration of these wild feats?Does the Heavy Armor Master feat reduce damage twice against a mixed damage attack?Are Erinyes' Hellish Weapons poisonous in a PC's hands?How can I gain resistance to piercing, bludgeoning, and slashing damage while in heavy armor?Damage reduction and damage resistance: how to calculate?Can Mage Hand Legerdemain load a hand crossbow? What about two hand crossbows?Does the Polearm Master attack work with poison?