Category: eCommerce
Force “Become a Vendor” to always go to /my-account/become-a-vendor/
/** * Force “Become a Vendor” to always go to * /my-account/become-a-vendor/ * * Applies to BOTH Free and Pro versions. * Only affects users who are NOT vendor or pending-vendor. */ function custom_become_vendor_url_override( $url, $endpoint, $value, $permalink ) {…Continue reading
RewardsWP — My Account Rewards Tab
/** * Plugin Name: RewardsWP — My Account Rewards Tab * Description: Adds a “My Rewards” tab to WooCommerce My Account that opens the rewards widget. * Version: 1.0.0 * Author: AffiliateWP */ if ( ! defined( ‘ABSPATH’ ) )…Continue reading
Remove the coupon section for orders that did not use any coupon.
add_action( ‘woocommerce_email_before_order_table’, ‘conditionally_remove_coupon_section_from_email’, 5, 4 ); function conditionally_remove_coupon_section_from_email( $order, $sent_to_admin, $plain_text, $email ) { if ( ! $order instanceof WC_Order ) { return; } // Get applied coupons $coupons = $order->get_coupon_codes(); // If NO coupons were used, remove the coupon…Continue reading
Membership Details Table Override
/** * Membership Details Table Override * * Child Theme: Storefront-Child-Theme * WC Vendors Membership Template * * Hides certain rows for free plans while keeping table formatting. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; // Exit…Continue reading
Paystack Split Payments Integration with WC Vendors — Creating the Split Configuration
public function process_split_payment( $order ) { $vendors_due = WCV_Vendors::get_vendor_dues_from_order( $order, false ); $sub_accounts = array(); foreach ( $vendors_due as $vendor_id => $products ) { $_vendor_account = get_user_meta( $vendor_id, ‘_paystack_sub_account_code’, true ); $sub_accounts[] = array( ‘subaccount’ => $_vendor_account, ‘share’ => $calculated_share,…Continue reading
[Not sure if still required] WP Overnight IPs: Modify the interval for the cleanup of the semaphore locks
function wpo_ips_semaphore_lock_cleanup_interval() { return 7 * DAY_IN_SECONDS; // Modify the interval here. } add_filter( ‘wpo_ips_semaphore_lock_cleanup_interval’, ‘wpo_ips_semaphore_lock_cleanup_interval’ );Continue reading
[No longer required?] Fix Missing Stripe Credit Card Fields Padding
function deletetransientsfromwc() { delete_transient( ‘wc_stripe_appearance’ ); delete_transient( ‘wc_stripe_blocks_appearance’ ); } add_action( ‘template_redirect’, ‘deletetransientsfromwc’ ); add_filter( ‘wc_stripe_upe_params’, function ( $stripe_params ) { $stripe_params[‘appearance’] = (object) [ ‘rules’ => (object) [ ‘.Input’ => (object) [ ‘padding’ => ’10px’, ] ], ]; return…Continue reading
Untitled Snippet
Auto-Link WooCommerce Modern Template Email Header Image to Site URL
if ( ! function_exists( ‘WC’ ) ) { return; } function rd_wrap_header_image_with_link( $message ) { if ( ! is_string( $message ) ) { return $message; } $home = home_url( ‘/’ ); // Support both normal HTML and quoted-printable HTML. $markers…Continue reading