Admin order confirmation email based on shipping cost
Hi,
I have spent most of the day combing through the forums looking for an answer to this question. So far, no dice.
I have a site running Zen-Cart that has been running well for over a year. We sell books, both electronic (which are set up as downloadable products) and print (which add a shipping cost during checkout).
Given that the bulk of our products are downloads, I don't want to receive admin order confirmation emails after each order. However, I don't want to miss the few orders we receive for print books. These books are in specific categories, force the shipping rules during checkout, and each have the word [Print] in the product title.
What I am wondering is how I could set up the system to send out admin order confirmation emails ONLY for print products?
Thank you in advance!
Re: Admin order confirmation email based on shipping cost
The last 20 lines of the order.php class are what send the emails. You could add your own custom conditional logic around the sending of the "additional" emails to guide when it should send or not send.
Re: Admin order confirmation email based on shipping cost
Thanks. I'm not really sure what I'm looking at or how I'd change it.
Re: Admin order confirmation email based on shipping cost
I think I've fiddled around and got it ... but I'm not sure. Have to wait for someone to order something that includes a shipping cost :)
If it works, I'll post the code here. Otherwise, it's back to scratch!
Thanks for all your help!
Re: Admin order confirmation email based on shipping cost
Nope, can't get it to work. At this point I'd pay someone for a snippet of code!
Re: Admin order confirmation email based on shipping cost
I suppose a very simplified way would be to change this line:
Code:
// send additional emails
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
to this:
Code:
if (SEND_EXTRA_ORDER_EMAILS_TO != '' && $this->content_type != 'virtual') {
That way if the cart-contents is "physical" or "mixed" (as opposed to the only other option of "virtual") then the admin emails will be sent.
www.zen-cart.com/donate
Re: Admin order confirmation email based on shipping cost
Woohoo! It worked!
I was trying it based on shipping and that didn't play out.
How much would you like and where should I send it? :)
Re: Admin order confirmation email based on shipping cost
You can send whatever's fair at: www.zen-cart.com/donate
Re: Admin order confirmation email based on shipping cost
Done! Thank you again for all your help!
Re: Admin order confirmation email based on shipping cost
I hate to come back to this after a long time, but is there a way to change this from physical vs virtual products to something else?
I would like to get the emails ONLY if the attributes for the product have a 1 in the free words section. Is this possible?
If not, then I would like to at least suppress emails containing only free products.
Any help would be appreciated. I fiddled with the code but have been unsuccessful because, so far, I'm receiving all emails.
Thanks in advance!