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

    Default How to setup a custom handler ?

    Hi guys, I'm a newbie in Zen Cart, so I apology for a lame question.
    In my store, I want to use ajax for displaying some extra information about products. I'm able to send requests to my handler (websiteroot/my_handler.php), but I also want to access Zen classes, for example, queryFactory, from within my the handler. Is it possible at all ? What files should be included ?
    Thanks for your answers.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: How to setup a custom handler ?

    Don't kmow what exactly your are attempting???

    This might assist???
    http://www.zen-cart.com/index.php?ma...roducts_id=467

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

    Default Re: How to setup a custom handler ?

    @kobra
    Thanks for the link, but it's not what I need at the moment. I'll try to illustrate what I want to achieve:
    From product listing page I send data to my_handler.php through ajax(this part works, my_handler.php receives everything). Inside this file I want to write, for example
    PHP Code:
     global $db
    $db->Execute("some sql code"); 
    where $db is an instance of queryFactory. How can I initialize all zen cart stuff? I tried
    PHP Code:
    require_once("includes/application_top.php"); 
    , but it worked only if my_handler.php is in the root folder .
    Last edited by a1ex07; 23 Feb 2011 at 09:08 PM.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,451
    Plugin Contributions
    81

    Default Re: How to setup a custom handler ?

    Yes, loading application_top is the right approach.
    .
    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.

 

 

Similar Threads

  1. v151 Trouble with custom product handler
    By retched in forum Contribution-Writing Guidelines
    Replies: 3
    Last Post: 18 Dec 2012, 06:56 PM
  2. Custom Template Breaks Image Handler
    By Sc0tt in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Nov 2007, 02:54 PM
  3. need help with a custom form handler
    By BUTTSTTUB in forum General Questions
    Replies: 5
    Last Post: 7 Sep 2007, 09:33 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