Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / i want to make moneyorder not OK if item shipping

i want to make moneyorder not OK if item shipping

Locked

Started by broeder on 21 Jul 2010, 4:01 PM · Views: 697

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
21 Jul 2010, 4:01 PM
#1
broeder avatar

broeder

New Zenner

Join Date:
Dec 2008
Posts:
49
Plugin Contributions:
0

Post #1 by broeder

Hi,

I am trying to disable payment by moneyorder on "item" delivery purchases.

I guess, some code is to be added in moneyorder.php.

Does anyone have a lead ?

Thanks a lot..

21 Jul 2010, 4:04 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Post #2 by kuroi

Probably better to make the change in the payment class, where it works out what payment methods are available. Otherwise your Zen Cart may think, and act, as though it has more methods available than it actually does.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

22 Jul 2010, 9:34 AM
#3
broeder avatar

broeder

New Zenner

Join Date:
Dec 2008
Posts:
49
Plugin Contributions:
0

Post #3 by broeder

Hi,

Thanks. Just to be sure, that would be in

includes\classes\payement.php ?

22 Jul 2010, 3:26 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Post #4 by kuroi

Actually, a little elf has just has just whispered in my ear that it would be better to go with your original plan and use your condition to set the $this->enabled class variable to true or false as appropriate.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

29 Jul 2010, 9:19 AM
#5
broeder avatar

broeder

New Zenner

Join Date:
Dec 2008
Posts:
49
Plugin Contributions:
0

Post #5 by broeder

Hi,

Thanks. This leads to a question regarding sessions, I guess. The code in moneyorder.php should use:

$_SESSION['cart']->stuff()

followed by conditions leading to $this->enabled = true or false

Does anyone know how to get the list of stuff() available at that stage ?

Thanks..

29 Jul 2010, 9:32 AM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Post #6 by kuroi

The session's only contribution to this is to hold the name of the object created by the cart class. You could try using var_dump() to see what's in there, and then extract what you need. This is usually good enough though, but if not, you would need to visit the cart class to see how the object is constructed.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)