Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    820
    Plugin Contributions
    9

    Default Skeleton of modules?

    PHP 8.4 / ZC 2.1.0

    I thought I saw this mentioned in the documentation but probably track of it: is there any documentation on the minimum functions needed for any of the shipping, payment, and order_total modules? That is to say, shipment modules must have X, Y, Z class methods defined, and when each of the methods are called in relation to the process.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,436
    Plugin Contributions
    279

    Default Re: Skeleton of modules?

    Not really.
    Normally there'd be no way to call one of those modules without having first run application_top, which in turn runs the init-system, which loads all the functions files and sets up autoloaders for classes ... so normally they wouldn't run into any missing dependencies.

    Can you give more context?
    .

    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.

  3. #3
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    820
    Plugin Contributions
    9

    Default Re: Skeleton of modules?

    Quote Originally Posted by DrByte View Post
    Not really.
    Normally there'd be no way to call one of those modules without having first run application_top, which in turn runs the init-system, which loads all the functions files and sets up autoloaders for classes ... so normally they wouldn't run into any missing dependencies.

    Can you give more context?
    So there are two modules I want to work on.

    1. An "Expanded Checkout" module for PayPal using the extra functionality provided here. Pretty much the Venmo, Google Pay, Apple Pay integration buttons. This would be the payment module that I wanted to create. I wanted to make sure that I include all of the methods that need to be available to ZenCart for it to be processed. So far I have:

      • $this->update_status
      • $this->javascript_validation
      • $this->selection
      • $this->pre_confirmation_check
      • $this->confirmation
      • $this->process_button
      • $this->before_process
      • $this->after_process
      • $this->get_error
      • $this->check
      • $this->install
      • $this->remove
      • $this->keys

      As the modules' methods for that total.
    2. A Gift Card module that calls into a GiftCard API to obtain a giftcard balance and then presents it for redemption. (Sort of like the innate Gift Certificate voucher module of ZenCart but rather than use the DB, it calls a remote API). (Haven't wrote the frame of this one yet.)

  4. #4
    Join Date
    Jan 2004
    Posts
    66,436
    Plugin Contributions
    279

    Default Re: Skeleton of modules?

    I see, ya, fair question.
    I think I do have a doc somewhere on that. At the very least, all the methods that /includes/classes/payment.php (and shipping.php, order_totals.php) call without an "if method exists" check.
    I'll dig and reply back.

    Aside: something zcwilt was working on for ZC v3 (probably would be in Q2 2026) was a centralized set of classes and contracts (interfaces and traits) for those kinds of core modules:
    https://github.com/zencart/zencart/pull/6620/files
    https://github.com/zencart/documentation/pull/1290
    I might revisit it next month to explore updating it and finishing it off.
    .

    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. v155 Payment Modules Missing from Modules/Payment Modules When I Upgrade
    By greenftechn in forum Built-in Shipping and Payment Modules
    Replies: 12
    Last Post: 23 Dec 2018, 10:57 PM
  2. v155 Admin payment modules page not showing all modules
    By Kennith69 in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 23 Jul 2017, 02:59 AM
  3. Modules/Payments: Modules not 'clickable' !?! What now?
    By hva in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 2 Oct 2008, 08:38 PM
  4. Weird error even with a skeleton
    By quentinjs in forum Templates, Stylesheets, Page Layout
    Replies: 34
    Last Post: 14 Feb 2008, 03:37 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