djmonkey1 Posted December 14, 2003 Posted December 14, 2003 Image mod to Steve's code- If you want to have your own logo at the top of the PayPal payment page insert this line of code into the snippet Steve posted: tep_draw_hidden_field('image_url', tep_href_link(DIR_WS_IMAGES . 'yourlogo.gif', '', 'SSL')); I added it in at the end so that the last four lines or so look like this: tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')) . tep_draw_hidden_field('image_url', tep_href_link(DIR_WS_IMAGES . 'yourlogo.gif', '', 'SSL')); return $process_button_string; The only thing you'll have to edit is the actual filename of the image you want to use. This will work great IF you have SSL: if not then users will get that annoying "some of the items on the page are not secure" message. Also, the image you need has to be exactly 150 by 50 pixels in size; this is required by PayPal. Still working on that product attributes thing.... :D Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread.
djmonkey1 Posted December 14, 2003 Posted December 14, 2003 p.s. Watch out for the periods and the semi-colon at the end of each line: the semi-colon should only appear at the end of the last line, as in my second quoted example. If you put the one line of code I posted somewhere besides the end, it should have a space and a period after the last parantheses bracket, not a semi-colon. Also, use contributions and snippets at your own risk and BACK UP! And, if anyone is still wondering, the international dialing code for the U.S. is '1' but I found including that part made it weird (using the code exactly as Steve posted but otherwise modified for the U.S., the prepopulated area code would be '1' and the first 3 numbers, the exchange, would be the customers area code; I modified the two telephone lines to simply read tep_draw_hidden_field('night_phone_a', $order->customer['telephone']) . I deleted the line with 'night_phone_b' in it. Unfortunately the result of this is that the PayPal payment page is only prepopulated with the customers area code. If anyone knows of a better way to do this it would be greatly appreciated! Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread.
sjd256 Posted December 15, 2003 Posted December 15, 2003 Hi, DJMonkey1 - as far as I am aware this is a Paypal issue. I seem to remember reading on Paypal that to be able to prepopulate the Paypal sign-up form with the telephone number then night_b has to be filled in with the internationl dialing code. If this variable is not passed then the telephone number will not be filled in. The only thing I can suggest is that you have a look at the Paypal info posted on their site which migh give a clue as to how to solve it. Not much but it might help :blink: Cheers Steve
Kinky Clothes Posted December 19, 2003 Posted December 19, 2003 As requested: make sure you backup before messing with any of the php files. if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') { $my_currency = $currency; } else { $my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5); } if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { $my_currency = $currency; } $totitems = 0; $totitemstxt = ''; $opt = ''; $xx = ''; for ($i=0; $i<sizeof($order->products); $i++) { $totitems = $totitems + 1; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { $opt .= ' ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . ' - '; } $xx .= $order->products[$i]['qty'] . ' * ' . ($order->products[$i]['name']) . ' - ' . $opt . ' || '; } $totitemstxt .= $totitems . ' Items = ' . $xx; $process_button_string = tep_draw_hidden_field('cmd', '_xclick') . tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) . tep_draw_hidden_field('item_name', $totitemstxt) . tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . tep_draw_hidden_field('currency_code', $my_currency) . tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); On the paypal page it will display this: Pay To: Kinky Clothes Payment For: 1 Items = 1 * Latex Monroe Dress - Option A: 2. Zip - Size: 3. Medium - || Currency: Pounds Sterling Amount: ?120.95 GBP hope you can get it to work, this works fine for 1 item but i didnt have time to fix a problem i was having, if there is more than 1 item, it gives the options from item 1 for all items... if i can remember... maybe someone here can fix it for you, all it needs is to put the right bits into the varyable $opt. good luck :) Lisa.
markchiu Posted December 28, 2003 Posted December 28, 2003 hi, today, i just saw this steve's code and i put the code into my paypal.php........so i guess i don't need to install paypal ipn anymore?? right??? Then how can i know if it works?? How should i test it??? Sorry for my non-sense question.. :P :lol: OS-commerce is great, but with other magical contributions, that is just so "COOL"!
djmonkey1 Posted December 29, 2003 Posted December 29, 2003 Hi markchiu- This fix doesn't actually address the issue of some PayPal orders not showing up in the Admin orders section, it just makes it a lot easier to figure out what people ordered based on the confirmation email from PayPal (thanks Steve!). If orders not showing up in your admin is an issue for you, perhaps you should research the PayPal IPN module. Also, to test Steve's code I just processed an order through the cart. I used my personal PayPal account to pay for the item then had the store owner (who isn't me in this case) refund the payment. It worked! Stew Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread.
djmonkey1 Posted December 29, 2003 Posted December 29, 2003 Steve- The issue with the phone number seems to me to be the result of differences in the way osc and PayPal collect phone numbers. The default osc version has just one big block for the whole number while PayPal cuts it into little sections such as area code, exchange, etc. So, when the number is transferred from osc to PayPal it only keeps the first three numbers (in my case the area code) as the first box is limited to 3 characters. Stew Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread.
markchiu Posted December 29, 2003 Posted December 29, 2003 well...then if we can see it form paypal's emails...why should i stil use paypal ipn? ;) ;) ....and is it really necesary??....sorry...i am not quite good at this..... OS-commerce is great, but with other magical contributions, that is just so "COOL"!
webslingers Posted January 5, 2004 Posted January 5, 2004 I added the code listed on this forum for paypal, and I thought everything was great. No more paypal customers griping about no shipment... but no paypal orders at all either. So I did a test purchase...or tried, and there is no link to go to paypal after I add the item to the cart, verify my address, then click paypal as payment... it goes to a page with all the info, and says, ready to pay or something, I think on that page there is supposed to be something that takes me to paypal. Did I lose my link or button or something? Someone please help. Thanks in advance Frank
Recommended Posts
Archived
This topic is now archived and is closed to further replies.