Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7600759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:59:27+00:00 2026-05-30T22:59:27+00:00

I’m new to CodeIgniter, but I’m loving it so far! I’m in the process

  • 0

I’m new to CodeIgniter, but I’m loving it so far!

I’m in the process of porting over the Shopify API to a CodeIgniter library but I’m running into a small issue that I can’t figure out for the life me!

I’m getting an undefined variable error, and I feel like it is something very simple that I am missing, but I can’t understand why it isn’t working. Here is the relevant code from the custom class:

class Shopify
{

public $_api_key;
public $_shared_secret;
//public $_shops_myshopify_domain;



public function __construct ()
{
    $this->_assign_libraries();

    $this->_api_key                     = $this->config->item('api_key', 'shopify');
    $this->_shared_secret               = $this->config->item('shared_secret', 'shopify');
    //$this->_shops_myshopify_domain        =$this->config->item('shops_myshopify_domain', 'bitauth');
}

public function shopify_app_install_url($shop_domain)
{
    return "http://$shop_domain/admin/api/auth?api_key=$_api_key";
}
 public function _assign_libraries()
 {
    if($CI =& get_instance())
    {
        $this->load     = $CI->load;
        $this->config   = $CI->config;

        $this->load->config('shopify', TRUE);

        return;
    }
 }[/code]

Here is the code from the config file I created:

/**
* Your shared secret
*/
$config['shared_secret'] = 'changed for posting on forum';

/**
* Your Shopify API key
*/
$config['api_key'] = 'changed for posting on forum';

And here is the relevant code in the controller:

    Class shopifyPermission extends CI_Controller {
    function __construct ()
    {
        parent::__construct();

        // Load the Shopify API library
        $this->load->library('shopify.php');
        // Require url helper to perform the header redirect
        $this->load->helper('url');
    }

    function index() {
        //require 'shopify.php';

        $shop_domain = "changed.myshopify.com";

        $url = $this->shopify->shopify_app_install_url($shop_domain);

        //redirect($url);

         $data['url'] = $url;

         $this->load->view('shopifyPermission_view', $data);
    }

}

The error that I get is as follows:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: _api_key

Filename: libraries/Shopify.php

Line Number: 34

So apparently the api key is not getting pulled from the config file even though I have a valid api key? When I do an echo it shows me the whole URL but the API key is not there. I am at a loss as to what to do and would appreciate any help! Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:59:28+00:00Added an answer on May 30, 2026 at 10:59 pm

    You’ve forgotten to add $this in your shopify_app_install_url()

    public function shopify_app_install_url($shop_domain)
    {
        return "http://$shop_domain/admin/api/auth?api_key={$this->_api_key}";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.