Developer notes
Overview · Installation · Configuration · Usage · FAQ
Technical reference for developers who customize One Step Checkout.
Add-on identity
Section titled “Add-on identity”| Item | Value |
|---|---|
| Add-on id | kv_one_step_checkout |
| Function prefix | fn_kv_one_step_checkout_ |
| Language variables | kv_one_step_checkout.* |
| CSS scope | html[data-kv-osc], classes kv-osc-* |
| PHP namespace | Tygh\Addons\KvOneStepCheckout |
How the page is built
Section titled “How the page is built”The Checkout location of the Block Manager stays as it is. While the form grid (wrapper blocks/grid_wrappers/lite_checkout.tpl)
renders, render_block_post collects each block’s output by block type. Arranger sorts the blocks into columns and assigns the view
variable kv_osc_arranged. The add-on’s override of the grid wrapper prints that variable and otherwise $content, so with the add-on
off or unlicensed the page prints exactly what the core prints. The override differs from the core file in that one line.
Nothing moves out of the form, so $.ceLiteCheckout, payment templates and block settings work unchanged.
Field rules
Section titled “Field rules”Rules live in ?:kv_osc_fields and are applied at run time, never written to ?:profile_fields or to block content:
schemas/block_manager/blocks.post.phppoints theitems_functionof the four field blocks to the add-on, which callsfn_blocks_get_lite_checkout_profile_fields()with an adjusteditem_idsand then setscheckout_requiredandwrapper_class.- The
get_profile_fieldshook applies the same rules to locationO, the list core uses on the server.
Hooks used
Section titled “Hooks used”| Hook | Use |
|---|---|
render_blocks, render_block_post |
Collect the form blocks |
get_profile_fields |
Field rules on the server side |
checkout_update_steps_pre |
An empty note sent by the page clears $cart['notes'] |
Template index:html_tag.post |
data-kv-osc and data-kv-osc-config on the html tag |
Template index:scripts.post, index:styles.post |
Script (checkout page only) and styles |
Template block_checkout:cart_items.override |
Grouped lines, Multi-Vendor orders with several vendors |
Template block_checkout:product_extra.post |
Quantity buttons |
Controllers: frontend/checkout.pre.php (reads ?kv_osc= and a payment_id in the URL), frontend/checkout.post.php (view
data), frontend/kv_one_step_checkout.php (POST qty), backend/kv_one_step_checkout.php (admin page).
Hooks provided
Section titled “Hooks provided”None in 1.0.0.
Database tables
Section titled “Database tables”| Table | Content |
|---|---|
?:kv_osc_fields |
company_id, field_id, visibility, required, width, position |
?:kv_osc_blocks |
company_id, block_type, col, position |
?:kv_osc_payments |
company_id, payment_id: methods that use the standard page |
company_id is the storefront on Ultimate (0 = all storefronts) and 0 on Multi-Vendor.
Mode::isOneStep() is true for checkout requests when the add-on is on and licensed, and none of these applies: the customer asked for
the standard page (?kv_osc=standard, stored in the session), Preview mode without the preview flag, or a selected payment method
in ?:kv_osc_payments. ?kv_osc=one_step removes the customer’s choice.
Full page cache (CS-Cart 4.21)
Section titled “Full page cache (CS-Cart 4.21)”The checkout page is not cacheable and the add-on prints its attributes only on checkout.checkout. The styles are static. Other
pages get no add-on output.
Template overrides
Section titled “Template overrides”Storefront templates live in design/themes/<theme>/templates/addons/kv_one_step_checkout/. To customize one, copy it to your own
theme’s folder; do not edit the add-on’s files, they are replaced on update. A theme or add-on that replaces
blocks/grid_wrappers/lite_checkout.tpl must print {$kv_osc_arranged nofilter} when it is set.
File map
Section titled “File map”app/addons/kv_one_step_checkout/ Tygh/Addons/KvOneStepCheckout/ Config, Mode, Blocks, Arranger, Fields, Admin, License/, Upgrade/ controllers/ schemas/design/backend/templates/addons/kv_one_step_checkout/ admin pagevar/themes_repository/responsive/templates/addons/kv_one_step_checkout/ storefrontjs/addons/kv_one_step_checkout/ func.js (storefront), admin.jsLicense check
Section titled “License check”License\Client checks the license once a day from the admin panel, never on a storefront request. Storefront code reads the stored
state through Config::isOn().