Customer details
-
Using this plugin we find two issues.
1. The receiver of the cryptocurrency does not know who placed the order so no way to reference.
2. The sender does not receive any confirmation of order.
-
1. Who placed the order? Doesn’t WooCommerce note that down for you?
2. When? You mean when the order is completed? Depends on your e-commerce system, I’d say.
1. Yes, Woocommerce does make note of that in the backend of the website. I was just thinking that your plugin would also send the customer info to the retailer.
2. It is Woocommerce – and you’re right…it won’t email while the order is pending. The site owner gets a notification in his crypto site that a payment has been made, but he doesn’t know who’s it’s from until the order moves from the pending status…which could take hours….makes for some confusion, especially when hundreds of orders arrive and all in pending status.
The only solution then I guess is for the site owner to log into WP and check the orders in Woocommerce when he receives a notification from his wallet?
Abe
It almost sounds like #1 and #2 could be solved if the WC were able to send order confirmation e-mails both when placing the order AND when the payment status changes?
The buyer should be receiving an order confirmation e-mail, so it’s just a matter of cc:ing the admin, eh?
What would really help would be a reference to the WC function that sends the order confirmation, that way we could add an option in MCC so send the confirmation to the admin during purchase and payment.
That would be really helpful for sure. However, I have no idea how to find a reference to the WC function that sends the order confirmation. Any thoughts on that?
I have zero knowledge of pho, but I did find this…do you think this might help?
It sure looks like it could.
I don’t suppose you could help test that piece of code for me? If it does what you want, then we could figure out a way to add it as an option to WC.
Like I said, my knowledge of php is abysmal lol.
Using their example, could you re-do and insert the email address [email protected] in the code for me and then I will test it 🙂
I tried this:
// New order notification only for “Pending” Order status
add_action( ‘woocommerce_new_order’, ‘pending_new_order_notification’, 20, 1 );
function pending_new_order_notification( $order_id ) {
// Get an instance of the WC_Order object
$order = wc_get_order( $order_id );// Only for “pending” order status
if( ! $order->has_status( ‘pending’ ) ) return;// Get an instance of the WC_Email_New_Order object
$wc_email = WC()->mailer()->get_emails()[‘WC_Email_New_Order’];## — Customizing Heading, subject (and optionally add recipients) — ##
// Change Subject
$wc_email->settings[‘subject’] = __(‘{site_title} – New customer Pending order ({order_number}) – {order_date}’);
// Change Heading
$wc_email->settings[‘heading’] = __(‘New customer Pending Order’);
$wc_email->settings[‘recipient’] .= ‘,[email protected], [email protected]’;Send “New Email” notification (to admin)
$wc_email->trigger( $order_id );
}BUT I received the following error:
Your PHP code changes were rolled back due to an error on line 198 of file wp-content/themes/ikoin/functions.php. Please fix and try saving again.
syntax error, unexpected ‘”New Email”‘ (T_CONSTANT_ENCAPSED_STRING)
FYI – Lime 198 = Send “New Email” notification (to admin)
-
This reply was modified 8 years, 1 month ago by
Abe.
Remove “Send “New Email” notification (to admin)”
Or // comment it out.
I now get this error when trying to go to my product:
Warning: Cannot modify header information – headers already sent by (output started at /home/ikoin889/public_html/wp-content/themes/ikoin/functions.php:202) in /home/ikoin889/public_html/wp-includes/pluggable.php on line 1216
You probably have newlines at the end of that file.
You can remove the ending ? > line and you should be fine after that.
nope….
this is my functions.php file now:
<?php
add_action( ‘wp_enqueue_scripts’, ‘my_enqueue_assets’ );
function my_enqueue_assets() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
}
function my_added_social_icons($kkoptions) {
global $themename, $shortname;$open_social_new_tab = array( “name” =>esc_html__( “Open Social URLs in New Tab”, $themename ),
“id” => $shortname . “_show_in_newtab”,
“type” => “checkbox”,
“std” => “off”,
“desc” =>esc_html__( “Set to ON to have social URLs open in new tab. “, $themename ) );$replace_array_newtab = array ( $open_social_new_tab );
$show_instagram_icon = array( “name” =>esc_html__( “Show Instagram Icon”, $themename ),
“id” => $shortname . “_show_instagram_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Instagram Icon on your header or footer. “, $themename ) );
$show_pinterest_icon = array( “name” =>esc_html__( “Show Pinterest Icon”, $themename ),
“id” => $shortname . “_show_pinterest_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Pinterest Icon on your header or footer. “, $themename ) );
$show_tumblr_icon = array( “name” =>esc_html__( “Show Tumblr Icon”, $themename ),
“id” => $shortname . “_show_tumblr_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Tumblr Icon on your header or footer. “, $themename ) );
$show_dribbble_icon = array( “name” =>esc_html__( “Show Dribbble Icon”, $themename ),
“id” => $shortname . “_show_dribbble_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Dribbble Icon on your header or footer. “, $themename ) );
$show_vimeo_icon = array( “name” =>esc_html__( “Show Vimeo Icon”, $themename ),
“id” => $shortname . “_show_vimeo_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Vimeo Icon on your header or footer. “, $themename ) );
$show_linkedin_icon = array( “name” =>esc_html__( “Show LinkedIn Icon”, $themename ),
“id” => $shortname . “_show_linkedin_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the LinkedIn Icon on your header or footer. “, $themename ) );
$show_myspace_icon = array( “name” =>esc_html__( “Show MySpace Icon”, $themename ),
“id” => $shortname . “_show_myspace_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the MySpace Icon on your header or footer. “, $themename ) );
$show_skype_icon = array( “name” =>esc_html__( “Show Skype Icon”, $themename ),
“id” => $shortname . “_show_skype_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Skype Icon on your header or footer. “, $themename ) );
$show_youtube_icon = array( “name” =>esc_html__( “Show Youtube Icon”, $themename ),
“id” => $shortname . “_show_youtube_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Youtube Icon on your header or footer. “, $themename ) );
$show_flickr_icon = array( “name” =>esc_html__( “Show Flickr Icon”, $themename ),
“id” => $shortname . “_show_flickr_icon”,
“type” => “checkbox2”,
“std” => “on”,
“desc” =>esc_html__( “Here you can choose to display the Flickr Icon on your header or footer. “, $themename ) );$repl_array_opt = array( $show_instagram_icon,
$show_pinterest_icon,
$show_tumblr_icon,
$show_dribbble_icon,
$show_vimeo_icon,
$show_linkedin_icon,
$show_myspace_icon,
$show_skype_icon,
$show_youtube_icon,
$show_flickr_icon,
);$show_instagram_url =array( “name” =>esc_html__( “Instagram Profile Url”, $themename ),
“id” => $shortname . “_instagram_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Instagram Profile. “, $themename ) );
$show_pinterest_url =array( “name” =>esc_html__( “Pinterest Profile Url”, $themename ),
“id” => $shortname . “_pinterest_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Pinterest Profile. “, $themename ) );
$show_tumblr_url =array( “name” =>esc_html__( “Tumblr Profile Url”, $themename ),
“id” => $shortname . “_tumblr_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Tumblr Profile. “, $themename ) );
$show_dribble_url =array( “name” =>esc_html__( “Dribbble Profile Url”, $themename ),
“id” => $shortname . “_dribble_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Dribbble Profile. “, $themename ) );
$show_vimeo_url =array( “name” =>esc_html__( “Vimeo Profile Url”, $themename ),
“id” => $shortname . “_vimeo_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Vimeo Profile. “, $themename ) );
$show_linkedin_url =array( “name” =>esc_html__( “LinkedIn Profile Url”, $themename ),
“id” => $shortname . “_linkedin_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your LinkedIn Profile. “, $themename ) );
$show_myspace_url =array( “name” =>esc_html__( “MySpace Profile Url”, $themename ),
“id” => $shortname . “_mysapce_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your MySpace Profile. “, $themename ) );
$show_skype_url =array( “name” =>esc_html__( “Skype Profile Url”, $themename ),
“id” => $shortname . “_skype_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Skype Profile. “, $themename ) );
$show_youtube_url =array( “name” =>esc_html__( “Youtube Profile Url”, $themename ),
“id” => $shortname . “_youtube_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Youtube Profile. “, $themename ) );
$show_flickr_url =array( “name” =>esc_html__( “Flickr Profile Url”, $themename ),
“id” => $shortname . “_flickr_url”,
“std” => “#”,
“type” => “text”,
“validation_type” => “url”,
“desc” =>esc_html__( “Enter the URL of your Flickr Profile. “, $themename ) );$repl_array_url = array( $show_instagram_url,
$show_pinterest_url,
$show_tumblr_url,
$show_dribble_url,
$show_vimeo_url,
$show_linkedin_url,
$show_myspace_url,
$show_skype_url,
$show_youtube_url,
$show_flickr_url,
);$srch_key = array_column($kkoptions, ‘id’);
$key = array_search(‘divi_show_facebook_icon’, $srch_key);
array_splice($kkoptions, $key + 6, 0, $replace_array_newtab);$key = array_search(‘divi_show_google_icon’, $srch_key);
array_splice($kkoptions, $key + 8, 0, $repl_array_opt);$key = array_search(‘divi_rss_url’, $srch_key);
array_splice($kkoptions, $key + 17, 0, $repl_array_url);//print_r($kkoptions);
return $kkoptions;
}
add_filter(‘et_epanel_layout_data’, ‘my_added_social_icons’, 99);define( ‘DDPL_DOMAIN’, ‘my-domain’ ); // translation domain
require_once( ‘vendor/divi-disable-premade-layouts/divi-disable-premade-layouts.php’ );// New order notification only for “Pending” Order status
add_action( ‘woocommerce_new_order’, ‘pending_new_order_notification’, 20, 1 );
function pending_new_order_notification( $order_id ) {
// Get an instance of the WC_Order object
$order = wc_get_order( $order_id );// Only for “pending” order status
if( ! $order->has_status( ‘pending’ ) ) return;// Get an instance of the WC_Email_New_Order object
$wc_email = WC()->mailer()->get_emails()[‘WC_Email_New_Order’];## — Customizing Heading, subject (and optionally add recipients) — ##
// Change Subject
$wc_email->settings[‘subject’] = __(‘{site_title} – New customer Pending order ({order_number}) – {order_date}’);
// Change Heading
$wc_email->settings[‘heading’] = __(‘New customer Pending Order’);
// $wc_email->settings[‘recipient’] .= ‘,[email protected], [email protected]’; // Add email recipients (coma separated)// Send “New Email” notification (to admin)
$wc_email->trigger( $order_id );
}
// New order notification only for “Pending” Order status
add_action( ‘woocommerce_new_order’, ‘pending_new_order_notification’, 20, 1 );
function pending_new_order_notification( $order_id ) {
// Get an instance of the WC_Order object
$order = wc_get_order( $order_id );// Only for “pending” order status
if( ! $order->has_status( ‘pending’ ) ) return;// Get an instance of the WC_Email_New_Order object
$wc_email = WC()->mailer()->get_emails()[‘WC_Email_New_Order’];## — Customizing Heading, subject (and optionally add recipients) — ##
// Change Subject
$wc_email->settings[‘subject’] = __(‘{site_title} – New customer Pending order ({order_number}) – {order_date}’);
// Change Heading
$wc_email->settings[‘heading’] = __(‘New customer Pending Order’);
// $wc_email->settings[‘recipient’] .= ‘[email protected], [email protected]’; // Add email recipients (coma separated)// Send “New Email” notification (to admin)
$wc_email->trigger( $order_id );
}I still cannot load the product page and the editor shows:
Your PHP code changes were rolled back due to an error on line 222 of file wp-content/themes/ikoin/functions.php. Please fix and try saving again.Cannot redeclare pending_new_order_notification() (previously declared in wp-content/themes/ikoin/functions.php:181)
I removed the code:
// New order notification only for “Pending” Order status
add_action( ‘woocommerce_new_order’, ‘pending_new_order_notification’, 20, 1 );
function pending_new_order_notification( $order_id ) {
// Get an instance of the WC_Order object
$order = wc_get_order( $order_id );// Only for “pending” order status
if( ! $order->has_status( ‘pending’ ) ) return;// Get an instance of the WC_Email_New_Order object
$wc_email = WC()->mailer()->get_emails()[‘WC_Email_New_Order’];## — Customizing Heading, subject (and optionally add recipients) — ##
// Change Subject
$wc_email->settings[‘subject’] = __(‘{site_title} – New customer Pending order ({order_number}) – {order_date}’);
// Change Heading
$wc_email->settings[‘heading’] = __(‘New customer Pending Order’);
// $wc_email->settings[‘recipient’] .= ‘[email protected], [email protected]‘; // Add email recipients (coma separated)// Send “New Email” notification (to admin)
$wc_email->trigger( $order_id );
}My product page is loading fine now. But problem still not solved lol
This is getting a bit messy for the support forum. Perhaps if you e-mail me your functions.php I can clean it up?
sent – thanks Edward 🙂
sorry Edward – I just noticed this still in my drafts folder. It has now been sent.
-
This reply was modified 8 years, 1 month ago by
The topic ‘Customer details’ is closed to new replies.