sigmakicks
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] how to make order details email sent automaticallyso after digging through internet, i found that ‘woocommerce_order_status_pending’ is not triggered and ‘woocommerce_new_order’ doesnt have order details object. i tried using ‘woocommerce_checkout_update_order_meta’ and call the custom function and it sent the email without any order details missing.
reference: php – WooCommerce order status hook not triggering – Stack OverflowForum: Plugins
In reply to: [WooCommerce] how to make order details email sent automaticallyso i tried to solve this through custom code and call https://woocommerce.github.io/code-reference/classes/WC-Email-Customer-Invoice.html class. the email get sent but it missed some details like product detail, shipping method, and shipping address. is there something that i’ve been missing in my code?
here is the email that has been sent by my custom code https://ibb.co.com/SrbQCr5, and here is the email that has been sent manually through edit order page https://ibb.co.com/Chpg1t2. here is my code
function send_custom_order_details_email($order_id) {
if (!$order_id) {
return;
}
// Log for debugging
error_log('Attempting to send order details email. Order ID: ' . $order_id);
// Get the order object
$order = wc_get_order($order_id);
if (!$order) {
error_log('Failed to get order object for Order ID: ' . $order_id);
return;
}
// Initialize WooCommerce emails
$mailer = WC()->mailer();
// Get the "Customer Processing Order" email template
$email = $mailer->get_emails()['WC_Email_Customer_Invoice'];
if (!$email) {
error_log('Failed to get Customer Processing Order email template');
return;
}
// Trigger the email
$email->trigger($order_id);
// Log after sending email
error_log('Order details email sent for Order ID: ' . $order_id);
}
// Hook into WooCommerce order status changed to 'pending'
add_action('woocommerce_order_status_pending', 'send_custom_order_details_email', 10, 1);
// Hook into WooCommerce order creation
add_action('woocommerce_new_order', 'send_custom_order_details_email', 10, 1);Forum: Plugins
In reply to: [WooCommerce] how to make order details email sent automaticallyorder detail emails are not sent automatically and have to be sent manually. -> “You send this email manually from the “Edit Order” screen to?share invoice details and a payment link?with customers” (https://woocommerce.com/wp-content/uploads/2024/05/woocommerce-email-notifications_ea0bea.png?strip=all&w=704)
is there a way to make it automatically sent without using any plugin?I dont know if this is related but free version causing bug stopping multiple core wordpress functions. When this plugin is activated, it interrupted wp json api causing 500 internal server error. This affects multiple functions such as Jetpack, Customers table and Coupons from WooCommerce, and many more.
Forum: Plugins
In reply to: [WooCommerce] product variations imported but not shownThank you so much for your guidance. I havent tried that yet and figured out (probably) that editing in Excel caused the problem. I tried to process every data from Google Sheets and never opened it in Excel, and it works without setting the inventory.
Forum: Plugins
In reply to: [WooCommerce] product variations imported but not shownHello, I have changed the permissions of both files to be editable by guests.