YaKs Posted July 16, 2010 Share Posted July 16, 2010 Good morning,I am trying to migrate my eshop from joomla+virtuemart to Prestashop 1.3.1.1. I just install it and make the first tests. It seems pretty cool, faster and more user friendly but I couldnt make the module PAYPAL works properly.I just use the module that comes already with prestashop, I set the email and logo link in the backoffice but when I tried to a payment and I click on PAypal logo, the system redirects to homepage instead of paypal site.this behavious happens in test and normal mode.any idea why is this happening? I did all the settings in my premier paypal account too.thanks a lot in advancejose Link to comment Share on other sites More sharing options...
ShanghaiMike Posted October 2, 2010 Share Posted October 2, 2010 Hi,I am having the exact same issue. I even updated to the new PayPal v. 2.0 module and I get the same problem. Instead of directing the user to Paypal, it directs back to the home page. Has anyone been able to solve this issue?Thanks,Mike Link to comment Share on other sites More sharing options...
shokinro Posted October 2, 2010 Share Posted October 2, 2010 I am also using v1.3.1, it works fine for me. I think there might some configuration problem or permission issue.Try to set display_errors to "on" at config/config.inc.php to see if there is any error occurs.@ini_set('display_errors', 'on'); Link to comment Share on other sites More sharing options...
ShanghaiMike Posted October 3, 2010 Share Posted October 3, 2010 I am also using v1.3.1, it works fine for me. I think there might some configuration problem or permission issue.Try to set display_errors to "on" at config/config.inc.php to see if there is any error occurs.@ini_set('display_errors', 'on'); Hi,Thank you very much for trying! Unfortunately, the site still redirects back to the homepage with no error messages displayed.Mike Link to comment Share on other sites More sharing options...
shokinro Posted October 3, 2010 Share Posted October 3, 2010 Which module are you using? Is it Paypal or PaypalApi? Please also note you have configured it correctly after installation.After you confirmed that everything is OK, then check if the URL in redirect form is correct or not.The correct redirect URL to Paypal should be something like action="https://www.paypal.com/cgi-bin/webscr". I guess in your case, it might be empty or something different that causes to redirect to Home.Please see on How to check Paypal URL and data in the form post to Paypal server Link to comment Share on other sites More sharing options...
ShanghaiMike Posted October 5, 2010 Share Posted October 5, 2010 Hi,Fortunately, I had someone from the forum help me with the redirect problem (programming beyond my understanding ), but now I am getting another issue that I will post about. Essentially it shows this error:Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.I ship to China only and am guessing that the information passed on to PayPal from Prestashop for Chinese addresses is incorrect. Any thoughts?Thanks,Mike Link to comment Share on other sites More sharing options...
shokinro Posted October 5, 2010 Share Posted October 5, 2010 I had the same problem before and fixed by 1. Configure the country with "State" at back office. (back office - shipping -country - country detail)2. Add two two lines to modules/paypal/redirect.phpafter line 10 $address = new Address(intval($cart->id_address_invoice));Inser line below $state = new State(intval($address->id_state));after line 45 <input type="hidden" name="zip" value="'.$address->postcode.'" />insert below <input type="hidden" name="state" value="'.$state->iso_code.'" />Hope this help Link to comment Share on other sites More sharing options...
ShanghaiMike Posted October 5, 2010 Share Posted October 5, 2010 Hi,Thank you so much for giving this a try. Unfortunately, it now gives an error 01 -- this country requires a state selection. One thing that might have caused issues is that I don't have what you say above in line 45, so I left out the iso_code section. I am using Paypal module version 1.6 if this makes any difference?Around line 45 I see the following code:$smarty->assign(array( 'redirect_text' => $paypal->getL('Please wait, redirecting to Paypal... Thanks.'), 'cancel_text' => $paypal->getL('Cancel'), 'cart_text' => $paypal->getL('My cart'), 'return_text' => $paypal->getL('Return to shop'), 'paypal_url' => $paypal->getPaypalUrl(), 'address' => $address, 'country' => $country, 'state' => $state, 'amount' => floatval($cart->getOrderTotal(true, 4)), 'customer' => $customer, 'total' => floatval($cart->getOrderTotal(true, 3)), 'shipping' => Tools::ps_round(floatval($cart->getOrderShippingCost()) + floatval($cart->getOrderTotal(true, 6)), 2), 'discount' => $cart->getOrderTotal(true, 2), 'business' => $business, 'currency_module' => $currency_module, 'cart_id' => intval($cart->id), 'products' => $cart->getProducts(), 'paypal_id' => intval($paypal->id), 'header' => $header, 'url' => Tools::getHttpHost(false, true).__PS_BASE_URI__));Should any of this be changed?Thanks again for your willingness to help. I can't wait until this headache is over!Best regards,Mike Link to comment Share on other sites More sharing options...
shokinro Posted October 5, 2010 Share Posted October 5, 2010 Thank you so much for giving this a try. Unfortunately, it now gives an error 01 -- this country requires a state selection. Mike For address from country like USA/Canada/China, this error will occur if you are using address that does not have state data. I suggest you to use a new address with "State" data to do test if you have changed country setting. One thing that might have caused issues is that I don’t have what you say above in line 45, so I left out the iso_code section. I am using Paypal module version 1.6 if this makes any difference?Mike I am using Paypal 1.6 too. Maybe you are looking into different file or your are using different version of or your copy of redirect.php has been customized by someone. I can not see the lines you posted here at redirect.php.The file you need to change is ./modules/paypal/redirect.php. Link to comment Share on other sites More sharing options...
ShanghaiMike Posted October 6, 2010 Share Posted October 6, 2010 Hi,Thank you for your response. You are correct, the file was adjusted by someone else to allow my module to redirect to Paypal. Unfortunately, this presents the next problem. Having states would just confuse customers. Unfortunately, I need to find a way around this.I'd be happy to pay someone to help me get this fixed. It has been a thorn in my side for way too long to the point where I'm thinking that getting Paypal to work on Prestashop just isn't an option. Best regards,Mike Link to comment Share on other sites More sharing options...
shokinro Posted October 6, 2010 Share Posted October 6, 2010 Hi Mike,I'd be happy to pay someone to help me get this fixed. It has been a thorn in my side for way too long to the point where I'm thinking that getting Paypal to work on Prestashop just isn't an option. Mike I can take a look for you for free, if you could give me the permission to access your site. but I can not guarantee to fix it. Of course if you could find someone else to do it for you, it will be great. I only work for this at Toronto night time,so if you would like to give me a try, please send the access information to my email address [email protected]. We can communicate after that.I also had a lot of issue at beginning, now it stable. Good Luck.Alvin Link to comment Share on other sites More sharing options...
shokinro Posted October 6, 2010 Share Posted October 6, 2010 Hi Mike,I tried access via FTP with the information you gave me, but it is always with authentication failure error. So I am not able to do anything.I also tried to access back office to check your configuration, but you didn't tell me the URL of admin site. The default admin URL is not working(I think you have changed it for security reason).I also tried to place a test order at your site, and see there is no "State" information available. I guess it is configuration problem. You need to add all Provinces of China to State list manually, you can do this at back office Shipping - States. Please note you must use the iso code of provinces.If you still can not work it out, please give me the URL and admin information and I will take a look for you.Hope this help Link to comment Share on other sites More sharing options...
ShanghaiMike Posted October 7, 2010 Share Posted October 7, 2010 Thank you so much for helping!The issue is finally resolved thanks to Shokinro's expertise and help. I infinitely owe you for your help!Best regards,Mike Link to comment Share on other sites More sharing options...
shokinro Posted October 7, 2010 Share Posted October 7, 2010 You are welcome Mike. Please mark this thread as Solved by editing your first post and adding "SOLVED" at the beginning of the subject.For more detailed on how fix this issue. please see http://alvinjiang.blogspot.com/2010/10/prestashop-tips-how-to-fix-address.html Link to comment Share on other sites More sharing options...
YaKs Posted November 15, 2010 Author Share Posted November 15, 2010 Hi all,I am having the same problem and the 'states' solution seems to dont work in my case. no redirection and no error displayed even if I change to on the option ini_set('display_errors', 'on');I realized that the same behavior is happening when I select 'cash on delivery' payment mode....any idea what is going wrong??thanks a lot in advance.Jose Link to comment Share on other sites More sharing options...
shokinro Posted November 16, 2010 Share Posted November 16, 2010 I am not your problem is before redirect to Paypal or after redirecting Paypal.Can you give me your website URL so that I can take look. (You can PM it to me if don't want to show it here) Link to comment Share on other sites More sharing options...
YaKs Posted November 16, 2010 Author Share Posted November 16, 2010 Hi Shokinro and thanks for the fast reply,here you havehttp://v2.muertosdearte.com/categoryFull.php?id_category=8there are only products in that category. Link to comment Share on other sites More sharing options...
shokinro Posted November 16, 2010 Share Posted November 16, 2010 I tried to sign up an account, but it keep getting connection reset error.Even though I got "Welcome" email. But when tried to log in, got the same error. Not able to go ahead.I tried both IE and FireFox, same error.It seem that you are not using the standard theme,and have applied some changes. I have no idea what is the problem. Link to comment Share on other sites More sharing options...
YaKs Posted November 16, 2010 Author Share Posted November 16, 2010 yes , I have applied several changes but none to the checkout process... very weird. in my developing enviroment (localhost), the paypal module works perfectly... maybe I just need to delete everything and start over again... re-installing the prestashop in the hosting and do small changes one by one...first I will try to change the theme to the default one to see if this is the prob.thanks anyway! Link to comment Share on other sites More sharing options...
stevebob Posted November 21, 2010 Share Posted November 21, 2010 I'm having this problem with a brand new install of 1.3.2Paypal v1.7.1 *and* Cheque v2.3 both redirect to the store home page. Perhaps this is answered above, but I'm just not seeing it?Any help appreciated - thanks. Link to comment Share on other sites More sharing options...
shokinro Posted November 21, 2010 Share Posted November 21, 2010 Have you tried to set display_errors to “on” in file /config/config.inc.php to see if there is any error occurs.@ini_set(‘display_errors’, ‘on’);If you have set display errors and there is no error displayed, then it is difficult figure out without look into the code.Will you post your URL here or PM me so that I can take look.By the way, as I know there are some issues with Paypal 1.7 when use multiple currency.Here you can find more Link to comment Share on other sites More sharing options...
shokinro Posted November 21, 2010 Share Posted November 21, 2010 I have got message via PM. I think it must be configuration issue.1. Please check permission of folder and file is correct or not folder: 755 file: 6442. Check if following setting is set or not. This should be in /config/defines.inc.php file define('_CAN_LOAD_FILES_', 1);Let me know your result. Link to comment Share on other sites More sharing options...
stevebob Posted November 21, 2010 Share Posted November 21, 2010 the line in defines.inc.php is currently: define('_CAN_LOAD_FILES_', 1);Which folder/file do I need to check permissions for? I set permissions according to the wiki: http://www.prestashop.com/wiki/Installing_And_Updating_PrestaShop_Software/The config.inc.php file is 644 and the colfig folder is 777 Link to comment Share on other sites More sharing options...
shokinro Posted November 21, 2010 Share Posted November 21, 2010 I am really curious what is the cause. Is it possible to give me temporary FTP permission to access your site, so that I could take look to see if I could find anything. I can not guarantee fix your problem, but I will take a look. You can send access info by PM. Link to comment Share on other sites More sharing options...
shokinro Posted November 22, 2010 Share Posted November 22, 2010 @stevebobI have fixed your problem. Please go check it.As I predicted, the problem is caused by permission. You must permission as followingfolder: 755file: 644 Link to comment Share on other sites More sharing options...
stevebob Posted November 22, 2010 Share Posted November 22, 2010 Thank you very much. I'm still not sure which folder(s) need to be 755 and which file(s) need to be 644, but it's working.Thanks again! Link to comment Share on other sites More sharing options...
shokinro Posted November 22, 2010 Share Posted November 22, 2010 I’m still not sure which folder(s) need to be 755 and which file(s) need to be 644, but it’s working. All folders (755) that contain php or tpl or images (just some of them)All files listed above, but not limited to must have 644 permissionWhat I changed for youmodules foldermodules/paypal folder and all its filescheque folder and all its filesYou can go there to compare with other folders and files Link to comment Share on other sites More sharing options...
jcasub Posted August 21, 2015 Share Posted August 21, 2015 Hello. I have this same issue redirecting to my Home page.I have paypal module configurated on a multistore. 1 ULR from pront end redirect correctly to paypal. The other URL from China shop, it redirects to Home page. Somebody know how to solve? Any error appear... Link to comment Share on other sites More sharing options...
Recommended Posts