[SOLVED] Have CUSTOMER_DOWNLOADLIST Show Login

  • Posts: 284
  • Thank you received: 6
10 years 10 months ago #140054

-- 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: 10 years 10 months ago by MSTACE.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 10 months ago #140130

Add the 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:
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.

  • Posts: 284
  • Thank you received: 6
10 years 10 months ago #140142

That worked perfectly!

Thank you!

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

Time to create page: 0.053 seconds
Powered by Kunena Forum