wpdwc_buy_now_button_link

10 seconds

Filter to change the “Buy Now” button link that gets added to shortcodes via the WooConnect add-on

Example code

/** Function to change the Connect for WooCommerce 'buy now' button link */
function acme_buy_now_link( $newbuybtn ) {
    $newbuybtn = '<a href="'. get_permalink() .'" class="button wpd-connect-btn buy-now">Buy Now</a>';
    return $newbuybtn;
}
add_filter( 'wpdwc_buy_now_button_link', 'acme_buy_now_link' );

File location:

/wpd-wooconnect/admin/class-wpd-wooconnect-admin.php

Was this article helpful?