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
Indicator light circuit
If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?
Can I equip Skullclamp on a creature I am sacrificing?
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
How to count occurrences of text in a file?
Return the Closest Prime Number
Which kind of appliances can one connect to electric sockets located in an airplane's toilet?
What is "(CFMCC)" on an ILS approach chart?
How do we know the LHC results are robust?
Why do airplanes bank sharply to the right after air-to-air refueling?
Written every which way
How do I reset passwords on multiple websites easily?
How to start emacs in "nothing" mode (`fundamental-mode`)
Several mode to write the symbol of a vector
How did the Bene Gesserit know how to make a Kwisatz Haderach?
Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?
Won the lottery - how do I keep the money?
Would a completely good Muggle be able to use a wand?
Elegant way to replace substring in a regex with optional groups in Python?
Complex fractions
What was the first Unix version to run on a microcomputer?
Plot of histogram similar to output from @risk
How to invert MapIndexed on a ragged structure? How to construct a tree from rules?
To not tell, not take, and not want
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
I have problem in my controller
when not login my controller is run work
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
|
show 3 more comments
I have problem in my controller
when not login my controller is run work
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
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
|
show 3 more comments
I have problem in my controller
when not login my controller is run work
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
I have problem in my controller
when not login my controller is run work
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
magento2
edited 17 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
|
show 3 more comments
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
|
show 3 more comments
1 Answer
1
active
oldest
votes
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;
//
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
//
add a comment |
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;
//
add a comment |
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;
//
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;
//
edited Dec 27 '16 at 6:28
Krishna ijjada
5,85742356
5,85742356
answered Dec 23 '16 at 7:18
tttktttk
9818
9818
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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