If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / Need urgent help- to inc order atrib in email subject line

Need urgent help- to inc order atrib in email subject line

Locked

Started by oavs on 12 Sep 2008, 12:33 AM · Views: 4,079

Results 1 to 20 of 49
This thread is locked. New replies are disabled.
12 Sep 2008, 12:33 AM
#1
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Need urgent help- to inc order atrib in email subject line

Hi

I need to know find out how this can be done please.

I have two options when customer is choosing their options during order.

  1. Images can be uploaded using their own images <Uploaded image>.
    OR
    2.Images can be used from the files 'we' have on file <Use image on file>.

So when I receive the order confirmation, I want to be able to distinguish from the the subject line of the email if the order -

  1. Uploaded image OR 2. Use image on file

I have created the options already within attributes and currently working all fine but I need this functionality to be in place for the email subject line.

Thank you

Downunder QLD

13 Sep 2008, 4:54 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

You would need to customize the order.php class ...

What happens when they make an order with both possiblities or multiple possibilities on several products in the order, 7 one way and 4 another?

Or, do you need something to capture:
Upload
On File
Both

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Sep 2008, 4:48 AM
#3
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Thank you for responding Ajeh.

There is only tow possibilities. Either they upload their own image from their own home computer OR they submit their Image number which we have on our records. We do ask them to make this choice. Incase they do end up with both choices (my mistake) then I guess it could display both results in the subject line.

There are no other possibilities. If they take the latter option which they need to insert their photo number in the field with some other fields provided then then subject line should read <Image Reference Number:<inserted number_here>>. I still need rest of the form with its contents to be included as is with the order confirmation. Only change I want is the inclusion of the subject line with this information of the email.

I'll need some novus help please as I have limited knowledge of php

Thank you
See : http://www.advancedlifedvds.com.au/index.php?main_page=product_info&cPath=1&products_id=2

Downunder QLD

14 Sep 2008, 4:57 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

I order Turbo Kid with my files and I order Snow White with your file ...

Now what happends? What goes in the email subject as I have mixed and matched the choices ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Sep 2008, 6:47 AM
#5
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

There can only be one option.

Either upload your file or provide the order number. You can not mix products within the same order. In order to order Snow White then customer has to order another instance of her order.

Unlike your typical shopping cart where one person in the same session can order more then one product at a time. This is only specific to the this site.

Anotherwords we only sell to our existing customers we have already on our files. We send mail outs (not through zencart) to let them know about the website. We specialized in school photography. So we already have them on our files. Its in the instance where they may choose their own images where they may upload otherwise one or the other.

Downunder QLD

14 Sep 2008, 2:05 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

You could catch the options_id and options_values_id and have it add something from those into the subject ...

If there is only 1 Product per order, then this should be easier to manage and can be done in the order.php class where the email is built ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Sep 2008, 10:16 PM
#7
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Thanks again,

so in my case, those values would be down as shown is that correct?

name="id[TEXT_PREFIX5]" and id="attrib-5-0"

I haven't looked that the orders.php yet but I assume it goes 'somewhere' where it would mention about the subject_line.

Now thats fine what happens if they take the other option (upload option), since there will be no Image Reference Number: entered, is that mean there will be nothing posted in the subject line (which I would want).

And lastly, how can it be conditional so that subject line can display -

If upload file used > display this > Uploaded file
If Image Reference Number: used > display this > Image Reference Number:#####

I don't want to complicate things. So as long as my option number 2 (Image Reference Number:) will not cause any problems in the subject line when its not used.

<div class="wrapperAttribsOptions"> <h4 class="optionName back"><label class="attribsInput" for="attrib-5-0">Image Reference Number:</label></h4> <div class="back"> <input type="text" name="id[TEXT_PREFIX5]" size="32" maxlength="32" value="" id="attrib-5-0" /> </div> <br class="clearBoth" /> </div>

I really appreciate this Ajeh, as I have being chasing the solution for a long time.

Downunder QLD

14 Sep 2008, 10:56 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

I'd really have to sit down and go through this when I have more time but the idea is to capture when the upload is made for the order and if made add it to the email ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Sep 2008, 12:29 AM
#9
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

It's more important to us to capture when the Image Reference Number: is used. If its not used then we don't want to see any refernce to Image Reference Number: in the subject line. Rest of it as as normal as Zencart.

I hope to hear from you may be this week some time? any solution would be great news Ajeh.

Thank you again.

Downunder QLD

19 Sep 2008, 3:17 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

You need to edit the:
/includes/classes/order.php

and add the following code above:

    // send additional emails
// add note to email subject
global $db;
$check_attributes = $db->Execute("SELECT products_options, products_options_values from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where products_options_id = 1 and products_options_values_id = 16");
if ($check_attributes->RecordCount() > 0) {
  $add_subject = ' ' . 'Note Text Here';
}

    // send additional emails

Next, you can add the $add_subject on this line:

      zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . $add_subject . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,

I placed it right after the main portion of the subject before the order number ... but you can move that around ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Sep 2008, 3:28 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

Forgot to mention change the 1 and 16 to the values you see in the orders_products_attributes for this Attribute so it looks for the right one ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Sep 2008, 10:53 PM
#12
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Many many sincere thanks Ajeh. I had to replace my motherboard so I wasn't able check my emails. I will follow your code and give you feed back.

Downunder QLD

22 Sep 2008, 4:24 AM
#13
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Hi Ajeh

I have made the changes but subject line is still coming as before without the any changes.

When I look at in admin> product oprions, I can see the fields I have created has ID of

ID1 Your Photo
ID3 Image Reference Number:

so I used those ID's in the code where it says your code.

// add note to email subject begin
global $db;
$check_attributes = $db->Execute("SELECT products_options, products_options_values from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where products_options_id = 1 and products_options_values_id = 3");
if ($check_attributes->RecordCount() > 0) {
$add_subject = ' ' . 'Note Text Here';
}
// add note to email subject end

I have also replaced as you can see the other bit

//zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,

	// add note to email subject begin  = replaced with the above line
zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . $add_subject . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,
 // add note to email subject  end

Here is what the email (part of ) confirmation looks like. Note the code I have used (ABC-123XX-90) That's the code I need on the subject line.

Subject: Order Confirmation No: 5

Order Confirmation from oavs.com.au

John Doe

Thanks for shopping with us today!
The following are the details of your order.

Order Number: 5
Date Ordered: Sunday 21 September, 2008
Detailed Invoice:
http://oavs.com.au/store/index.php?main_page=account_history_info&order_id=5

Products

1 x Red Roses (Red) = $54.00
Your image file for upload: ABC-123XX-90

Sub-Total: $54.00
Per Item (Best Way): $2.50
Total: $56.50

I have set up a working site until I get it right here with only one product http://oavs.com.au/store/index.php?main_page=product_info&cPath=2&products_id=2

How do I need to fix it? and do I need to do anything on this line ?
$add_subject = ' ' . 'Note Text Here';

Thank you Ajeh

Downunder QLD

22 Sep 2008, 4:12 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

The code I sent you goes to the Admin not the customer ... there are two sections that send the email ...

Make sure you have the $add_subject on the right zen_email or both if you want it on both ...

Look at the orders_products_attributes and that the products_options_id and products_options_values_id are matching ...

I was expecting the products_options_values_id to be 0 ... :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Sep 2008, 10:06 PM
#15
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Hi Ajeh

I know its late for you and I do appreciate your sleepless time.

I am little confused .. how many files I am supposed to edit or make changes to.

As you said there is one in admin>includes>order.php and I basically put the code right at the top..is that it? when you say there are two section, which section of the file or which file ? is it same file? there is no matching code to replace in admin>includes>orders.php so will I insert the lot?

and is it the admin > attributes on the site I need to look for the following and not within the actual files ?
"Look at the orders_products_attributes and that the products_options_id and
products_options_values_id are matching ..."

Make sure you have the $add_subject on the right zen_email or both if you want it on both ...

and what is the name of the file? I thought all of your code went into the orders.php in admin>includes

Am I totally confused or what :-(

Downunder QLD

22 Sep 2008, 10:18 PM
#16
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

I meant to say /includes/classes/order.php

Downunder QLD

22 Sep 2008, 10:39 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

There are a few zen_mail() lines in the orders.php in the catalog ...

You want to be sure you are adding it to the right one ... customer or shop ...

This one goes to the shop:

      zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . $add_subject . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,

But check this line:

$check_attributes = $db->Execute("SELECT products_options, products_options_values from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where products_options_id = 1 and products_options_values_id = 3");

Are you sure the options_id is 1 and the options_values_id is 3?

Make an order with this product and look in the orders_products_attributes table to be sure of the values ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Sep 2008, 12:55 AM
#18
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Hi Ajeh,

Thanks always for your kind response.

There is only one order.php that has and mentions the beginning of the line

zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . .......etc etc The admin//includes/classes/order.php does not have this line at all.

and on the /includes/classes/order.php line > zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO,.....etc etc only appears once right at the end of the /includes/classes/order.php code in page.

If are saying that /includes/classes/order.php file has the two section within (admin/customer) where are they?

Can you please make little clearer for me which and how many zencart file/s and whereabouts within the file I need to change. I am really frustrated to have the inability to follow your instructions and I really need this to be happening :-(

Downunder QLD

23 Sep 2008, 2:24 AM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need urgent help- to inc order atrib in email subject line

Let's make sure we are talking about the same thing ...

You want, when something is orders, to have the added information in the email that goes to the Store Owner ... correct? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Sep 2008, 2:30 AM
#20
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Need urgent help- to inc order atrib in email subject line

Hi yes correct. I want the information to appear in the subject line for email order confirmation for email sorting purposes.

Downunder QLD