Advanced search  

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]

Pages: [1]   Go Down

Author Topic: add {price} and {ORDER_ID} to $lang_photoshop_email_admin  (Read 8871 times)

0 Members and 1 Guest are viewing this topic.

Catman

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« on: January 30, 2007, 09:58:31 am »

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
« Last Edit: January 31, 2007, 11:59:18 pm by Stramm »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« Reply #1 on: January 30, 2007, 12:28:08 pm »

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

Catman

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« Reply #2 on: January 30, 2007, 12:37:02 pm »

 ??? 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? ???
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« Reply #3 on: January 30, 2007, 06:19:46 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« Reply #4 on: January 31, 2007, 08:54:01 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« Reply #5 on: January 31, 2007, 09:27:44 am »

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
Code: [Select]
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
Code: [Select]
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
Code: [Select]
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
« Last Edit: February 14, 2007, 08:24:17 am by Stramm »
Logged

Catman

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: add {price} and {ORDER_ID} to $lang_photoshop_email_admin
« Reply #6 on: January 31, 2007, 07:09:38 pm »

Thank you again, this is perfect.

Kind regards

Frank
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.