add {price} and {ORDER_ID} to $lang_photoshop_email_admin add {price} and {ORDER_ID} to $lang_photoshop_email_admin
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

add {price} and {ORDER_ID} to $lang_photoshop_email_admin

Started by Catman, January 30, 2007, 09:58:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Catman

Hello,

Is it possible to use {price} and {ORDER_ID} in $lang_photoshop_email_admin, in the language PHP file (english.php) When I use it now it returns {PRICE} and {ORDER_ID} in the mail instead of the value.

Is it possible to use the {ORDER_ID} with the current date and a incrementing number?

Kind regards

Frank

Stramm

If you write code that replaces the placeholders you just invented, then yes.
Otherwise no, that feature doesn't exist.

Catman

 ??? So it is not possible to use the placeholders (I did not know they where called that way) in the email for the admin.

By the way: I did not invent them they are in the language files e.g. dutch.php, english.php etc. Or do I misunderstand your answer? ???

Stramm

these are for the email to the user (buyer) and not for the email to the admin

as said, you'll have to write code that does what you're up to.

Catman

Ok thanks for your answer;

Unfortunatly my knowledge of PHP is not enough to write the code for this. I have no idea where to start in this matter.
I will use the mail function as it is.

Kind regards

Frank

Stramm

easy to do cause the function's already written, you just need to modify it a lil bit so it makes a difference between admin and user

find in photo_shop_checkout.php

if (photoshop_add_data($shop_array, $order_id)) { // adding data succeeded
//now email the user
if(photoshop_email_the_user($lang_photoshop_email_order, $lang_photoshop['email_subject_order'])){
//when user got his email, then send to admin
cpg_mail('admin', sprintf($lang_photoshop['email_subject_order_admin'], $CONFIG['gallery_name']), nl2br($lang_photoshop_email_admin));

replace with
if (photoshop_add_data($shop_array, $order_id)) { // adding data succeeded
//now email the user
if(photoshop_email_the_user($lang_photoshop_email_order, $lang_photoshop['email_subject_order'])){
//when user got his email, then send to admin
photoshop_email_the_user($lang_photoshop_email_admin, $lang_photoshop['email_subject_order_admin'], true);


replace the entire function photoshop_email_the_user (near the end of photo_shop_checkout.php) with that new version
function photoshop_email_the_user($message, $subject, $admin = '')
{
global $CONFIG, $SHOP_CONFIG, $lang_photoshop, $cd_price, $order_id;

$user_info = photoshop_user_details(USER_ID);

if ($admin) {
$user_info['user_email']='admin';
}

$template_vars = array(
'{ORDER_ID}' => $order_id,
'{SITE_NAME}' => $CONFIG['gallery_name'],
'{PRICE}' => number_format(($cd_price[0]+$cd_price[1]+$SHOP_CONFIG['ship']),2),
'{USER_NAME}' => (USER_NAME),
'{ADMIN}' => $CONFIG['gallery_name'],
'{LINK}' => $CONFIG['ecards_more_pic_target'],
);
$mail_body=nl2br(strtr($message, $template_vars));
if(cpg_mail($user_info['user_email'], $subject, $mail_body, 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'] )) {
return true;
}
return false;
}


you now can use all above placeholders
{ORDER_ID}
{SITE_NAME}  (you set in config)
{ADMIN} same as above (till I know what better to do with it, hehe)
{PRICE}
{USER_NAME}
{LINK} link to your gallery... not to the shop admin, that'll be
{LINK}index.php?file=photo_shop/photo_shop_admin

Catman