The Zoho SKU System: A Technical Deep Dive

The entire business logic of the EDGE Store plugin revolves around the structured SKU system managed in Zoho CRM. Understanding this system is critical for any developer working on the codebase.

The logic for decoding these SKUs is located in helpers/helpers-zoho.php within the ZohoHelper class.

SKU Structure

The SKU is a string of characters, typically 10 or more, where each position or group of positions has a specific meaning.

Position (0-indexed)FunctionZohoHelper MethodValues & Meanings
0-3Title CodegetProductCode()A 4-digit code that groups different formats (eBook, print) of the same title.
4CourseBookhasCourseBook()1: CourseBook, 2: Short CourseBook, 0: No
5Textbook / eBookhasTextBook(), hasEbook()1: Textbook (Print), 2: eBook (Digital), 3: Short Textbook (Print), 4: Textbook & eBook Combo (Print)
6Study GuidehasStudyGuide()1: Print, 2: Digital, 0: No
7WorkbookhasWorkBook()1: Print, 2: Digital, 0: No
8Edition / Print CoupongetEdition(), hasPrintCoupon()If Edition: 1: STD, 2: PRO, 3: LTI. If Coupon: A numeric ID for the coupon type.
9USBhasUsb()1: Yes, 0: No

Key Logic: skuHasPrint()

This is one of the most important functions in the plugin. It determines whether a product is physical and therefore requires shipping and triggers the Xero bill creation.

A SKU is considered a “print” product if any of the following are true:

  • It is a Textbook/eBook combo (substr($sku, 5, 1) == 4).
  • It is a print Textbook (substr($sku, 5, 1) == 1 or 3).
  • It is a print Workbook (substr($sku, 7, 1) == 1).
  • It is a print Study Guide (substr($sku, 6, 1) == 1).
  • It has a Print Coupon (substr($sku, 8, 1) > 0).
  • It includes a USB (substr($sku, 9, 1) == 1).
  • It is a Leaflet (str_contains($sku, 'LEAF')).

This logic is central to the order fulfillment and accounting flows.

Practical Example

Let’s decode the SKU 1234141010:

  • 1234: Title Code
  • 1: It is a CourseBook.
  • 4: It is a Textbook & eBook Combo. This automatically flags it as a print product.
  • 1: It includes a print Study Guide.
  • 0: It does not include a Workbook.
  • 1: It is the STD edition.
  • 0: It does not include a USB.

Conclusion: This product is a physical item that includes a CourseBook, a Textbook, an eBook, and a Study Guide. When ordered, it will require shipping and will trigger the creation of a bill in Xero.


Next: 04 - API Endpoints & Cron Jobs