KlarnaOSMHelper
in package
Table of Contents
- getCartTotalAmount() : float
- Returns current cart total, i. e. whatever ot_total’s value is
- getStoreCountry() : string
- Returns 2-character ISO code for store country
- isModuleInstalledAndActive() : bool
- Returns true if KlarnaOSM module is installed and active.
- setSnippetLocale() : string
- Modifies an OSM snippet’s locale attribute to match current customer’s country and language.
- setSnippetPurchaseAmount() : string
- Modifies an OSM snippet’s purchase-amount attribute to match the cart total, optionally adding an amount.
Methods
getCartTotalAmount()
Returns current cart total, i. e. whatever ot_total’s value is
public
static getCartTotalAmount() : float
Return values
float —getStoreCountry()
Returns 2-character ISO code for store country
public
static getStoreCountry() : string
Return values
string —isModuleInstalledAndActive()
Returns true if KlarnaOSM module is installed and active.
public
static isModuleInstalledAndActive() : bool
Return values
bool —setSnippetLocale()
Modifies an OSM snippet’s locale attribute to match current customer’s country and language.
public
static setSnippetLocale(string $snippet) : string
Parameters
- $snippet : string
Return values
string —setSnippetPurchaseAmount()
Modifies an OSM snippet’s purchase-amount attribute to match the cart total, optionally adding an amount.
public
static setSnippetPurchaseAmount(string $snippet, float $additionalAmount) : string
The $additionalAmount is used on product pages to add that product’s price.
Parameters
- $snippet : string
- $additionalAmount : float