Am new in Opencart I need an If then statement that will load a different .tpl paged depend on category_id.
I tried but showing error like
Parse error: syntax error, unexpected 'if' (T_IF), expecting ')' in D:\xampp\htdocs\ramesh\lmw\catalog\controller\product\sub_category.php on line 28
This is my code
sub_category.php
foreach ($category_info as $result) {
$data['categories'][] = array(
'name' => $result['name'],
'parent_id' => $result['parent_id'],
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')),
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
#'href' => $this->url->link('product/filter', '&category_id=' . $result['category_id'])
#'href' => $this->url->link('product/sub_category')
if($result['category_id'] == 24)
{
'href' => $this->url->link('product/transmission', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id'])
}
else
{
'href' => $this->url->link('product/filter', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id'])
}
);
}
Try this,
foreach ($category_info as $result) {
$data['categories'][] = array(
'name' => $result['name'],
'parent_id' => $result['parent_id'],
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')),
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
#'href' => $this->url->link('product/filter', '&category_id=' . $result['category_id'])
#'href' => $this->url->link('product/sub_category')
if($result['category_id'] == 24)
{
'href' => $this->url->link('product/transmission', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id'])
}
else
{
'href' => $this->url->link('product/filter', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id'])
};
);
}
Looks like you missed a ";" after the if statement. Also you should comment out using /* not "#"
foreach ($category_info as $result) {
if($result['category_id']==24)
{
$link1 = $this->url->link('product/transmission', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id']);
}
else
{
$link1 = $this->url->link($_SERVER["REQUEST_URI"]);
}
$data['categories'][] = array(
'name' => $result['name'],
'parent_id' => $result['parent_id'],
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')),
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
/*'href' => $this->url->link('product/filter', '&category_id=' . $result['category_id'])
'href' => $this->url->link('product/sub_category')
'href' => $this->url->link('product/transmission', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id'])*/
'href' => $link1
);
Related
I have just installed easypaisa payment extention but when I am trying to active it is giving undefined index error the errors are below please check:
Notice: Undefined index: token in easypaisa.php on line 61
Notice: Undefined index: token in easypaisa.php on line 66
Notice: Undefined index: token in easypaisa.php on line 71
Notice: Undefined index: token in easypaisa.php on line 74
Notice: Undefined index: token in easypaisa.php on line 76
And code from line 61 to 76 is below:
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=payment', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/payment/easypaisa', 'token=' . $this->session->data['token'], true)
);
$data['action'] = $this->url->link('extension/payment/easypaisa', 'token=' . $this->session->data['token'], true);
$data['cancel'] = $this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=payment', true);
Any idea how can we fix it ? or any other way to active this payment extention maybe if there is any way to enable it from phpmyadmin.
In OC3 you should use user_token instead token
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/payment/easypaisa', 'user_token=' . $this->session->data['user_token'], true)
);
$data['action'] = $this->url->link('extension/payment/easypaisa', 'user_token=' . $this->session->data['user_token'], true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment', true);
Opencart 3031 You should user_token instead token.and i set session data it properly.
You can try below code i think is great working..
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . isset($this->session->data['user_token']), true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . isset($this->session->data['user_token']) . '&type=payment', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/payment/easypaisa', 'user_token=' . isset($this->session->data['user_token']), true)
);
$data['action'] = $this->url->link('extension/payment/easypaisa', 'user_token=' . isset($this->session->data['user_token']), true);
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . isset($this->session->data['user_token']) . '&type=payment', true);
after making these changes sure code working very well..
Thanks
I make a dynamic change of option names for each product.
The problem is that I'm writing the table change. Oc_product_option
By going to system / library / cart.php > public function getProducts() { } there is only loaded there product_option_value.
I want to load this code in system / library / cart.php > public function getProducts() { }
And then call it in the catalog / controller / common> cart.php
$data['options'] = array();
foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) {
$product_option_value_data = array();
foreach ($option['product_option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency']);
} else {
$price = false;
}
$product_option_value_data[] = array(
'product_option_value_id' => $option_value['product_option_value_id'],
'option_value_id' => $option_value['option_value_id'],
'name' => $option_value['name'],
'ob_info' => $option_value['ob_info'],
'image' => $this->model_tool_image->onesize($option_value['image'], 100, 100),
'price' => $price,
'price_prefix' => $option_value['price_prefix']
);
}
}
$data['options'][] = array(
'product_option_id' => $option['product_option_id'],
'product_option_value' => $product_option_value_data,
'option_id' => $option['option_id'],
'name' => $option['name'],
'type' => $option['type'],
'value' => $option['value'],
'required' => $option['required']
);
}
Table img: http://imgur.com/a/A9Ibw
I want to do this because when I add a product it does not stay with the changed name and it takes the name of the option so dynamicname does not detect it.
Please make changes in catalog/model/catalog/product.php as following
public function getProductOptions($product_id) {
$product_option_data = array();
$product_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE po.product_id = '" . (int)$product_id . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY o.sort_order");
foreach ($product_option_query->rows as $product_option) {
$product_option_value_data = array();
$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_id = '" . (int)$product_id . "' AND pov.product_option_id = '" . (int)$product_option['product_option_id'] . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY ov.sort_order");
foreach ($product_option_value_query->rows as $product_option_value) {
$product_option_value_data[] = array(
'product_option_value_id' => $product_option_value['product_option_value_id'],
'option_value_id' => $product_option_value['option_value_id'],
'name' => $product_option_value['name'],
'image' => $product_option_value['image'],
'quantity' => $product_option_value['quantity'],
'subtract' => $product_option_value['subtract'],
'price' => $product_option_value['price'],
'price_prefix' => $product_option_value['price_prefix'],
'weight' => $product_option_value['weight'],
'weight_prefix' => $product_option_value['weight_prefix']
);
}
$product_option_data[] = array(
'product_option_id' => $product_option['product_option_id'],
'product_option_value' => $product_option_value_data,
'option_id' => $product_option['option_id'],
'name' => $product_option['name'],
'dynamicname' => $product_option['dynamicname'],
'type' => $product_option['type'],
'value' => $product_option['value'],
'required' => $product_option['required']
);
}
return $product_option_data;
}
after that you can get the dynamicname in controller as following
$data['options'] = array();
foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) {
$product_option_value_data = array();
foreach ($option['product_option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency']);
} else {
$price = false;
}
$product_option_value_data[] = array(
'product_option_value_id' => $option_value['product_option_value_id'],
'option_value_id' => $option_value['option_value_id'],
'name' => $option_value['name'],
'ob_info' => $option_value['ob_info'],
'image' => $this->model_tool_image->onesize($option_value['image'], 100, 100),
'price' => $price,
'price_prefix' => $option_value['price_prefix']
);
}
}
$data['options'][] = array(
'product_option_id' => $option['product_option_id'],
'product_option_value' => $product_option_value_data,
'option_id' => $option['option_id'],
'name' => $option['name'],
'dynamicname' => $option['dynamicname'],
'type' => $option['type'],
'value' => $option['value'],
'required' => $option['required']
);
}
Each connected member of my site has its database.
Here is the doctrine config for "user_1":
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'user_1',
'password' => 'psswd_user_1',
'dbname' => 'database_user_1',
'charset' => 'utf8',
'driverOptions' => array (1002 => 'SET NAMES utf8'),
)),),),);
Is there a way to replace :
'user_1', 'psswd_user_1' and 'database_user_1'
with
'user_x', 'psswd_user_x' and 'database_user_x' for user_x ?
I don't know how to do that !
I'd like to avoid copying the same code for each user ...
Thank you for help
The proper way to do this might be to inject the configuration that you need when the connection is created. I couldn't find any event that you could hook into to do that, so you have to find the right service manager key to override.
With a little bit of source code digging, I found that these options are sent to a DoctrineORMModule\Options\DBALConnection instance and that this instance is created by DoctrineORMModule\Service\DBALConnectionFactory
You need to override this factory with something like this:
<?php
namespace MyModule\Service;
use DoctrineORMModule\Service\DBALConnectionFactory;
use Zend\ServiceManager\ServiceLocatorInterface;
class MyDBALConnectionFactory extends DBALConnectionFactory
{
public function getOptions(ServiceLocatorInterface $sl, $key, $name = null)
{
$options = parent::getOptions($sl, $key, $name);
// override for everyone that needs a DBALConnection
if ($this->getOptionClass() === 'DoctrineORMModule\Options\DBALConnection') {
// set custom parameters here
// maybe fetch the current user with $sl->get('...')
$params = [/* ... */];
$options->setParams($params);
}
return $options;
}
}
And then you just tell the service manager about it:
<?php
return [
...
'doctrine' => [
'doctrine_factories' => [
'connection' => 'MyModule\Service\DBALConnectionFactory',
]
]
...
];
Thanks to Alejandro Celaya.
1st link and 2d link
I hope it will be useful.
I know it's not perfect but I can't do better ! I'd like critical.
in config/autoload/doctrine.local.php:
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '',
'dbname' => 'gestion_toto_default',
'charset' => 'utf8',
'driverOptions' => array(1002 => 'SET NAMES utf8'),
)
),
'orm_toto_users' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '',
//gestion_toto_users has 2 tables : users and db_users
'dbname' => 'gestion_toto_users',
'driverOptions' => array(1002 => 'SET NAMES utf8'),
)
),
'dynamic_orm' => array(
'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => '',
'password' => '',
'dbname' => '',
'driverOptions' => array(1002 => 'SET NAMES utf8'),
),
),
),
'driver' => array(
'orm_toto_users' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\DriverChain',
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
),
'dynamic_orm' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
),
),
'entitymanager' => array(
'orm_toto_users' => array(
'connection' => 'orm_toto_users',
'configuration' => 'orm_default'
),
'dynamic_orm' => array(
'connection' => 'dynamic_orm',
),
),
'eventmanager' => array(
'orm_toto_users' => array()
),
'sql_logger_collector' => array(
'orm_toto_users' => array(),
),
'entity_resolver' => array(
'orm_toto_users' => array()
),),
module.config.php :
'doctrine' => array(
'driver' => array(
__NAMESPACE__ . '_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(
__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity'
),
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
),
),
'authentication' => array(
'orm_default' => array(
'object_manager' => 'doctrine.entitymanager.orm_toto_users',
'identity_class' => 'MyModule\Entity\User',
'identity_property' => 'identifiant',
'credential_property' => 'password',
'credential_callable' => function(\MyModule\Entity\User $user, $passwordGiven) {
$bcrypt = new \Zend\Crypt\Password\Bcrypt();
return $bcrypt->verify($psswdGiven, $user->getPsswd()) && $user->getIsactif();
},
),
),
),
in Xcontroller :
public function getEntityManager()
{
if (null === $this->em) {
$this->em = $this->getServiceLocator()->get('dynamic_entity_manager');
}
return $this->em;
}
in userController :
public function getEntityManager()
{
if (null === $this->em) {
$this->em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_toto_users');
}
return $this->em;
}
in DynamicEMFactory.php:
class DynamicEMFactory implements FactoryInterface {
public function createService(ServiceLocatorInterface $serviceLocator)
{
// Get current user
$authService = $serviceLocator->get('Zend\Authentication\AuthenticationService');
if (! $authService->hasIdentity()) {
throw new \RuntimeException(
'It is not possible to create a dynamic entity manager before a user has logged in'
);
}
$user = $authService->getIdentity();
$db_User = $user->getUser_db()->getDbuser();
$db_Psswd = $user->getUser_db()->getDbpsswd();
$db_Name = $user->getUser_db()->getDbname();
// Update connection config
$globalConfig = $serviceLocator->get('config');
$globalConfig['doctrine']['connection']['dynamic_orm']['params']['user'] = $db_User;
$globalConfig['doctrine']['connection']['dynamic_orm']['params']['password'] = $db_Psswd;
$globalConfig['doctrine']['connection']['dynamic_orm']['params']['dbname'] = $db_Name;
$isAllowOverride = $serviceLocator->getAllowOverride();
$serviceLocator->setAllowOverride(true);
$serviceLocator->setService('config', $globalConfig);
$serviceLocator->setAllowOverride($isAllowOverride);
return $serviceLocator->get('doctrine.entitymanager.dynamic_orm');
}
}
in module.config :
'service_manager' => array(
'factories' => array(
'dynamic_entity_manager' => 'XXX\Service\Factory\DynamicEMFactory',
in onBootstrap (to change appearence):
$authService = $serviceManager->get('Zend\Authentication\AuthenticationService');
if ($authService->getIdentity()) {
$em = $serviceManager->get('dynamic_entity_manager');
} else {
$em = $serviceManager->get('doctrine.entitymanager.orm_default');
}
$viewModel = $e->getApplication()->getMvcEvent()->getViewModel();
$query = $serviceManager->get('param_user');
$tab = $query->getReponse($em);
$nom_theme = $tab['something']));
$viewModel->nom_theme = $nom_theme;//to layout
I am using opencart 1.5.4.
I would like to show a count of how many products are in a child category on my list of categories on this page:
http://50.87.186.42/index.php?route=product/category&path=59_60
I have tried to add the code but it looks like it is already in the controller (category/controller/module/category.php)
Here is the code I am looking at:
foreach ($children as $child) {
$data = array(
'filter_category_id' => $child['category_id'],
'filter_sub_category' => true
);
$product_total = $this->model_catalog_product->getTotalProducts($data);
$total += $product_total;
$children_data[] = array(
'category_id' => $child['category_id'],
'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
);
}
It looks like it is using either $total or $product_total but it isn't displaying on the front end. Did I turn this off somewhere or is there a way to turn it back on?
Thanks,
Matt
repalce this foreach (not $children the whole $categories) and let me know if its work or not ...
foreach ($categories as $category) {
$total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id']));
$children_data = array();
$children = $this->model_catalog_category->getCategories($category['category_id']);
foreach ($children as $child) {
$product_total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $child['category_id']));
$total += $product_total;
$children_data[] = array(
'category_id' => $child['category_id'],
'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
'total' => $product_total,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
);
}
$this->data['categories'][] = array(
'category_id' => $category['category_id'],
'name' => $category['name'] . ($this->config->get('config_product_count') ? ' (' . $total . ')' : ''),
'children' => $children_data,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
}
I'm trying to set a login(Authentication) using Zend2 and DoctrineODMModule but I am getting an error.
I have followed the tutorial to setup the Authentication of Zend2 with doctorineODMModule on github
any suggestion what I am doing wrong? or what I have to do?
i have done it in the following way.
in doctrine mdule.config.php
'authentication' => array(
'odm_default' => array(
'object_manager' => 'doctrine.documentmanager.odm_default',
'identity_class' => 'Admin\Document\User',
'identity_property' => 'username',
'credential_property' => 'password',
),
),
'odm_driver' => array(
'class' => 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Document')
),
'odm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Document' => 'odm_driver'
)
)
in Admin/Document/User.php created two methods getUsername and getPassword.
public function getUsername(){
return $this->username;
}
public function getPassword(){
return $this->password;
}
created controller in index controller.php
public function loginAction(){
$this->layout('layout/login-layout.phtml');
$login_error=false;
$loginForm = new LoginForm();
if ($this->request->isPost())
{
$loginForm->setData($this->request->getPost());
if ($loginForm->isValid())
{
// try {
// throw new \Exception("My exception");
$data = $loginForm->getData();
$authService = $this->getServiceLocator()
->get('doctrine.authenticationservice.odm_default');
$adapter = $authService->getAdapter();
$adapter->setIdentityValue($data['username']); // i am using username
$adapter->setCredentialValue(md5($data['password']));
$authResult = $authService->authenticate();
if ($authResult->isValid()) {
$this->redirect()->toRoute('admin_index'); // or last viewed page
}
/*} catch (Exception $e) {
echo "Caught exception $e\n";
echo $e->getPrevious();
$login_error=false;
return new ViewModel(array(
'loginForm' => $loginForm,
'login_error' => $login_error,
));
//exit;
}/
return array(
'loginForm' => $loginForm,
'errors' => 'username or password is not valid',
);
$this->redirect()->toRoute('admin_index');
} else {
//
// LOG Event ( login|password not valide )
//
//Zend\Debug\Debug::dump("not valid data");
//Zend\Debug\Debug::dump($loginForm->getMessages());
$login_error=true;
}//* */
}
}
//
return new ViewModel(array(
'loginForm' => $loginForm,
'login_error' => $login_error,
));
}
With the message you give,
A value for the identity was not provided prior to authentication with ObjectRepository authentication adapter
I'd say that either you didn't give the field to use as identity on you're User Document or during authentication process (in your action) you didn't populate the value for identity (aka login)
Please give more informations about your app (odm module configuration, Identity class...) to provide you a better help
as configuration you should have stg like :
...
'doctrine' => array(
'driver' => array(
__NAMESPACE__ . '_orm_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_orm_driver'
)
),
__NAMESPACE__ . '_odm_driver' => array(
'class' => 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Document')
),
'odm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Document' => __NAMESPACE__ . '_odm_driver'
)
)
),
'authentication' => array(
'odm_default' => array(
'objectManager' => 'doctrine.documentmanager.odm_default',
'identityClass' => 'Application\Document\User',
'identityProperty' => 'username',
'credentialProperty' => 'password',
'credentialCallable' => 'Application\Utils::hashPassword' // Not needed if you don't hash passwords
),
),
),
...
This was working great for some of my projects