/** * 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
add_filter(‘https_ssl_verify’, ‘__return_false’);Continue reading
add_filter( ‘woocommerce_product_add_to_cart_text’, function( $text ) { if ( ‘Read more’ == $text ) { $text = __( ‘Buy Now’, ‘woocommerce’ ); } return $text; } );Continue reading
/** * 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
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. */ 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. */ 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. * * @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
/** * 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