Skip to content

For developers

Filter obs_linkwise_item_payout, meta _linkwise_payout_value and WordPress points where Linkwise plugin adds code.

Applies to v1.3.5 Updated 4 Nov 2026 2 min read Step 12 of 13
v1.3.5 · WooCommerce 5.0+ · PHP 7.4+ Buy Support

Filter for payout#

The obs_linkwise_item_payout accepts the payout price of each line, order line and product. Example for payout 2 in a category:

add_filter('obs_linkwise_item_payout', function ($payout, $item, $product) { if ($product && has_term('therapeies', 'product_cat', $product->get_parent_id() ?: $product->get_id())) { return '2'; } return $payout; }, 10, 3);

The value you return is sent as it is, so you return number in text format with dot.

Product Meta#

  • _linkwise_payout_value: Payout price in product or variant. If missing from variant, read from parent.

Entry points#

HookWhat's he doing?
initWrites or deletes cookie linkwise.
wp_headLoads the tl.js with setProgram and setDecimal.
woocommerce_thankyouPrints the completion code for the order.
woocommerce_integrationsIntegration Registers linkwise_affiliate.

Settings at Foundation#

Settings are stored as WooCommerce input settings (lw_program_id, lw_decimal_separator, lw_posts_per_page, lw_default_vat_rate). The plugin states compatibility with HPOS and reads orders with wc_get_order().

Tests#

ZIP contains light tests (php tests/run-linkwise-tests.php) for VAT, decimals, payout and attribution.

Did this article help you?
It's not solved?

Send a request; the plugin and the article are automatically completed.

Request support