Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Kasper.S

Archived
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Real Name
    Kasper.S

Kasper.S's Achievements

  1. Hello, I am installing meta tags 3.0a to OSC MS1. I have a default mega tags sql-script which should create the needed table. When I tried to execute it from shell and from mysql-adminstrator I got these: From shell: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/home/magicshroom/mega_tags.sql' at line 1 From mysql-adminstrator (Server: MySQL 4.0.20-standard-log, Client: MySQL Client Version 5.0.15): Error executing SQL commands to create table. MySQL Error Nr. 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL DEFAULT '', `description` VARCHAR NOT NULL DEFAULT The script: CREATE TABLE meta_tags ( meta_id int(11) NOT NULL auto_increment, categories_id int(11) NOT NULL default '0', manufacturers_id int(11) NOT NULL default '0', keywords varchar(255) NOT NULL default '', description varchar(255) NOT NULL default '', title varchar(255) NOT NULL default '', PRIMARY KEY (meta_id) ) TYPE=MyISAM; What could be wrong in syntax or what a hell? I am quite newbie with these. - Cheers Kasper.S
  2. ot_shipping.php: <?php /* $Id: ot_shipping.php,v 1.15 2003/02/07 22:01:57 dgw_ Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ class ot_shipping { var $title, $output; function ot_shipping() { $this->code = 'ot_shipping'; $this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE; $this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION; $this->enabled = ((MODULE_ORDER_TOTAL_SHIPPING_STATUS == 'true') ? true : false); $this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER; $this->output = array(); } function process() { global $order, $currencies; if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') { switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; case 'both': $pass = true; break; default: $pass = false; break; } // if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { // $order->info['shipping_method'] = $this->title; // $order->info['total'] -= $order->info['shipping_cost']; // $order->info['shipping_cost'] = 0; // } if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) || ($order->info['payment_method'] == 'transfer')) { $order->info['shipping_method'] = $this->title; $order->info['total'] -= $order->info['shipping_cost']; $order->info['shipping_cost'] = 0; } } $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_')); if (tep_not_null($order->info['shipping_method'])) { if ($GLOBALS[$module]->tax_class > 0) { $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); } $this->output[] = array('title' => $order->info['shipping_method'] . ':', 'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']), 'value' => $order->info['shipping_cost']); } } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function keys() { return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', 'Do you want to display the order shipping cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } } ?>
  3. Hello, Please, could somebody help with this. I am trying to get free shipping when transfer payment method is used. Now shipping is free if order is more that 150?. This is current configuration from admin for shipping cost at order total module: Display Shipping Do you want to display the order shipping cost? *true false Sort Order Sort order of display. Allow Free Shipping Do you want to allow free shipping? *true false Free Shipping For Orders Over Provide free shipping for orders over the set amount. 150 Provide Free Shipping For Orders Made Provide free shipping for orders sent to the set destination. *national international both In the code at ot_shipping.php I tried this change but did'nt get it working: function process() { global $order, $currencies; if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') { switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; case 'both': $pass = true; break; default: $pass = false; break; } //original //if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { // $order->info['shipping_method'] = $this->title; // $order->info['total'] -= $order->info['shipping_cost']; // $order->info['shipping_cost'] = 0; // } //fixed if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) || ($order->info['payment_method'] == 'transfer')) { $order->info['shipping_method'] = $this->title; $order->info['total'] -= $order->info['shipping_cost']; $order->info['shipping_cost'] = 0; } } And it would be nice to get payment method selection to admin where payment method can be selected for free shipping like: Free shipping for payment method *transfer cod ...or something like that - Regards, Kasper.S
×
×
  • Create New...