Category: eCommerce
Untitled Snippet
if (function_exists(‘asl_display’)) { echo do_shortcode(‘[ajax_search_form]’); }Continue reading
connect site to google
Notify if Stripe is put in Test Mode
add_action(‘update_option_woocommerce_stripe_settings’, function($old_value, $value, $option) { if (!isset($old_value[‘testmode’]) || !isset($value[‘testmode’])) { return; } if ($old_value[‘testmode’] === $value[‘testmode’]) { return; } $optionName = ‘woocommerce_stripe_testmode_log’; $entry = [ ‘time’ => current_time(‘mysql’), ‘uri’ => $_SERVER[‘REQUEST_URI’] ?? ”, ‘hook’ => current_filter(), ‘old’ => $old_value[‘testmode’], ‘new’…Continue reading
Untitled Snippet
hkosnip
// index.php?name=david echo $_GET[‘name’]; // index.php?name=david&surname=adams echo $_GET[‘surname’];Continue reading
Move Admin “Add Note” Above Order/Subscription Notes History
add_action( ‘admin_head’, function () { // Bail if WooCommerce isn’t active. if ( ! class_exists( ‘WooCommerce’ ) ) { return; } if ( ! function_exists( ‘get_current_screen’ ) ) { return; } $screen = get_current_screen(); // Legacy order/subscription edit. $is_legacy_order_screen =…Continue reading
Test New
Add products column to the orders list on the Vendor Dashboard
/** * Add the product column to the order table. * * @param array $columns The columns. * * @return array The modified columns. */ add_filter( ‘wcv_order_table_columns’, ‘wcv_add_product_column_table_columns’ ); /** * Add the product column to the order table. *…Continue reading
Show the products column on the WooCommerce orders list
// legacy – for CPT-based orders add_filter( ‘manage_edit-shop_order_columns’, ‘misha_order_items_column’ ); // for HPOS-based orders add_filter( ‘manage_woocommerce_page_wc-orders_columns’, ‘misha_order_items_column’ ); function misha_order_items_column( $columns ) { // let’s add our column before “Total” $columns = array_slice( $columns, 0, 4, true ) // 4…Continue reading