How to set default values in Woocommerce checkout? [closed]

Try this code to change the default billing country on the checkout page. add_filter( ‘default_checkout_billing_country’, ‘change_default_checkout_country’ ); function change_default_checkout_country() { return ‘US’; // country code } To change default shipping country on the checkout page function change_set_checkout_field_input_value_default($fields) { $fields[‘shipping’][‘shipping_country’][‘default’] = ‘Australia’; return $fields; } add_filter( ‘woocommerce_checkout_fields’, ‘change_set_checkout_field_input_value_default’ );

Custom page for WooCommerce’s /product-category/

product-category URL uses taxonomy-product-cat.php which calls archive-product.php you will need to override it by creating the same file with the same name in themefolder/woocommerce/archive-product.php You can open any file in templates folder in the WooCommerce plugin and you will find a line in the very top comment describes how to override the file. Don’t forget … Read more

Problem adding column to WC Subscription [closed]

Alright, so since WC Subscriptions is creating it’s own array for columns. Any filter priority lesser than their function will simply make your code non-functional. So what I did is I changed priority from 10 to 1000 so that my codes fire after their code. add_filter( ‘manage_shop_subscription_posts_columns’, function ($columns) { $columns[‘my_field’] = __(‘My Field’); return … Read more

Woocommerce include custom stylesheet after woocommerce styling [closed]

wp_enqueue_style supports dependencies. So, if you make the WooCommerce style a dependency for your new stylesheet then your stylesheet will always load after the WooCommerce stylesheet. Something like this ought to work, but it is untested: function enqueue_style_after_wc(){ $deps = class_exists( ‘WooCommerce’ ) ? array( ‘woocommerce-layout’, ‘woocommerce-smallscreen’, ‘woocommerce-general’ ) : array(); wp_enqueue_style( ‘my-style’, ‘my-style.css’, $deps, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)