[DO NOT PUSH] Branding Tokens for WP Pages Customisation

add_filter(‘rd_client_brand_tokens’, function ($t) { return array_merge($t, [ // Colours ‘color_primary’ => ‘#231f20’, ‘color_accent’ => ‘#881721’, ‘color_bg’ => ‘#ffffff’, ‘color_bg_alt’ => ‘#881721’, ‘color_text’ => ‘#231f20’, ‘color_link’ => ‘#231f20’, ‘color_link_hover’ => ‘#881721’, // Fonts ‘font_family’ => ‘Roboto, system-ui, -apple-system, “Segoe UI”, Roboto,…Continue reading

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