Jump to content

Mobile theme do not display custom payment modules.


Recommended Posts

Hello,

 

I have installed prestashop v1.5.3 and developed custom payment modules for it.

My problem is that the "payment_execution.tpl" do not display for my custom payment modules in the mobile theme.

Anytime i chose those payment methods the page loads to a blank page, but the default payment modules (bankwire, check ) works perfectly in the mobile theme.

 

Please I need your help.

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...

Umm.... this seems something quite evil from Prestashop. For payment modules they add the following condition

                $paypal_condition = '';
                $iso_code = Country::getIsoById((int)Configuration::get('PS_COUNTRY_DEFAULT'));
                $paypal_countries = array('ES', 'FR', 'PL', 'IT');
                if (Context::getContext()->getMobileDevice() && Context::getContext()->shop->getTheme() == 'default' && in_array($iso_code, $paypal_countries))
                        $paypal_condition = ' AND m.`name` = \'paypal\'';

And this $paypal_condition is appended to the available payment methods query, thus if you are in ES,FR,PL or IT browse with a mobile and use the default theme you'll only see paypal payment method.

 

You can see this condition in the file https://github.com/PrestaShop/PrestaShop/blob/master/classes/module/Module.php in newer versions inside the getPaypalIgnore method and in older ones directly in getPaymentModules

 

In order to get rid of this condition you should write overide this class uploading the following code to a new file in /overide/classes/module/Module.php

<?php
class Module extends ModuleCore
{
	public static function getPaypalIgnore()
	{
		return false;
	}

}

What I would like to know is if this behavior is really an error or if it is something intentional that Prestashop is doing to favor Paypal.

 

Why should appear anything related to Paypal in the prestashop core files?

Edited by ZhenIT Software (see edit history)
Link to comment
Share on other sites

Hi ZhenIT, this was in the core because PayPal was the preferred online payment method for mobile devices, and still is by FAR. Thankfully, due to our open-source nature, you can easily change the code to allow other, less used, mobile payment solutions. Open Source FTW :D . This has been discussed before and thanks for sharing your code change. Always make sure to back up before you change any code! Read this blog post for more information How to Manually Back Up your PrestaShop Database and Files

Link to comment
Share on other sites

  • 1 month later...

Hi all,

I installed mobile module on prestashop 1.4.7.0

everything works fine but the final checkout... always have the same problem "

  no payment module is available in your country

I tryed the solution you explain here but nothing.. same problem. Do I make some mistake?

 

Thanks to all in advance

 

Stefano

Link to comment
Share on other sites

  • 8 months later...

Hello Zhenti, benjamin, am using prestashop 1.5.6 and this fix dint work. I have cleared my cache, deleted my smarty compile files, renamed my class_index file all to no avail.

 

 

After clicking "i confirm my order" on the payment validation page, it loads but nothing happens. On clicking again i get a white page. I have set debug mode to true in my defines.inc.php and no error message is logged

My version of prestashop is 1.5.6.

 

Please help. my site is live and i need to use the mobile theme.

 

Thanks.

Edited by genny3021 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...