Buy Now Button – Variation

add_filter( ‘gettext’, ‘customizing_product_variation_message’, 10, 3 ); function customizing_product_variation_message( $translated_text, $untranslated_text, $domain ) { if ($untranslated_text == ‘Select options’) { $translated_text = __( ‘Buy Now’, $domain ); } if ($untranslated_text == ‘Select options’) { $translated_text = __( ‘Buy Now’, $domain );…Continue reading

Continue Shopping Button

/** * Add Continue Shopping Button on Cart Page * Add to theme functions.php file or Code Snippets plugin */ add_action( ‘woocommerce_before_cart_table’, ‘woo_add_continue_shopping_button_to_cart’ ); function woo_add_continue_shopping_button_to_cart() { $shop_page_url = get_permalink( woocommerce_get_page_id( ‘shop’ ) ); echo ‘ ‘; echo ‘ Continue…Continue reading

product data tabs

/** * Rename product data tabs */ add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tabs’, 98 ); function woo_rename_tabs( $tabs ) { $tabs[‘additional_information’][‘title’] = __( ‘Product Info’ ); // Rename the additional information tab return $tabs; }Continue reading

Product tabs

/** * Add a custom product data tab */ add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs[‘test_tab’] = array( ‘title’ => __( ‘Shipping Info’, ‘woocommerce’ ), ‘priority’ => 50, ‘callback’ => ‘woo_new_product_tab_content’ );…Continue reading

Hide product categories

add_filter( ‘get_terms’, ‘ts_get_subcategory_terms’, 10, 3 ); function ts_get_subcategory_terms( $terms, $taxonomies, $args ) { $new_terms = array(); if ( in_array( ‘product_cat’, $taxonomies ) && ! is_admin() &&is_shop() ) { foreach( $terms as $key => $term ) { if ( !in_array( $term->slug,…Continue reading

Disallow point redemption if cart has subscription product.

/** * Disallow point redemption if cart has subscription product. */ add_filter(‘lpfw_checkout_show_redeem_form’, function($value) { // check if cart has subscription product $cart = WC()->cart->get_cart_contents(); foreach ( $cart as $cart_item ) { $product = $cart_item[‘data’]; // disallow store credits if cart…Continue reading

Disallow store credits if cart has subscription product

/** * Disallow store credits if cart has subscription product. */ add_filter(‘acfw_is_allow_store_credits’, function($value) { // check if cart has subscription product $cart = WC()->cart->get_cart_contents(); foreach ( $cart as $cart_item ) { $product = $cart_item[‘data’]; // disallow store credits if cart…Continue reading

Generate a virtual coupon when order is completed.

/** * Generate a virtual coupon when order is completed. * * @param int $order_id Order ID. */ function acfwp_create_virtual_coupon( $order_id ) { $order = wc_get_order( $order_id ); $customer_id = $order->get_customer_id(); $create_date = date( ‘Y-m-d H:i:s’, current_time(‘timestamp’)); $expire_date = date(…Continue reading