Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    43
    Plugin Contributions
    0

    help question AJAX Requests - how to return just data with no template?

    I am trying to add stock checking feature upon "Add to Cart" button click. I want to use AJAX.

    I know how to do all the JavaScript stuff, but I am just not sure how to return values from Zen Cart without templates? Ideally I'd like to have a separate file that I can send requests to, but have ability to use ZC internal functions from that file. How can this be done?

    Thank you!

  2. #2
    Join Date
    Jun 2007
    Location
    Australia - Melbourne
    Posts
    310
    Plugin Contributions
    6

    Default Re: AJAX Requests - how to return just data with no template?

    Hi Moltar, I was having the same problem with you, I handled that problem by creating all of my AJAX servers (the php files) on a separate folder "AJAX Servers" located at the root folder.

    You might want to check on my article here too: Implementing AJAX in Zen-Cart dillema

    My module "AJAX Image Swapper Basic" is using AJAX, you might want to learn the structure from there, feel free to use the same structure - I have made that IE & Firefox compatible (which was a HELLISH job to do btw)
    The greatest pleasure in life is doing what people say you cannot do.

    Check on www.WebExtremeCustomiser.com for my modules (free contribution):
    AJAX Image Swapper
    AJAX Banner Swapper
    Fixed Navigation

  3. #3
    Join Date
    Jun 2007
    Location
    Australia - Melbourne
    Posts
    310
    Plugin Contributions
    6

    Default Re: AJAX Requests - how to return just data with no template?

    Quote Originally Posted by moltar View Post
    have ability to use ZC internal functions from that file. How can this be done?
    require the application_top.php file from that file that should handle it. and see point 1 from my article too.
    The greatest pleasure in life is doing what people say you cannot do.

    Check on www.WebExtremeCustomiser.com for my modules (free contribution):
    AJAX Image Swapper
    AJAX Banner Swapper
    Fixed Navigation

 

 

Similar Threads

  1. v155 Getting ajax error in v155 with v154 Westminster template
    By godt in forum General Questions
    Replies: 3
    Last Post: 11 Jul 2016, 12:41 AM
  2. Ajax error with winchester black template
    By bluestorm in forum General Questions
    Replies: 2
    Last Post: 4 May 2016, 01:39 AM
  3. v155 Getting ajax error in v155 with v154 Westminster template
    By MCS_Computers in forum General Questions
    Replies: 10
    Last Post: 21 Mar 2016, 03:58 PM
  4. Ajax requests and session timeouts
    By lumpylumpy in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 24 Dec 2010, 02:23 PM
  5. blank page for ajax requests
    By skrnr in forum General Questions
    Replies: 3
    Last Post: 19 Dec 2007, 11:00 AM

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