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

            Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2