Community Add-Ons
payment method depends on shipping method
for osCommerce Online Merchant v2.2
With this contribution you can select which payment method should work with which shipping method!
eg. if the shipping is free, you don´t want to offer cod:
catalogincludesmodulespaymentcod.php
(it also works in any other payment module!)
look for:
// class methods
function update_status() {
global $order;
change to:
// class methods
function update_status() {
global $order, $shipping;
after:
if ($check_flag == false) {
$this->enabled = false;
}
}
insert:
// disable if shipping is free - start
if ($shipping['id']=="free_free") {
$this->enabled = false;
}
// disable if shipping is free - end
Shipping IDs:
free: free_free
table: table_table
pickup: pickup_pickup
etc.
just:
"shippingmodulname_shippingmodulname"
-------------------------------------------------
z.B Wenn der Versand versandkostenfrei ist, soll Nachnahme deaktiviert werden:
catalogincludesmodulespaymentcod.php
(geht aber auch in jedem anderen payment modul)
suche:
// class methods
function update_status() {
global $order;
ändern in:
// class methods
function update_status() {
global $order, $shipping;
nach:
if ($check_flag == false) {
$this->enabled = false;
}
}
folgendes einfügen:
// Deaktivieren wenn Versandkostenfrei - start
if ($shipping['id']=="free_free") {
$this->enabled = false;
}
// Deaktivieren wenn Versandkostenfrei - ende
Shipping IDs:
Versandkostenfrei: free_free
Tabellarisch: table_table
Selbstabholer: pickup_pickup
usw.
also "Versandmodulname_Versandmodulname"
It's a very simple mod. Thank you Werner. I'have just uploaded a .txt file with updated instructions.
