Skip to content
Browse files

Inital a new payment modules "cfg" for shipping dependencies

Admin can make shippig dependencies in payment modules with a checkbox
Installed shipping modules will be displayed
This is only cfg_

Signed-off-by: Gergely <t-gely@freemail.hu>
  • Loading branch information...
1 parent 358949e commit 280aa5817d3ade2b699d6aa49a2b82271685ad6f @tgely committed
View
30 ...e/Admin/includes/functions/cfg_parameters/osc_cfg_set_shipping_methods_checkbox_field.php
@@ -0,0 +1,30 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ use osCommerce\OM\Core\Registry;
+
+ function osc_cfg_set_shipping_methods_checkbox_field($default, $key = null) {
+ $OSCOM_Database = Registry::get('Database');
+
+ $name = (empty($key)) ? 'configuration_value' : 'configuration[' . $key . '][]';
+
+ $shipping_array = array();
+
+ $Qshipping = $OSCOM_Database->query("select code from :table_templates_boxes where modules_group = 'Shipping' order by code");
+ $Qshipping->execute();
+
+ while ( $Qshipping->next() ) {
+ $shipping_array[] = array('id' => $Qshipping->value('code') . '_' . $Qshipping->value('code'),
+ 'text' => $Qshipping->value('code'));
+ }
+
+ return osc_draw_checkbox_field($name, $shipping_array, explode(',', $default), null, '<br />');
+ }
+?>

0 comments on commit 280aa58

Please sign in to comment.
Something went wrong with that request. Please try again.