- Posts: 57
- Thank you received: 1
How to automatically logout after vendor register
11 years 11 months ago #174654
by 888
How to automatically logout after vendor register was created by 888
-- HikaShop version -- : 2.3.3
-- HikaMarket version -- : 1.4.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.14-1
hi
How to i automatically logout user after vendor register and redirect to article id
vendors Registration options is automatic validation
-- HikaMarket version -- : 1.4.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.14-1
hi
How to i automatically logout user after vendor register and redirect to article id
vendors Registration options is automatic validation
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174657
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic How to automatically logout after vendor register
Hi,
You can override the view "vendormarket | after_register" and put your PHP custom code.
Thanks to that, you can call Joomla function to logout the user and finish with a redirect to your article.
Regards,
You can override the view "vendormarket | after_register" and put your PHP custom code.
Thanks to that, you can call Joomla function to logout the user and finish with a redirect to your article.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
11 years 11 months ago - 11 years 11 months ago #174686
by 888
Replied by 888 on topic How to automatically logout after vendor register
i did add this code
$app = JFactory::getApplication();
$user = JFactory::getUser();
$user_id = $user->get('id');
$app->logout($user_id, array());
echo '<script type="text/javascript">
window.location = " www.google.com/ "
</script>'
?>
but i get this error :
Please complete the Address field
Please complete the Post field
Please complete the town field
Please complete the phone field
Warning: Creating default object from empty value in ../administrator/components/com_hikamarket/classes/vendor.php on line 476
do i need to check required fields before adding the code
Like this?
$missing = array();
foreach ($_POST as $key => $value) { if ($value == "") { array_push($missing, $key);}}
if (count($missing) > 0) {
echo "Required fields found empty: ";
foreach ($missing as $k => $v) { echo $v." ";}
} else {
unset($missing);
$app = JFactory::getApplication();
$user = JFactory::getUser();
$user_id = $user->get('id');
$app->logout($user_id, array());
echo '<script type="text/javascript">
window.location = " www.google.com/ "
</script>'
}
$app = JFactory::getApplication();
$user = JFactory::getUser();
$user_id = $user->get('id');
$app->logout($user_id, array());
echo '<script type="text/javascript">
window.location = " www.google.com/ "
</script>'
?>
but i get this error :
Please complete the Address field
Please complete the Post field
Please complete the town field
Please complete the phone field
Warning: Creating default object from empty value in ../administrator/components/com_hikamarket/classes/vendor.php on line 476
do i need to check required fields before adding the code
Like this?
$missing = array();
foreach ($_POST as $key => $value) { if ($value == "") { array_push($missing, $key);}}
if (count($missing) > 0) {
echo "Required fields found empty: ";
foreach ($missing as $k => $v) { echo $v." ";}
} else {
unset($missing);
$app = JFactory::getApplication();
$user = JFactory::getUser();
$user_id = $user->get('id');
$app->logout($user_id, array());
echo '<script type="text/javascript">
window.location = " www.google.com/ "
</script>'
}
Last edit: 11 years 11 months ago by 888.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174689
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic How to automatically logout after vendor register
Hi,
Thanks for the report.
Please edit the file "administrator/components/com_hikamarket/classes/vendor.php" and remplace
By
For the rest, you can register a vendor account without providing the mandatory fields (Address, Post, town phone).
So the registration could not be completed correctly and that's why you got the messages.
The patch will fix that.
About your code, for the redirection, please using instead
Regards,
Thanks for the report.
Please edit the file "administrator/components/com_hikamarket/classes/vendor.php" and remplace
Code:
$vendor = $fieldClass->getInput( array('vendorregister','plg.hikamarket.vendor'), $old, true, 'data', false, 'display:vendor_registration=1');
Code:
$vendor = $fieldClass->getInput( array('vendorregister','plg.hikamarket.vendor'), $old, true, 'data', false, 'display:vendor_registration=1');
if($vendor === false)
return false;
For the rest, you can register a vendor account without providing the mandatory fields (Address, Post, town phone).
So the registration could not be completed correctly and that's why you got the messages.
The patch will fix that.
About your code, for the redirection, please using instead
Code:
$app->redirect('http://www.google.com');
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174704
by 888
Replied by 888 on topic How to automatically logout after vendor register
its ok now if you fill in all required fields
but if you do not fill in required fields this error
Warning: Invalid argument supplied for foreach() in
../administrator/components/com_hikashop/classes/field.php on line 642
but if you do not fill in required fields this error
Warning: Invalid argument supplied for foreach() in
../administrator/components/com_hikashop/classes/field.php on line 642
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174717
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic How to automatically logout after vendor register
Hi,
I'll try to reproduce your problem in my local website.
But like that, I can't know which custom field group is generating the error in your case.
What required fields do you no fill ? A vendor one ? A user one ? An address one ?
Regards,
I'll try to reproduce your problem in my local website.
But like that, I can't know which custom field group is generating the error in your case.
What required fields do you no fill ? A vendor one ? A user one ? An address one ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
11 years 11 months ago - 11 years 11 months ago #174722
by 888
Replied by 888 on topic How to automatically logout after vendor register
if new user forget / miss any or all of this required fields
plg.hikamarket.vendor vendor_address_company Company
plg.hikamarket.vendor vendor_address_street Address
plg.hikamarket.vendor vendor_address_post_code Post code
plg.hikamarket.vendor vendor_address_city City
plg.hikamarket.vendor vendor_address_telephone Telephone
did test not to fill in Postcode and City field and Telephone get this error
Please complete the Postcode field
Please complete the City field
Please complete the Telephone field
Error during registration
Warning: Invalid argument supplied for foreach() in .../administrator/components/com_hikashop/classes/field.php on line 642
index.php/shop-reg (the vendor registration page start test)
this page opens when you click register index.php/shop-reg/vendor/register (error page)
Regards,
plg.hikamarket.vendor vendor_address_company Company
plg.hikamarket.vendor vendor_address_street Address
plg.hikamarket.vendor vendor_address_post_code Post code
plg.hikamarket.vendor vendor_address_city City
plg.hikamarket.vendor vendor_address_telephone Telephone
did test not to fill in Postcode and City field and Telephone get this error
Please complete the Postcode field
Please complete the City field
Please complete the Telephone field
Error during registration
Warning: Invalid argument supplied for foreach() in .../administrator/components/com_hikashop/classes/field.php on line 642
index.php/shop-reg (the vendor registration page start test)
this page opens when you click register index.php/shop-reg/vendor/register (error page)
Regards,
Last edit: 11 years 11 months ago by 888.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174783
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic How to automatically logout after vendor register
Hi,
Please edit the file "components/com_hikamarket/controllers/vendor.php" and replace
By
It will re-display the registration form if there is an error during the user registration.
I am currently working on it in order to perform all tests before the user/vendor creation so if there is something missing for the vendor, the user registration won't be requested.
More than that, I will add some code in order to fill the elements with the previous entered values, some elements are missing.
Regards,
Please edit the file "components/com_hikamarket/controllers/vendor.php" and replace
Code:
if($status)
$user = $userClass->get($userClass->user_id);
else
return false;
Code:
if($status)
$user = $userClass->get($userClass->user_id);
else
return $this->form();
I am currently working on it in order to perform all tests before the user/vendor creation so if there is something missing for the vendor, the user registration won't be requested.
More than that, I will add some code in order to fill the elements with the previous entered values, some elements are missing.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.227 seconds