Author - keymaster

Add prices next to WooCommerce variations

I will show you how you can add prices next to WooCommerce variations in your online store just by adding a short snippet to your themes functions.php file. // Add the prices next to the variations in WooCommerce function aws_multi_display_price_in_variation_option_name( $term_name ) { global $wpdb, $product; if ( is_product() && $product instanceof WC_Product && $product->is_type( 'variable' ) ) { foreach ( $product->get_available_variations() as $variation [...]


Update postmeta as array

Update postmeta as array is poorly documented but using our code as below makes it simple to create a simple post meta that stores multiple values as an array. // Values from my form which contains multiple productIDs and values for each productIDs postmeta. Posted as multiple arrays in one operation. $message_specific = isset( $_POST['message_specific'] ) ? $_POST['message_specific'] : ''; if ( is_array( $message_specific ) ) { // Checking if array foreach( $message_specific as $keys => $value ) { $parts = explode( '|', $keys [...]