Woocommerce: Extra added country field not taking value from database

Unless I’m missing something, you’re collecting the data through the post, validating it, and storing it, but I’m not seeing how you intended to display the billing_country in the checkout template. Since the billing_country data is stored in the user meta, you could display it in your checkout template using get_user_meta: <?php $billingCountry = get_user_meta($customer_id, … Read more

Override function

Here is the code for overriding price of product in cart add_action( ‘woocommerce_before_calculate_totals’, ‘add_custom_price’ ); function add_custom_price( $cart_object ) { $custom_price = 10; // This will be your custome price foreach ( $cart_object->cart_contents as $key => $value ) { $value[‘data’]->price = $custom_price; } }

How to override email text New Customer Order?

The easiest way to override the WooCommerce emails is to copy woocommerce/templates/emails/admin-new-order.php to yourtheme/woocommerce/emails/admin-new-order.php and make any changes in your version of the template. This will ensure that any changes you make do not get lost during any subsequent upgrades. The text displayed in the subject line of the email is controlled via the GUI … Read more

Create custom add to cart in WordPress

Use woocommerce_add_cart_item_data and woocommerce_add_order_item_meta filters. Wrap all your input fields inside product form( I assume that those tabs are made with javascript so there is no need of reloading the page for each one’s content) and set that form’s action to add to cart url Use this in your custom template $product = get_product(77); echo … Read more