coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: mboesen on September 17, 2009, 01:54:50 PM

Title: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: mboesen on September 17, 2009, 01:54:50 PM
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
Title: Re: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: mboesen on September 18, 2009, 08:16:47 AM
By the way... the link is

http://www.fodboldfotografen.dk/coppermine14x/index.php
Title: Re: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: Stramm on September 18, 2009, 06:44:16 PM
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
Title: Re: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: mboesen on September 22, 2009, 10:01:46 AM
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!
Title: Re: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: mboesen on September 23, 2009, 09:55:32 AM
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....
Title: Re: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: Stramm on September 23, 2009, 07:44:31 PM
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
Title: Re: Photo Shop - Stramm - Confirmation mail - "type"-field too short
Post by: mboesen on September 24, 2009, 08:10:03 AM
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!