helpmeplease Posted September 9, 2010 Share Posted September 9, 2010 Hi, Hope someone can help with this?I'm trying to add a field or setting in Prestashop that will show up in PayPalIdeally I'd like the reference field in the product page to appear in the PayPal statementCurrently I can only get Prestashop to update the product name, price and quantity in PayPalAll the current options in PayPal - Option 1,2, 3 and Item ID show up blankIs there a way of updating the redirect.tpl file in the PayPal module to get it to send this info to PayPal?I just need to be able to add a reference or stock number as a seperate field to PayPalI've tried updating all the existing fields - reference:, EAN13, Supplier Ref:, Location: - but none of these fields are sent to PayPalAm I missing something obvious or is it simply something Prestashop can't do?Hope someone can help?Best wishesBrian Link to comment Share on other sites More sharing options...
Zenith Posted September 9, 2010 Share Posted September 9, 2010 Try this: <input type="hidden" name="item_number_{$k+1}" value="{$product.reference}" /> after: <input type="hidden" name="item_name_{$k+1}" value="{$product.name|escape:'htmlall':'UTF-8'}{if isset($product.attributes)} - {$product.attributes|escape:'htmlall':'UTF-8'}{/if}" /> Link to comment Share on other sites More sharing options...
helpmeplease Posted September 9, 2010 Author Share Posted September 9, 2010 Hi Zenith,Thanks for the reply!I've inserted the code in to the redirect.tpl file (PayPal Module)I'm quite new to this, I'm assuming the top part of code needed to go in tothe document just below this line of code (my code was slightly different to yours?)<input type="hidden" name="item_name_{$k+1}" value="{$product.name}{if isset($product.attributes)} - {$product.attributes}{/if}" /><input type="hidden" name="item_number_{$k+1}" value="{$product.reference}" /> <--Popped the line of code here?<input type="hidden" name="amount_{$k+1}" value="{$product.price_wt}" /><input type="hidden" name="quantity_{$k+1}" value="{$product.cart_quantity}" />Hope I've got the code correct and in the right place?I've tested it in PayPal, charge went through okay, but I don't see the reference code anywhere in the PayPal order?I've also checked the .csv file from PayPal and it's not showing there either...Assuming I've not been a muppet and put the code in wrong (there's a very good chance I have!), is there a way of using the reference code and telling PayPal it's something else like - 'custom' or 'os0' or another option field that PayPal recognises?Hope that all makes sense?Thanks again for your helpBrian Link to comment Share on other sites More sharing options...
Patric Posted September 9, 2010 Share Posted September 9, 2010 Topic title changed. Next time words like "Urgent", "help" etc. are used, I close the topic.Please read the forum rules. Link to comment Share on other sites More sharing options...
helpmeplease Posted September 9, 2010 Author Share Posted September 9, 2010 Oops - sorry! - wont happen againBrian :red: Link to comment Share on other sites More sharing options...
helpmeplease Posted September 10, 2010 Author Share Posted September 10, 2010 Hi ZenithYour First solution worked perfectly!The reference shows up in both the PayPal order and the .csv report!....I'd uploaded the file to the wrong folder - I was indeed a muppet!Thanks again for your help in solving my problemBest wishesBrian Link to comment Share on other sites More sharing options...
Zenith Posted September 10, 2010 Share Posted September 10, 2010 Wicked, this is indeed missing from the PayPal module.I've requested this be added to PS permanently:http://www.prestashop.com/bug_tracker/view/5459/ Link to comment Share on other sites More sharing options...
gngnet Posted July 17, 2011 Share Posted July 17, 2011 Thanks for the suggestion in the above posts, I'm using PayPal Module 2.6 which seems to have resolved the rounding problem, but had to add additional code to two further files.I added the code above the the .tpl file, but found in order to get the checkout summary page to display the Item Reference Number (Product Number) I had to add the following code to the paypal.php file in the payment directory.On the next line after Line 79 (Opened in Dreamweaver) $request .= '&L;_NAME'.$i.'='.substr(urlencode($products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ), 0, 127); Add:- $request .= '&L;_NUMBER'.$i.'='.urlencode($products[$i]['reference']); Additionally in order for the Reference Numbers to be diplayed on the details (transaction page) in PayPal I had to add the same line of code to the paypal.php file in the paypal module directory.On the next line after line after line 418 (Opened in Dreamweaver) $request .= '&L;_NAME'.$i.'='.substr(urlencode($products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ), 0, 127); Add:- $request .= '&L;_NUMBER'.$i.'='.urlencode($products[$i]['reference']) This seemed to do the trick and now the product Reference is showing in both the summary page (buyer) and the payment details pages (buyer + seller).I have tested this in sandbox and I'm using this in production and so far everything seems to be working ok.I hope this helps someone as I spent some time searching for a solution and after finding this post it led me in the right direction (Thanks Zenith). Link to comment Share on other sites More sharing options...
Recommended Posts