Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Designing a mod that uses an API to send info offsite

    This API requires a few things sent off - very few things such as customer first and last names, email and the product modules from the order that are in a specific category.

    I started working on just a query and insertion in the checkout success page and have just had a conversation with someone who suggested a different approach which makes more sense.

    So somewhere in the process - possibly as part of the order creation process - the information will be pulled from the order and stored in a new database table. I want the info sent off automatically at the end of each order that contains those products from a specific category.

    So the question is - how can I do this without mangling a number of core files? The order is created in the order classes file, I believe. Is this new table insertion going to have to be done in the class file? Is there any other way to do it?

    Should I tie the API send to checkout success - like in the header or should I do it earlier in case the order gets created and something goes wrong and the customer never gets to the success page (for various and sundry bizarre reasons)?

    Any suggestions would be appreciated!
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  2. #2
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Re: Designing a mod that uses an API to send info offsite

    in modules/checkout_process
    the code after
    // store the product info to the order
    will I believe give you the meat you are looking for!
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Designing a mod that uses an API to send info offsite

    thank you sir!!!!
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  4. #4
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Designing a mod that uses an API to send info offsite

    Well, I've run into a problem. After getting the code working separately, I'm finally trying to integrate this into the check_out process.

    it's not happy. get an error message: Call to undefined method order::createSendMURPHY()

    So I'm thinking it only allows payment or order total methods in here and not an additional function like I have created.

    Any other ideas?
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  5. #5
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Designing a mod that uses an API to send info offsite

    There are a handful of notifies during the checkout process... You may be able too just hook into one of these with an observer which then runs your code...

    I've used these in the past with success... For example to record live shipping request/responses for completed orders (useful for testing, saving the estimate REF#, saving user selected shipping options such as insurance, etc).

    This also avoids the need to edit core files in most cases.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,511
    Plugin Contributions
    126

    Default Re: Designing a mod that uses an API to send info offsite

    Delia, if you get a message that says undefined method order::createSendMURPHY()
    It means you are trying to call $this->createSendMURPHY() on an order object. Just call it as a regular method

    createSendMURPHY();
    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.

 

 

Similar Threads

  1. Pleaes help,any one that uses both the Easy populate and Ceon URI
    By mybiz9999 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 19 Sep 2010, 10:38 AM
  2. Who uses Transaction Central (Transfirst) Merchant Mod? URGENT
    By beyre in forum Addon Payment Modules
    Replies: 0
    Last Post: 3 May 2009, 05:49 PM
  3. Variables that uses in templates.
    By der Hund in forum Addon Templates
    Replies: 1
    Last Post: 3 Sep 2008, 03:25 PM
  4. Linkpoint API mod vs Attributes
    By rlundy82 in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 6 Jun 2006, 09:14 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