Enable Brand Colours Engine for WP Pages Customisations

function rd_client_brand_css_vars_from_tokens(array $tokens): string { $vars = []; foreach ($tokens as $key => $val) { // Convert underscores in PHP keys to hyphens for CSS vars $css_key = str_replace(‘_’, ‘-‘, $key); $vars[] = “–rd-client-{$css_key}: {$val};”; } return implode(”, $vars); }…Continue reading

SHOP – WOO overrides

// ************************************************************************************************* // General woocommerce overrides // ************************************************************************************************* // ————————————————————————————————- // don’t show removed from cart message add_filter( ‘woocommerce_cart_item_removed_notice_type’, ‘__return_false’ ); // ————————————————————————————————- // override standard added to cart message add_filter( ‘wc_add_to_cart_message’, ‘asa_custom_wc_add_to_cart_message’, 10, 2 ); function asa_custom_wc_add_to_cart_message( $message, $product_id…Continue reading

SHOP – PDF Packing Slip

// ————————————————————————————————- // Format player name and division/team // add_action( ‘wpo_wcpdf_after_shipping_address’, ‘add_custom_billing_fields_to_pdf’, 10, 2 ); function add_custom_billing_fields_to_pdf ($document_type, $order) { if ($document_type == ‘packing-slip’) { $billing_playername = ”; $site_title = get_bloginfo(‘name’); if ($site_title == ‘Oakville Raiders’ || $site_title == ‘Seasiders…Continue reading

Woo – Address Format and Defaults

// Reformat Billing/Shipping Address By Country add_filter( ‘woocommerce_localisation_address_formats’, ‘asa_format_address’ ); function asa_format_address( $address ) { $address[‘default’] = “{company}\n{name}\n{address_1}\n{address_2}\n{city} ” . ” ” . ” {state_code} ” . ” ” . ” {postcode}”; $address[‘AU’] = “{company}\n{name}\n{address_1}\n{address_2}\n{city} ” . ” ” . ” {state_code} ”…Continue reading

PDF Packing Slip – footer text

add_action( ‘wpo_wcpdf_after_customer_notes’, ‘wpo_wcpdf_custom_text’, 10, 2 ); function wpo_wcpdf_custom_text ($document_type, $order) { if ($document_type == ‘packing-slip’) { ?>    If you need a return or exchange, or have any concerns about your order, please contact ASA via [email protected]. Please include your…Continue reading

PDF Packing Slip – player – team

add_action( ‘wpo_wcpdf_after_shipping_address’, ‘add_custom_billing_fields_to_pdf’, 10, 2 ); function add_custom_billing_fields_to_pdf ($document_type, $order) { if ($document_type == ‘packing-slip’) { $billing_playername = ”; $site_title = get_bloginfo(‘name’); if ($site_title == ‘Oakville Raiders’ || $site_title == ‘Seasiders Baseball Club’ || $site_title == ‘Peninsula Softball Club’) {…Continue reading

Woo – move order notes to billing section

/** * @snippet Move Order Notes @ WooCommerce Checkout * @how-to businessbloomer.com/woocommerce-customization * @author Rodolfo Melogli, Business Bloomer * @compatible WooCommerce 3.9 * @community https://businessbloomer.com/club/ */ // 1. Hide default notes add_filter( ‘woocommerce_enable_order_notes_field’, ‘__return_false’ ); // 2. Create new billing…Continue reading