Jump to content
chipshi11

Add Product Attributes to E-mail

Recommended Posts

Hi everyone,

I'm looking for an add-on/contribution in order to display product attributes in the order confirmation e-mail that I get. At the moment, I get an e-mail stating what product a customer has ordered, but not the colour, size, combination etc that they have chosen. It would be nice to know what I need to order without having to log in to my admin panel.

I've searched on here and on the contrib site but can't find what I'm looking for, although it seems like such an simple overlooked request, there's a chance it's already an option in the admin that I've missed or I'm just typing in the wrong thing in the search.

Thank you for reading, and I apologize if it was an easily searchable answer.

Share this post


Link to post
Share on other sites

Hi,

what version of oscommerce do you use, because I can't remember of any that would not include products attributes in the confirmation email.

Have a look in catalog/checkout_process.php, look for $products_ordered .= 

in that line there should be also $products_ordered_attributes.

Best regards

Christoph

 

Share this post


Link to post
Share on other sites

Hi, I'm on 2.3.4

At the very end of the line including the fragment you mentioned, I have:

$products_ordered_attributes . "\n";

Does that mean it's set to No for some reason? If so, is it as simple as changing that n to y?

Share this post


Link to post
Share on other sites

Hi,

no this is just a new line for email formatting. But if you look into your orders on the admin side you see the orders with attributes?

Did you or anyone change the checkout_process.php file? Because as I said it is built in by default no need to activate in anyway.

Best regards

Christoph

Share this post


Link to post
Share on other sites

Hi Christoph,

Yes I see all attributes in the order page in the admin as I'm supposed to.

I may have changed the checkout_process.php during installation of various contributions by the looks of it.

Do you happen to know what part of the file I need to look at?

Kind regards

Share this post


Link to post
Share on other sites

Hi,

there should be

 //------insert customer choosen option eof ---- 

in checkout_process.php which marks the end of the relevant part for getting attributes stored with the order and also mailed with the confirmation.

So this about 12 lines or so above (tablename might look like TABLE_ORDERS_PRODUCTS_ATTRIBUTES in your version)

tep_db_perform('orders_products_attributes', $sql_data_array);

works. but this just a few lines above  //------insert customer choosen option eof ---- 

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];

doesn't. How does that line look on your side?

best regards

Christoph

Share this post


Link to post
Share on other sites

I have both the lines you mentioned. This is a snippet of the page showing both lines, one about 11 lines above, and one 2 lines above...

 

tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

        if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
          $sql_data_array = array('orders_id' => $insert_id,
                                  'orders_products_id' => $order_products_id,
                                  'orders_products_filename' => $attributes_values['products_attributes_filename'],
                                  'download_maxdays' => $attributes_values['products_attributes_maxdays'],
                                  'download_count' => $attributes_values['products_attributes_maxcount']);
          tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
        }
        $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
      }
    }
//------insert customer choosen option eof ----

Share this post


Link to post
Share on other sites

Hi,

I'm simply clueless now. And you do use the standard email feature? Have you checked if the customer gets an order confirmation with the attributes for products he/she ordered?

This would be the part for the order confirmation emails sent to admin:

// send emails to other people
  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }

Best regards

Christoph

Share this post


Link to post
Share on other sites

I haven't actually checked what the customer recieves. I'll order something from myself in a few minutes with 0 price and a few attributes to see what happens.

I'm not sure if it's relevant but just below the part of the code I pasted to show you, I have some code from a discount codes contrib. Could that have an effect on it?

And yes I'm using the original email function from admin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×