Photo Shop - Stramm - Confirmation mail - "type"-field too short Photo Shop - Stramm - Confirmation mail - "type"-field too short
 

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

Photo Shop - Stramm - Confirmation mail - "type"-field too short

Started by mboesen, September 17, 2009, 01:54:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mboesen

Hi there

I have gotten a little further with my setting up the Photo Shop.

The problem I have run into now is the "Thanks for your order" and "you got a new order" mail confirmation. The TYPE field after Item ID is too short. It cuts the text that describeds what the customer bought short.

How and where can I specify the length of that field in the confirmation mails? The idea is that it of cause displays the whole content.

And at the bottom of the mails it says i.e. "To download: 1 pics :: 59.00 DKK". Since they can't download from my site and I have to send it all, where do I delete that text?

Thanks for your time!

Best Regards

Michael


Stramm

checkout.php -> function photoshop_create_table ... the item data is stored in $out['text']

$out['text'].= sprintf("%10.10s\t", $item_id['pid']).sprintf("%15.15s\t", $SHOP_CONFIG[$item_id['id']]['name']).sprintf("%10.10s\t", $item_id['amount']).sprintf("%15.15s\r\n",$lang_photoshop['USD'].' '.$price);


to learn more visit php.net
http://www.php.net/manual/en/function.sprintf.php

mboesen

Hi

Am I suppose to change the whole line of code or am I "just" suppose to change any of the "15. 15....." to extent the length of the TYPE field? And if yes which one. Really would hate to mess of the code incase I do something wrong.

Ps. If I search the line of code you provide, then I can't find an exact match in the checktout file. But I do find similar coding.


Thanks for your time!

mboesen

I have tried to follow your directions, but can't really figure it out. I have attached screen dump of the confirmation mail send to the customer showing my problem with the TYPE field being cut short.

As you say I should correct it in "photo_shop_checkout.php" and I guess in this area...... ?!
(copy from the file.... But I might be wrong....?)

function photoshop_create_table($shop_array_photos, $type, $template){ //we create two basic templates html and text
   global $SHOP_CONFIG, $CONFIG, $lang_photoshop, $cd_price;

   $out = array();

   $out['html'] = '<tr><td><table cellpadding="0" cellspacing="1" width="100%">';
   $out['text'] = sprintf("%s\n\n", '');

   if ($type == 'photo') {
   $out['html'].= <<<EOT
      <tr>
         <td class="tableh1" width="15%">{$lang_photoshop['item_id_checkout']}</td>
         <td class="tableh1" width="45%">{$lang_photoshop['type_chckout']}</td>
         <td class="tableh1" width="15%">{$lang_photoshop['amount_checkout']}</td>
         <td class="tableh1" width="25%">{$lang_photoshop['total_checkout']}</td>
      </tr>
EOT;
   $out['text'].= sprintf("%10.10s\t", $lang_photoshop['item_id_checkout']).sprintf("%15.15s\t",$lang_photoshop['type_chckout']).sprintf("%10.10s\t",$lang_photoshop['amount_checkout']).sprintf("%15.15s\n",$lang_photoshop['total_checkout']);
   } elseif(($type == 'cd') && (photoshop_in_array_multi("CD", $shop_array_photos))) {
   $out['html'].= <<<EOT
      <tr>
         <td class="tableh1" width="15%">{$lang_photoshop['item_id_checkout']}</td>
         <td class="tableh1" width="45%">{$lang_photoshop['type_chckout']}</td>
         <td class="tableh1" width="15%">&nbsp;</td>
         <td class="tableh1" width="25%">&nbsp;</td>
      </tr>
EOT;
   $out['text'].= sprintf("%10.10s\t", $lang_photoshop['item_id_checkout']).sprintf("%15.15s\n",$lang_photoshop['type_chckout']);


I hope that some helpful soul can show where or tell me how to make sure that the customer can see the whole TYPE/string of what they have ordered.

Thanks for your time....

Stramm

Have you read what sprintf is doing in the link I posted above? This is what you need to change ... it's as said within function photoshop_create_table but nearly at the end of it. Not what you posted

sprintf("%10.10s\t", $item_id['amount'])

This is the part... raising 10.10 to eg. 15.15 will show max 15 chars (read the sprintf manual). You should reduce this additional characters somewhere else

mboesen

Hi

Thanks for the clarification... Yes I did read your link, but didn't quite understand it. I did try to change those number but nothing happened and now I guess I did it the wrong place. So I changed it back.

I'll try to find the right place....

Thanks!