Skip to content

Developer notes

Overview · Installation · Configuration · Usage · FAQ

Technical reference for developers who customize One Step Checkout.

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

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.

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.php points the items_function of the four field blocks to the add-on, which calls fn_blocks_get_lite_checkout_profile_fields() with an adjusted item_ids and then sets checkout_required and wrapper_class.
  • The get_profile_fields hook applies the same rules to location O, the list core uses on the server.
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).

None in 1.0.0.

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.

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.

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.

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 page
var/themes_repository/responsive/templates/addons/kv_one_step_checkout/ storefront
js/addons/kv_one_step_checkout/ func.js (storefront), admin.js

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