How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]

try this below code in your function.php file or in your plugin add_action(“init”, function () { // removing the woocommerce hook foreach( WC()->cart->get_cart() as $cart_item ){ $product_id = $cart_item[‘product_id’]; if($product_id!=’19’) { remove_action(‘woocommerce_checkout_process’, ‘my_custom_checkout_field_process’); } } });

Woocommerce Shop Price Position

It appears but above the Title and outside the custom div. What am I doing wrong? It’s because woocommerce_template_loop_price() echoes the output. So to fix the problem, just use ?> HTML here <?php instead of echo ‘HTML here’;: function custom_woocommerce_template_loop_product_title() { ?> <div class=”custom-title-wrapper”> <h1 class=”woocommerce-loop-product__title custom-loop-product-title”><?php the_title(); ?></h1> <h2><?php woocommerce_template_loop_price(); ?></h2> </div> <?php } … Read more

Display WooCommerce only in stock sizes product attribute on shop page

To get only available “In stock” displayed sizes, you need something a little more complicated and different: add_action( ‘woocommerce_after_shop_loop_item_title’, ‘display_instock_sizes’, 5 ); function display_instock_sizes() { global $product; if ( $product->is_type(‘variable’) ) { $taxonomy = ‘pa_size’; // The product attribute taxonomy $sizes_array = []; // Initializing // Loop through available variation Ids for the variable product … Read more

Show all author products from specific category

Pass author data to the query. It should be that hard. Author Parameters Show posts associated with certain author. author (int) – use author id. author_name (string) – use ‘user_nicename’ – NOT name. author__in (array) – use author id (available since Version 3.7). author__not_in (array) – use author id (available since Version 3.7). Of course, … Read more

Creating woocommerce product using WordPress REST API

The new api’s documentation can be found here Woocommerce Rest API And you can create a Woocommerce product by posting data to the wp-json endpoint /wp-json/wc/v1/products (Documentation Here) $data = [ ‘name’ => ‘Premium Quality’, ‘type’ => ‘simple’, ‘regular_price’ => ‘21.99’, ‘description’ => ‘Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis … Read more

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