Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Error: Call to undefined function

    Hi, just starting out with PHP, have watched some tutorials concerning functions and am using cartweaver to create an internet store. I'm using a template and customsing it.

    When I load the site index page I get this error:

    Fatal error: Call to undefined function expandPath() in C:\xampp\htdocs\brmstest\cw4\cwapp\func\cw-func-product.php on line 400

    Line 400 of cw-func-product.php is:

    $imageDirPath = expandPath(CWtrailingChar($_ENV["application.cw"]["appCWContentDir"],"remove") . CWtrailingChar(CWleadingChar($_ENV["application.cw"]["appImagesDir"])) . CWtrailingChar(CWleadingChar($imageTypeDir,"remove")));Where should I find the function expand path? I don't know if it exists or does it just defining in this file in particular?

    If I need to define the function, where and how do I do that?

    Thanks in advance for any help. I hope my question isn't too stupid.

    Gathoni
    Last edited by gathoni; 01-03-2013 at 02:36 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,096
    Thanks
    23
    Thanked 594 Times in 593 Posts
    This is a guess gathoni and there is no way I can find the answer for you. Normally, functions are all lumped together in a single file someplace. They are loaded to a page with the require ("function_file_name") at the top of the php. This maybe commented out or was erased. If this don't work for you you can open each file you have and search for
    Code:
    function expandPath
    .

    I know that's way too little, but it's the best I have.

  • Users who have thanked sunfighter for this post:

    gathoni (01-07-2013)

  • #3
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks i found the file with the function actually when i delete the call to that function i get another undefined error message for a function from the same file. I cannot see anywhere 'require' there are comments on file dependencies, and it does mention a file which needs to be called, but the file where the relevant functions are is not mentioned

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,096
    Thanks
    23
    Thanked 594 Times in 593 Posts
    gathoni I went to Cartweaver Community Forums and searched on expandPath() This page came up http://forums.cartweaver.com/topic/warning-opendir. It doesn't give clear answers but tells me there is a place you can go to get answers. And that the expandPath() function returns the actual file paths on the server and therefore really necessary.

    You might also want to try the Lynda.com tutorial for setting up an ecommerce site with dreamweaver and cartweaver. It will cost you some money.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •