PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

Payment and Shippingmodules having major configuration issue!!

34 replies to this topic
#1
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts
There is a major issue with the payment en shipping modules in PrestaShop.

The problem is that if I set-up my shop with 2 carriers (pickup and deliver) and 2 payment (cash on pickup and bankwire) I cannot force the carrier modules to only have 1 payment module.

Lets say my customer chooses the deliver-carrier option, I want him to only have the Bankwire payment option and not the CasOnPickup.
Same goes for any other set-up I create.

In osCommerce we have Ship2Pay, we need such a thing for PrestaShop a.s.a.p.

Or am I missing the point?
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#2
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts
BUMP!

Is there no-one who recognize this problem?
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#3
Merchant

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts
Hi TropischBruin,

My guess is that we have to look in order.php and there combine those two items.
I will give it some attention after the Xmass hollidays.

#4
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts

From 1229970648:

Hi TropischBruin,

My guess is that we have to look in order.php and there combine those two items.
I will give it some attention after the Xmass hollidays.


I'm not sure if this is want you want.
I think a better solution is to have options within PS where you can use somethin like a dropdown box in the carrier configuration to choose:

1. when left empty the carrier can be used with any payment module
2. when set to cash-on-pickup it will only allow this payment module and nothing else.

Thans anyway foor your time!
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#5
ruilong

    PrestaShop Addict

  • Moderators
  • 690 posts
I don't think there is room for this in prestashop now (not with a module atleast)
but it should be possible to make some kind of check on the paymentmodule code and see what carrier is selected.

you can get what you want, if you modify the payment module.
$cart->id_carrier should be something you might want to check at
Modules and themes for prestashop.
E-butik med prestashop inkl hosting och gratis installation.

#6
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts

From 1230559673:

I don't think there is room for this in prestashop now (not with a module atleast)
but it should be possible to make some kind of check on the paymentmodule code and see what carrier is selected.

you can get what you want, if you modify the payment module.
$cart->id_carrier should be something you might want to check at


OK, so the payment-modules should check on the carriers used.
Hmm, that is not so easy to do (meaning that I'm no php-coder ;-) ).

Adding a code I can, thinking on what code to use I cannot.
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#7
Merchant

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts
Is it an idea to add the carrier and payment on the product page in the admin panel?
Let's say you have a product X, a carrier Y and a payment Z.

Now on the catalog> product page you choose the carrier and the payment that you want this product to have.
So you can tell PS that you want product X only uses carrier Y and payment Z, product A can use carrier B and payment C, for example.

#8
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts

From 1230574499:

Is it an idea to add the carrier and payment on the product page in the admin panel?
Let's say you have a product X, a carrier Y and a payment Z.

Now on the catalog> product page you choose the carrier and the payment that you want this product to have.
So you can tell PS that you want product X only uses carrier Y and payment Z, product A can use carrier B and payment C, for example.


That is to much of a hassle.

Best is:

Set: Carrier1 = payment1
Set: Carrier2 = payment2

Of no choice (set) is made then:

carrier 1 = payment1 or payment2
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#9
Merchant

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts
Hhmmm..

Ok, but i have some products like licenses, who can be payed after delivery (in dutch: op rekening)
When the customer does'nt pay the bill, i allways can cancell the license.
However, when a customer buys a solar panel, and he can pay after delivery, and he does'nt pay his bill then it is very difficult to get back my goods. When i can sat that the solar panel can be shipped by TNT and payed by iDeal, i have no risk.

#10
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts
This you can do by using the weight (gewicht) of the product.

A license weights nothing compared to a solarscreen :lol:
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#11
Merchant

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts
Ok, i did not looked at this possibility yet Thx. :red:
And it depends if you're talking about financial or natural weights. :-)

#12
Paul C

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1004 posts
I think this is only possible (currently) by editing the payment modules. In effect you could choose not to display a payment option if a particular carrier has been selected (using a hard-coded carrier_id).

In payment modules there is always a hookPayment() function which displays the payment method. Within this function you would do your test for the carrier.

So, for example if someone has picked a carrier that takes payment on delivery, you don't want to allow payment by PayPal to be an option. In paypal.php (line 139) there is:


public function hookPayment($params)
{
global $smarty;

$address = new Address(intval($params['cart']->id_address_invoice));
$customer = new Customer(intval($params['cart']->id_customer));
$business = Configuration::get('PAYPAL_BUSINESS');
$currency = $this->getCurrency();

etc.

Lets's say your cash on delivery carrier has the id of 2, then you could change the above to:


public function hookPayment($params)
{
global $smarty;

$cart = new Cart(intval($params['cart']));
if (intval($cart->id_carrier==2)) return;

$address = new Address(intval($params['cart']->id_address_invoice));
$customer = new Customer(intval($params['cart']->id_customer));
$business = Configuration::get('PAYPAL_BUSINESS');
$currency = $this->getCurrency();


This will disable PayPal for any checkout processes where the customer has selected the carrier with the ID of 2.

A bit messy, but it would provide a quick fix.

Paul
Free Prestashop modules and developer resources

Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2

Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net

#13
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts

From 1231195921:

I think this is only possible (currently) by editing the payment modules. In effect you could choose not to display a payment option if a particular carrier has been selected (using a hard-coded carrier_id).

A bit messy, but it would provide a quick fix.

Paul


Paul, this will do I'll guess.

I will testrun tonight.

Thanks!
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#14
ToysStore

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts
Hi Paul,

Quote

I have tried this little tweak but it seems not to work.
Did you actually test it?


Never mind i found it :)

#15
sassur

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts
Hi.

I have made a patch that enable Payment restrictions depending on the carrier.

Download it from http://alphaspel.se/...estrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.

Best regards Fredrik

#16
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts

From 1232479730:

Hi.

I have made a patch that enable Payment restrictions depending on the carrier.

Download it from http://alphaspel.se/...estrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.

Best regards Fredrik


Fantastic!! Nice work.

Thanks a lot. Yuppyyyy!!
My Blog
PS v1.4.7.0

#17
trinigemini

    PrestaShop Newbie

  • Members
  • Pip
  • 13 posts

From 1232479730:

Hi.

I have made a patch that enable Payment restrictions depending on the carrier.

Download it from http://alphaspel.se/...estrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.

Best regards Fredrik


hey...i downloaded this patch...and followed the README.txt file...and im applying the patch after the installation bcuz i had prestashop installed and everything already...BUT there's one part i dont understand...
"Then add the table found in module_carrier.sql to the database, do not forgett to change PREFIX."
Please explain what this means...thanks so much :)

#18
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts

From 1232585744:



hey...i downloaded this patch...and followed the README.txt file...and im applying the patch after the installation bcuz i had prestashop installed and everything already...BUT there's one part i dont understand...
"Then add the table found in module_carrier.sql to the database, do not forgett to change PREFIX."
Please explain what this means...thanks so much :)


This is done via phpMyAdmin.
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#19
tintacreative

    PrestaShop Apprentice

  • Members
  • PipPip
  • 34 posts
i got it right tho, and thanks a lot for this great applications.

For those who dont know how to upload the module_carrier.sql. These are the steps

1. Login into your cpanel
2. Click on phpmyadmin
3. On the left side, click on the database you use for your prestashop.
4. You can see list of tables on your left, and then on top, click import tabs.
5. Before you import the table, take a look at the prefix used by all the tables inside your database, and open the module_carrier.sql using notepad.
6. Change CREATE TABLE `PREFIX_module_carrier` PREFIX to the correct prefix used by your tables, in my case the prefix is ps_, so i change it to CREATE TABLE `ps_module_carrier`.
7. Save it.
8. At the import tab, browse the file, and click go.
9. Then everything should be ok.

Thanks again to the creator.

#20
sassur

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts
Thanks tintacreative for the description of getting the modifications into the database.