Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Photo Shop 1.4.1 Email Paypal Link to Customer  (Read 4234 times)

0 Members and 1 Guest are viewing this topic.

falcoln0014

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 3
    • Psychotic Studios
Photo Shop 1.4.1 Email Paypal Link to Customer
« on: June 27, 2010, 09:53:39 pm »

I have Photo Shop 1.4.1 installed on CPG 1.4.27 with the 1.4.26 modpack. I tried following the tutorials I found on the forum to inject a paypal link into email, but i can't seem to get it working. My gallery is located here: http://www.psychoticstudios.net/photos

The post I found showed inserting this code in photo_shop_checkout.php:
Code: [Select]
$add_paypal_to_user_email .= <<<EOT
<br><br>{$lang_photoshop['paypal']}<br>

<form action="{$CONFIG['photo_shop_paypal_form_url']}" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="invoice" value="{$order_id}">
<input type="hidden" name="business" value="{$CONFIG['photo_shop_paypal_email']}">
<input type="hidden" name="currency_code" value="{$CONFIG['photo_shop_paypal_currency']}">
{$paypal_items}
{$paypal_tax}
{$paypal_return_url}
{$paypal_cancel_return_url}
{$paypal_notify_url}
<input type="image" src="{$CONFIG['photo_shop_paypal_image']}" name="submit" alt="Pay with PayPal!">
</form>

EOT;
                 $msg_box_txt .= $add_paypal_to_user_email;

I'm guessing the base code has changed in photo_shop_checkout.php, because I had this:
Code: [Select]
$msg_box_txt .= <<<EOT
<br><br>{$lang_photoshop['paypal']}<br>
<form action="{$CONFIG['photo_shop_paypal_form_url']}" method="post" name="paypal_form">
{$paypal_items}
<input type="image" src="{$CONFIG['photo_shop_paypal_image']}" name="submit" alt="Pay with PayPal!">
</form>

EOT;
Which I changed to this:
Code: [Select]
$add_paypal_to_user_email .= <<<EOT
<br><br>{$lang_photoshop['paypal']}<br>
<form action="{$CONFIG['photo_shop_paypal_form_url']}" method="post" name="paypal_form">
{$paypal_items}
<input type="image" src="{$CONFIG['photo_shop_paypal_image']}" name="submit" alt="Pay with PayPal!">
</form>

EOT;
                 $msg_box_txt .= $add_paypal_to_user_email;
Also changed the bottom section to add the new PAYPAL_BUTTON and modify the mailer to send HTML
Code: [Select]
$template_vars = array(
'{ORDER_ID}' => $order_id,
'{SITE_NAME}' => $CONFIG['gallery_name'],
'{PRICE}' => number_format(($cd_price[0]+$cd_price[1]+$shipping_price-$discount),2),
'{USER_NAME}' => (USER_NAME),
'{USER_EMAIL}' => $email,
'{ADMIN}' => $CONFIG['gallery_name'],
'{LINK}' => $CONFIG['ecards_more_pic_target'],
'{USER_PROFILE1}' => $user_info['user_profile1'],
'{USER_PROFILE2}' => $user_info['user_profile2'],
'{USER_PROFILE3}' => $user_info['user_profile3'],
'{USER_PROFILE4}' => $user_info['user_profile4'],
'{USER_PROFILE5}' => $user_info['user_profile5'],
'{USER_PROFILE6}' => $user_info['user_profile6'],
'{PAYPAL_BUTTON}' => $add_paypal_to_user_email,
);
$mail_body=nl2br(strtr($message, $template_vars));
if(cpg_mail($user_info['user_email'], $subject, $mail_body, 'text/html', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'] )) {
return true;
}
return false;
}
I noticed the tutorial shows this for sending html instead of what I have, so I guess this portion has changed a bit as well:
Code: [Select]
if(cpg_mail($user_info['user_email'], $subject, $mail_body, 'text/html')) {In english.php I currently have (it's very rough I know, but I just wanted the button to work):
Code: [Select]
$lang_photoshop_email_order = <<<EOT

Hello {USER_NAME},



Thank you for your order from Psychotic Studios

Your order id is {ORDER_ID}.

Use the following link to pay with {PAYPAL_BUTTON}.

Please transfer USD {PRICE} and we will begin processing your order.

<a href="{LINK}">{LINK}</a>


Adam Barnes of

Psychotic Studios

EOT;
This is what the code looks like when I get an order email, so I would assume it's doing HTML as intended.
Code: [Select]
--b1_a9f3dd180e9d743882116f24b067ffa7
Content-Type: text/html; charset = "utf-8"
Content-Transfer-Encoding: 8bit

Hello happy,<br />
<br />
Thank you for your order from Psychotic Studios Your order id is 30.Use the following link to pay with .<br />
Please transfer USD 25.00 and we will begin processing your order.<br />
<a href="http://www.psychoticstudios.net/photos/">http://www.psychoticstudios.net/photos/</a><br />
Adam Barnes of<br />
Psychotic Studios
It just doesn't seem to be passing anything into PAYPAL_BUTTON and I can't figure out why.

I've also tried disabling all of my other plugins and moving Photo Shop 1.4.1 to the top of the list. Neither had any effect on the email. I think it's pretty close to working, but I'm probably just overlooking something overly obvious. Any suggestions?
Logged

falcoln0014

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 3
    • Psychotic Studios
Re: Photo Shop 1.4.1 Email Paypal Link to Customer
« Reply #1 on: July 08, 2010, 07:40:34 pm »

I couldn't figure it out, so I ended up manually sending customer a PayPal link for their purchase(s) after an order is completed. Problem solved.
Logged
Pages: [1]   Go Up
 

Page created in 0.013 seconds with 20 queries.