Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Location for common store/admin defines?

    Is there a file location for custom defines that are used on both the store side and admin? I've got the same defines in extra_definitions on both store and admin sides and it's a nightmare to remember to update both sides and a pain to code both files. I get fatal undefined constant errors for observers and other modules that execute from both the store and admin if a define is not on both sides. I'd really like to consolidate all my defines to make updating the constants and updating zc easier. Thanks!
    Dave
    zc157c, php 8.0.2

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,716
    Plugin Contributions
    123

    Default Re: Location for common store/admin defines?

    Pull in the storefront file in admin; don't replicate it.

    Example:
    storefront: includes/functions/extra_functions/some_functions.php

    Admin file admin/includes/functions/extra_functions/some_functions.php would be:

    <?php
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . '/extra_functions/some_functions.php';
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Location for common store/admin defines?

    Quote Originally Posted by swguy View Post
    Pull in the storefront file in admin; don't replicate it.

    Example:
    storefront: includes/functions/extra_functions/some_functions.php

    Admin file admin/includes/functions/extra_functions/some_functions.php would be:

    <?php
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . '/extra_functions/some_functions.php';
    Understanding that by use of that file path the catalog file must be completely in the catalog fileset and not in the (current) zc_plugins architecture.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Location for common store/admin defines?

    Thanks, that's very helpful. How would I access admin files from the store-side? DIR_FS_ADMIN does not appear to be present on the store-side.
    Thank you!

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,716
    Plugin Contributions
    123

    Default Re: Location for common store/admin defines?

    You can't access admin files from the store side unless you hardcode the admin name somewhere, which is not recommended.
    Put things on the storefront and then pull them into admin using the technique from above.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Location for common store/admin defines?

    Quote Originally Posted by Dave224 View Post
    Thanks, that's very helpful. How would I access admin files from the store-side? DIR_FS_ADMIN does not appear to be present on the store-side.
    Thank you!
    Put another way, for what intentional purpose would the catalog side need to access the admin?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Location for common store/admin defines?

    I thought so swguy. What I'm trying to do is create and mail an invoice to customers who use the invoice payment method, currently restricted to selected customers, when they checkout. The invoice code (and constants) are on the admin side. To complicate matters, the invoice code requires a stock by attribute file, also on the admin side. I think I need to trigger this process from the admin side using a cron job. Ugh. Any other suggestions?
    Dave

  8. #8
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,699
    Plugin Contributions
    9

    Default Re: Location for common store/admin defines?

    move those constants to the catalog side. keep it simple. then use the include the way swguy stated above.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 

Similar Threads

  1. v139h Issue with Store Locator adding db location to store website urls
    By Painted Hills NB in forum General Questions
    Replies: 8
    Last Post: 22 Aug 2012, 03:29 AM
  2. Require location of common pages
    By jasonhoward64 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Nov 2009, 03:57 AM
  3. Language defines in admin
    By sparrish in forum Customization from the Admin
    Replies: 3
    Last Post: 26 Apr 2007, 05:47 PM
  4. admin/catelogue common areas?
    By s_mack in forum General Questions
    Replies: 3
    Last Post: 8 Nov 2006, 02:07 AM
  5. change store location for images
    By MattDownUnder in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Sep 2006, 11:51 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