Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Location
    Norwich, Norfolk
    Posts
    5
    Plugin Contributions
    0

    Default Best way to use custom class between catalogue and admin

    Hi,

    What is the expected way to use a class both within the catalog and also admin? is it to use the init system? or do I just need to do a normal "require", store the class in the catalog classes directory and fiddle about with the require path?

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Best way to use custom class between catalogue and admin

    You'd place your new class file in /includes/classes/new_class.php. To load the class file, on the store-front side, you'd use:
    Code:
    require(DIR_WS_CLASSES . 'new_class.php');
    On the admin side, you'd use
    Code:
    require(DIR_WS_CATALOG . 'includes/classes/new_class.php');
    That's "assuming" that the class is not required to be loaded for each and every page in store-front and admin. If that's the case for you, post back and I'll provide an update.
    Last edited by lat9; 27 Oct 2013 at 03:44 PM. Reason: Add details

 

 

Similar Threads

  1. Custom jewelry mulitple options? Best way?
    By LilleyPadGifts in forum Setting Up Categories, Products, Attributes
    Replies: 36
    Last Post: 1 Feb 2013, 05:00 AM
  2. I want to share session between admin and cart for specialized use
    By whippetblue in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 Feb 2010, 11:26 AM
  3. Best way to set up class registration/payment
    By mountainsmemories in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Jan 2008, 06:55 AM
  4. Best Way To Do Dropshipping?
    By jtatarin in forum General Questions
    Replies: 0
    Last Post: 26 Jan 2007, 04:16 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR