Skip to main content

[SOLVED] Have CUSTOMER_DOWNLOADLIST Show Login

More
12 years 8 months ago - 12 years 8 months ago #140054 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.
Last edit: 12 years 8 months ago by MSTACE.

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #140130 by nicolas
Add the code:
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; }
before the code:
Code:
JRequest::setVar( 'layout', 'downloads' ); return parent::display();
in the file components/com_hikashop/controllers/user.php
The following user(s) said Thank You: MSTACE

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #140142 by MSTACE
That worked perfectly!

Thank you!

Please Log in or Create an account to join the conversation.

Time to create page: 0.186 seconds
Powered by Kunena Forum