Problem with this->config->get in checkout

  • Posts: 8
  • Thank you received: 0
13 years 4 months ago #21473

Hi There,

I recently installed a fresh installation of HikaShop 1.5.2.

When proceeding to the shopping cart I get the following error:

Fatal error: Call to a member function get() on a non-object in /home/(...)/public_html/components/com_hikashop/views/checkout/tmpl/step.php on line 51

The piece of code in step.php (starting at line 50):

global $Itemid;
	$checkout_itemid = $this->config->get('checkout_itemid');
	if(!empty($checkout_itemid )){
		$Itemid = $checkout_itemid ;
	}
	$url_itemid='';
	if(!empty($Itemid)){
		$url_itemid='&Itemid='.$Itemid;
	}

It looks like $this->config is not seen as an object. However, in previous versions of HikaShop I never got this problem, although these line of code are not new.

Does anyone have an idea what's wrong?
Thanks!

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21474

Hi,

$this->config is assigned in the main view file and it works for everyone. It's strange that you're getting that problem.
The solution is easy though, just add the code
$this->config = hikashop::config();
before that code in order to load the config object in that step file.

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

  • Posts: 8
  • Thank you received: 0
13 years 4 months ago #21476

Hi,

Thank you for the very fast reply. I was assuming that this->config was already working in this file, because of the main view file. Now because of this is working, I would conclude that the config object was not inherited in my step.php file before.

I'll test the configuration further on, but it seems to work :)

Thanks!

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

Time to create page: 0.061 seconds
Powered by Kunena Forum