Category : woocommerce

I’m using the following code to create a new custom order status for Woocommerce. The problem I have is that in the admin, the status shows up as unstyled. How can I style the custom status in a similar way to how "Processing" is? /* Adding a new custom order status */ function register_manual_order_status() { ..

Read more

I write function: add_action( ‘woocommerce_order_status_completed’, ‘order_completed’); function order_completed($order_id) { $user_id = $order->get_user_id(); // or $order->get_customer_id(); $order = wc_get_order( $order_id ); $items = $order->get_items(); foreach ( $items as $item ) { $product_name = $item->get_name(); } switch ($product_name) { case ‘FREE’: update_user_meta($user_id, ‘ads-available’, get_user_meta( $user_id, ‘ads-available’, true ) +1 ); break; case ‘VIP’: update_user_meta($user_id, ‘ads-available’, get_user_meta( $user_id, ..

Read more

I have edited the wp_query on the product category page in woocommerce. I want to display pagination manually. But when clicking on next, it redirects to the 2nd page, but instead of products, it goes to the page not found. URL is formed as https:/mysite-name/product-category/category-name/page/2/. I have tried with this format also https:/mysite-name/product-category/category-name/?product-page=2. But it ..

Read more

I have a custom plugin and at some point I use the code below to send an email $mailMessage = "Hello {display_name}, <br /><br /> "; $mailMessage .= ‘some text..’; $mailMessage .= sprintf(‘<br/><a href="%s">text..’,$checkrInvitationURL); $mailMessage = str_replace( ‘{display_name}’, $user_info->display_name, $mailMessage ); self::send_email_to_admin($mailMessage,$candidateEmail); I want to use the same template from Woocommerce and to make this ..

Read more