- Posts: 293
- Thank you received: 9
[SOLVED] Have CUSTOMER_DOWNLOADLIST Show Login
12 years 8 months ago - 12 years 8 months ago #140054
by MSTACE
[SOLVED] Have CUSTOMER_DOWNLOADLIST Show Login was created by MSTACE
-- url of the page with the problem -- :
www.classicalguitarhowto.com/order-download-list/user/downloads
-- HikaShop version -- : HikaShop Business: 2.2.3
-- Joomla version -- : 3.2.1
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
If the User control panel is accessed by a guest, it will show a Login Form.
if the Customer orders menu item is accessed by a guest, it will show a Login Form.
BUT, if the CUSTOMER_DOWNLOADLIST menu item is accessed by a guest it will only show the words: "Please login first"
How can I get the HikaShop menu item "CUSTOMER_DOWNLOADLIST" to show a login box if it is selected by a website GUEST?
Thank you.
-- HikaShop version -- : HikaShop Business: 2.2.3
-- Joomla version -- : 3.2.1
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
If the User control panel is accessed by a guest, it will show a Login Form.
if the Customer orders menu item is accessed by a guest, it will show a Login Form.
BUT, if the CUSTOMER_DOWNLOADLIST menu item is accessed by a guest it will only show the words: "Please login first"
How can I get the HikaShop menu item "CUSTOMER_DOWNLOADLIST" to show a login box if it is selected by a website GUEST?
Thank you.
Last edit: 12 years 8 months ago by MSTACE.
Please Log in or Create an account to join the conversation.
12 years 8 months ago #140130
by nicolas
Replied by nicolas on topic How to Have CUSTOMER_DOWNLOADLIST Show Login Form
Add the code:
before the code:
in the file components/com_hikashop/controllers/user.php
Code:
$user = JFactory::getUser();
if ($user->guest) {
$app=JFactory::getApplication();
$app->enqueueMessage(JText::_('PLEASE_LOGIN_FIRST'));
global $Itemid;
$url = '';
if(!empty($Itemid)){
$url='&Itemid='.$Itemid;
}
if(!HIKASHOP_J16){
$url = 'index.php?option=com_user&view=login'.$url;
}else{
$url = 'index.php?option=com_users&view=login'.$url;
}
$app->redirect(JRoute::_($url.'&return='.urlencode(base64_encode(hikashop_currentUrl('',false))),false));
return false;
}
Code:
JRequest::setVar( 'layout', 'downloads' );
return parent::display();
The following user(s) said Thank You: MSTACE
Please Log in or Create an account to join the conversation.
12 years 8 months ago #140142
by MSTACE
Replied by MSTACE on topic How to Have CUSTOMER_DOWNLOADLIST Show Login Form
That worked perfectly!
Thank you!
Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.186 seconds