[Solved]: Send individual item detail to paypal shopping cart - Page 2 [Solved]: Send individual item detail to paypal shopping cart - Page 2
 

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

[Solved]: Send individual item detail to paypal shopping cart

Started by WesG, February 15, 2008, 08:27:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nibbler

I missed something.

Find


//pay with paypal
if ($CONFIG['photo_shop_paypal_enable']) {


Change to


//pay with paypal
photoshop_add_paypal_data($shop_array, $order_id);
if ($CONFIG['photo_shop_paypal_enable']) {


erika_conn

Quote from: Nibbler on July 02, 2008, 08:35:47 PM
I missed something.

Find


//pay with paypal
if ($CONFIG['photo_shop_paypal_enable']) {


Change to


//pay with paypal
photoshop_add_paypal_data($shop_array, $order_id);
if ($CONFIG['photo_shop_paypal_enable']) {


I did as you said but still no order form.  I know I'm sending this to myself and so could be a little confusing but...

Here is the email I get as the vendor:
Hello fotos by erika,

admin just made an order on your site fotos by erika. The id of that order is 8 and the total value 20.00.
Click to go to the order manager

Other placeholders you can use (blank if these user profile fields haven't been filled in):
user_profile1: admin
user_profile2: {USER_ADDRESS}
user_profile3: {USER_PHONE}
user_profile4: {USER_CELL}
user_profile5: {USER_EMAIL}
user_profile6:

Best regards,
fotos by erika


FOTOS BY ERIKA

1300 Bloor St., SPH6

Mississauga, ON Canada

01-905-212-9111





   Item ID              Type       Amount       Price total





   Item ID              Type

       403                CD

                                                               



                                      On CD: 1 pics :: 20.00USD

                                     --------------------------

                                                Total: 20.00USD

This is the email I get as the purchaser:
Hello admin,

Thank you for your order at fotos by erika with the order id 8.
Please transfer USD 20.00 as soon as possible.
A USD10.00 charge will be added for shipping and handling to Canada and USA. Worldwide shipping and handling charge is USD15.00. This price is per CD.
http://ceconn.com/photo_gallery/

fotos by erika


FOTOS BY ERIKA

1300 Bloor St., SPH6

Mississauga, ON Canada

01-905-212-9111





   Item ID              Type       Amount       Price total





   Item ID              Type

       403                CD

                                                               



                                      On CD: 1 pics :: 20.00USD

                                     --------------------------

                                                Total: 20.00USD

Does that information help?

Stramm

Try with photos for print instead of a cd. As far as I remember I haven't coded that hack for cds.

Stramm

this is from my new checkout version (jsut the paypal form part). Unfortunately I can't post the entire file as it contains a lot of changes that would make it not work with the version 1.3.6


//pay with paypal
if ($CONFIG['photo_shop_paypal_enable'] && $order_price > 0) {

$handling = $shipping_price-$discount;
$paypal_items = "";
$cd_price_set = false;
$counter = 0;
foreach ($shop_array as $key => $item_id) {

if ($SHOP_CONFIG[$item_id['id']]['price'] > 0 || $item_id['id']=="CD") { // if it's not a free item
$pid = $item_id['pid'];
$amount = $item_id['amount'];
$counter++;
if ($item_id['id']=="CD") {
$size = "CD";
//$price = $cd_price[1];
if ($cd_price_set === false) {
photoshop_add_field($form_fields, 'item_name_'.$counter, $cd_price[4]);
photoshop_add_field($form_fields, 'amount_'.$counter, $cd_price[1]);
photoshop_add_field($form_fields, 'quantity_'.$counter, $amount);
}
$cd_price_set = true;
} else {
$size = $SHOP_CONFIG[$item_id['id']]['name'];
$price = $SHOP_CONFIG[$item_id['id']]['price'];

//price override
$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_PRICES']} WHERE aid={$item_id['aid']}");

    while ($temp_data = mysql_fetch_array($results)) {
if($temp_data['gid']==$SHOP_CONFIG[$item_id['id']]['id'])
$price=$temp_data['price'];
} //end while
mysql_free_result($results);

//to grab the image title from the db
$query = cpg_db_query("SELECT title FROM {$CONFIG['TABLE_PICTURES']} WHERE pid={$item_id['pid']}");
    $row = mysql_fetch_row($query);
($row[0]) ? $title= $row[0] : $title="No title";
mysql_free_result($row);



$picture_total = ($picture_total+$price*$amount);
photoshop_add_field($form_fields, 'item_name_'.$counter, "{$cd_price[4]} => Title: {$title} - ID: {$pid}");
photoshop_add_field($form_fields, 'amount_'.$counter, $price);
photoshop_add_field($form_fields, 'quantity_'.$counter, $amount);
}// end else

}//end if amount >0
else //it's a free item
{
//code here
}
} // end foreach

if ($CONFIG['photo_shop_paypal_use_ipn'] == '1') {
photoshop_add_field($form_fields, 'notify_url', $CONFIG['photo_shop_paypal_ssl_adress'].$CONFIG['photo_shop_paypal_ipn_notify_url']);
photoshop_add_field($form_fields, 'rm', '2');
if ($CONFIG['photo_shop_paypal_return_url'] != '') {
photoshop_add_field($form_fields, 'return', $CONFIG['photo_shop_paypal_ssl_adress'].$CONFIG['photo_shop_paypal_return_url']);
}
if ($CONFIG['photo_shop_paypal_cancel_return_url'] != '') {
photoshop_add_field($form_fields, 'cancel_return', $CONFIG['photo_shop_paypal_ssl_adress'].$CONFIG['photo_shop_paypal_cancel_return_url']);
} else $paypal_cancel_return_url = '';
}
if ($CONFIG['photo_shop_tax'] != '') {
photoshop_add_field($form_fields, 'tax_cart', $CONFIG['photo_shop_tax']*$picture_total);
}

photoshop_add_field($form_fields, 'cmd', '_cart');
photoshop_add_field($form_fields, 'upload', '1');
photoshop_add_field($form_fields, 'invoice', $order_id);
photoshop_add_field($form_fields, 'business', $CONFIG['photo_shop_paypal_email']);
photoshop_add_field($form_fields, 'currency_code', $CONFIG['photo_shop_paypal_currency']);
photoshop_add_field($form_fields, 'handling_cart', $handling);

foreach ($form_fields as $name => $value) {
$paypal_items .= "<input type=\"hidden\" name=\"$name\" value=\"$value\"/>\n";
}

$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;
}

erika_conn

Wow, I believe you did it.  I do believe it's fixed.  I'll test it by having someone else buy a photo to see that everything works as it should.  Thank you so very much.

erika_conn

Quote from: erika_conn on July 03, 2008, 10:50:31 AM
Wow, I believe you did it.  I do believe it's fixed.  I'll test it by having someone else buy a photo to see that everything works as it should.  Thank you so very much.
Celebrated way too soon.  Here is what is happening.

  • Instead of an order form, the purchaser gets a registration form.
  • One part says "already a member?"

  • The form asks for user name and password
  • There is nowhere to click to actually pay by PayPal
I guess the wrong form is being called.

[/list]

I'd love for you to try it out and you'll see what I mean.
For some reason, I get two registration confirmations and two orders. 

Stramm

User needs to be registered to be able to checkout... (why, cause you need his data - name, address etc.)
So login or register

erika_conn

Quote from: Stramm on July 03, 2008, 09:09:02 PM
User needs to be registered to be able to checkout... (why, cause you need his data - name, address etc.)
So login or register
It's too bad they can't just fill out an order form with their name, address, etc.  Oh well......  Being registered means I'll have to change permission on those albums that can only be viewed by registered users.  So, if this is somewhat successful, I could end up with many, many registered users.

I still don't see where they click to send money. In fact, I called PayPal and now I have the html codes for their buttons.  Question is, where do I put the code?