Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Posts
    4
    Plugin Contributions
    0

    Default cant add new functions to general.php or extra_functions folder

    Hi i have been trying to add new product type to zencart and is succesfull half way. i cant seem to add new functions to general.php or as a new products_new_functions.php

    following this help
    blog.kineticpulse.co.uk/2010/11/creating-new-product-type-in-zen-cart.html

    this is the function im trying to add
    PHP Code:
      function zen_get_products_airline($product_id$language_id) {
        global 
    $db;
        
    $product $db->Execute("select products_airline
                                 from " 
    TABLE_PRODUCTS_DESCRIPTION "
                                 where products_id = '" 
    . (int)$product_id "'
                                 and language_id = '" 
    . (int)$language_id "'");

        return 
    $product->fields['products_airline'];
      } 
    the moment i add a new fucntion in general.php or a new file in extra_functions.

    the admin area shuts down.

    only get black page;
    <html>
    <head></head>
    <body></body>
    </html>

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: cant add new functions to general.php or extra_functions folder

    All PHP files need to start with <?php on the first line. The code you posted doesn't have this, so likely is triggering an "unexpected T_STRING" error.
    You can see what errors you're triggering by using the myDebug logs: https://www.zen-cart.com/tutorials/index.php?article=82
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2011
    Posts
    4
    Plugin Contributions
    0

    Default Re: cant add new functions to general.php or extra_functions folder

    got it working!

    installed that debug tool and saw that

    i had function name clash

    zen_get_products_type

  4. #4
    Join Date
    Jul 2011
    Posts
    4
    Plugin Contributions
    0

    Default Re: cant add new functions to general.php or extra_functions folder

    thanks dr byte. didnt see your reply.

    but yeah i knew that i was trying to show the code part if there was anything wrong with it.

    creating a new product type is so much work! cant it be implemented like how we are adding options or attributes to a product?

 

 

Similar Threads

  1. /admin/includes/functions/general.php not in my files
    By suzijohn in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 9 Jan 2011, 11:32 PM

Posting Permissions

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