Variants and key normalization

mamba_variant_currency
Override the detected currency in variant signatures (applies to both page and API).

add_filter('mamba_variant_currency', function ($currency) {
    return isset($_GET['currency']) ? sanitize_key($_GET['currency']) : $currency;
});

mamba_variant_lang
Override the detected language in variant signatures (applies to both page and API).

add_filter('mamba_variant_lang', function ($lang) {
    return isset($_GET['lang']) ? sanitize_key($_GET['lang']) : $lang;
});

mamba_variant_country
Override the detected country (2-letter code) when geolocation affects pricing or tax.

add_filter('mamba_variant_country', function ($country) {
    return isset($_GET['country']) ? strtoupper(sanitize_key($_GET['country'])) : $country;
});

Copyright 2025 - Mamba


Mamba mascot