ttremain
Forum Replies Created
-
I accidentally left out a few lines. Sorry…
add_action( 'show_user_profile', 'extra_user_profile_fields' ); add_action( 'edit_user_profile', 'extra_user_profile_fields' ); function extra_user_profile_fields( $user ) { ?> <h3><?php _e("Extra profile information", "blank"); ?></h3> <table class="form-table"> <tr> <th><label for="cc_email"><?php _e("CC Emails"); ?></label></th> <td> <input type="text" name="cc_email" id="cc_email" value="<?php echo esc_attr( get_the_author_meta( 'cc_email', $user->ID ) ); ?>" class="regular-text" /><br /> <span class="description"><?php _e("Any additional email addresses for invoices, separated by commas"); ?></span> </td> </tr> </table> <?php }Being php code, you need to start the file with
<?phpHave you done this?
- This reply was modified 7 years, 7 months ago by ttremain.
Anything you want, with a .php
I’d call it something specific to what it does, like sliced-invoices-mod-for-multiple-email-recipients.php
I might add, that while the user meta field is called cc_email, it technically doesn’t make use of the CC field in the emails. By the time I found a way to add it, I’d already created the cc_email meta field, and didn’t want to change it.
———-
That just gave me an idea. Maybe down the road, I’ll look at a way of intercepting the wp_mail() function, instead of filtering the email field loading the modal.I put it in it’s own file, within wp-content/mu-plugins
#Add a cc_email field in the user editor add_action( 'personal_options_update', 'save_extra_user_profile_fields' ); add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' ); function save_extra_user_profile_fields( $user_id ) { if ( !current_user_can( 'edit_user', $user_id ) ) { return false; } update_user_meta( $user_id, 'cc_email', $_POST['cc_email'] ); } #Lookup cc_email, and at any contents as additional email addresses for sliced. add_filter( 'sliced_get_email_recipient', 'sliced_custom_add_recipient', 10, 3 ); function sliced_custom_add_recipient( $output, $id, $type ) { $cc_email = get_user_meta( sliced_get_client_id(), 'cc_email', true ); if ( $cc_email && ( $type === 'invoice_available' || $type === 'payment_received' ) ) { $output .= ', ' . $cc_email; } return $output; }- This reply was modified 7 years, 7 months ago by ttremain.
Almost. It strips out the commas, so I have to add them back in, but at least I don’t have to stop and lookup the additional address(es) to add.
Forum: Plugins
In reply to: [YITH WooCommerce Quick View] No lightbox in quickviewYour plugin broke a few other things too. It’s already been deleted.
After adding a custom usermeta, cc_email, I’ve done this:
add_filter( 'sliced_get_email_recipient', 'sliced_custom_add_recipient', 10, 3 ); function sliced_custom_add_recipient( $output, $id, $type ) { $cc_email = get_user_meta( sliced_get_client_id(), 'cc_email', true ); if ( $cc_email && ( $type === 'invoice_available' || $type === 'payment_received' ) ) { $output .= ', ' . $cc_email; } return $output; }BUT the filter isn’t working for this, because the function this returns to, strips out the comma and space before the second address.
Please advise
Yes, that gets me almost all the way there.
At the time this filter is run, is the WP_user object or user_ID available for the client we are emailing?
Thank you!
Forum: Plugins
In reply to: [YITH WooCommerce Quick View] No lightbox in quickviewCan there be a way for us to re-enable the product thumbnails, either through a settings option, or code option?
Forum: Plugins
In reply to: [WooCommerce] Trying to capture billing addressIt’s a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to answer that.
Forum: Plugins
In reply to: [WooCommerce] Trying to capture billing addressGee, thank you for the “form” response.
I think I figured it out anyway.
Forum: Plugins
In reply to: [YITH WooCommerce Quick View] No lightbox in quickviewOkay, on a staging environment, all plugins except YITH QV and Woo disabled, and on a twentyseventeen theme.
Image of a product page: image
Same in Quickview: image
Notice the “additional” slider images, are no longer available in the QV.
This is the same thing that would happen if I were to prevent the ‘woocommerce_product_thumbnails’ action from firing.
I just answered my own question. Your plugin runs a:
remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );This hook is the one that generates the thumbnails. Your disabling it is a problem for us.
- This reply was modified 7 years, 8 months ago by ttremain.
Forum: Plugins
In reply to: [YITH WooCommerce Quick View] No lightbox in quickviewMaybe I have the terminology wrong. Before Quick View, the images would come up in a gallery. Now only a single image is shown.
Forum: Plugins
In reply to: [WooCommerce] Capturing the billing address via action or filterI’ve also tried hooking into ‘woocommerce_save_account_details’
and ‘woocommerce_created_customer’ but neither of these seem to fire either.Forum: Plugins
In reply to: [WooCommerce] Capturing the billing address via action or filterbump