Jump to content

Marcog85

Members
  • Content count

    8
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Marco
  1. I'm trying for a few days to get an extra module PIPC(Price per Item, Per Country) working under the MVS module but without any succes. The module can be installed in the admin_area but when I place an order I get a blank screen ar shipping_checkout(the message is something like "Redirect without ending so stopping this process"). I get the message/screen also when I disable the module, it only disappear when I really delete the module. Who can give me a hand with this, I guess it's something in the quote funtion ? Thanks in advance Marco <?php /* $Id: pipc.php,v 1.00 2007/02/26 16:16:52 Bill Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ class pipc { var $code, $title, $description, $icon, $enabled, $num_groups; // class constructor function pipc() { global $order, $vendors_id; $this->code = 'pipc'; $this->title = MODULE_SHIPPING_PIPC_TEXT_TITLE; $this->description = MODULE_SHIPPING_PIPC_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_PIPC_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_PIPC_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_PIPC_STATUS == 'True') ? true : false); // CUSTOMIZE THIS SETTING FOR THE NUMBER OF GROUPS NEEDED $this->num_groups = 4; } //MVS start function sort_order($vendors_id = '1') { $sort_order = 'MODULE_SHIPPING_PIPC_SORT_ORDER_' . $vendors_id; if (defined($sort_order)) { $this->sort_order = constant($sort_order); } else { $this->sort_order = '-'; } return $this->sort_order; } function tax_class($vendors_id = '1') { $this->tax_class = constant('MODULE_SHIPPING_PIPC_TAX_CLASS_' . $vendors_id); return $this->tax_class; } function enabled($vendors_id = '1') { $this->enabled = false; $status = @ constant('MODULE_SHIPPING_PIPC_STATUS_' . $vendors_id); if (isset ($status) && $status != '') { $this->enabled = (($status == 'True') ? true : false); } if (($this->enabled == true) && ((int) constant('MODULE_SHIPPING_PIPC_ZONE_' . $vendors_id) > 0)) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int) constant('MODULE_SHIPPING_PIPC_ZONE_' . $vendors_id) . "' and zone_country_id = '" . $this->delivery_country_id . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $this->delivery_zone_id) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } //if } //if return $this->enabled; } function zones($vendors_id = '1') { if (($this->enabled == true) && ((int) constant('MODULE_SHIPPING_PIPC_ZONE_' . $vendors_id) > 0)) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_PIPC_ZONE . "' and zone_country_id = '" . $this->delivery_zone_id . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $this->delivery_zone_id) { $check_flag = true; break; } //if } //while if ($check_flag == false) { $this->enabled = false; } //if } //if return $this->enabled; } //function //MVS End // class methods function quote($method = '', $module = '', $vendors_id = '1') { global $order, $shipping_weight, $total_count, $shipping_num_boxes; $dest_country = $order->delivery['country']['title']; $dest_zone = 0; for ($i = 1; $i <= $this->num_groups; $i++) { $countries_table = constant('MODULE_SHIPPING_PIPC_COUNTRIES_' . $vendors_id ."_".$i); $country_groups = split("[,]", $countries_table); if (in_array($dest_country, $country_groups)) { $dest_zone = $i; break; } } if ($dest_zone == 0) { $groups_cost = constant('MODULE_SHIPPING_PIPC_COST_DEFAULT_'. '_' . $vendors_id); $handle_cost = constant('MODULE_SHIPPING_PIPC_HANDLING_DEFAULT_'. '_' . $vendors_id); } else { $groups_cost = constant('MODULE_SHIPPING_PIPC_COST_' . $vendors_id . '_' . $dest_zone); $handle_cost = constant('MODULE_SHIPPING_PIPC_HANDLING_' . $vendors_id . '_' . $dest_zone); } $shipping_method = MODULE_SHIPPING_PIPC_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_PIPC_TEXT_UNITS; $shipping_cost = $groups_cost * $total_count + $handle_cost; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PIPC_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost))); // $this->tax_class = constant(MODULE_SHIPPING_INDVSHIP_TAX_CLASS_ . $vendors_id); if ($this->tax_class($vendors_id) > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); return $this->quotes; } function check($vendors_id = '1') { if (!isset ($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_PIPC_STATUS_" . $vendors_id . "'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install($vendors_id = '1') { tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) VALUES ('Enable PIPC Method', 'MODULE_SHIPPING_PIPC_STATUS_" . $vendors_id . "', 'True', 'Do you want to offer Per Item / Per Country rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Tax Class', 'MODULE_SHIPPING_PIPC_TAX_CLASS_" . $vendors_id . "', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Sort Order', 'MODULE_SHIPPING_PIPC_SORT_ORDER_" . $vendors_id . "', '0', 'Sort order of display.', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Default Per Item Price', 'MODULE_SHIPPING_PIPC_COST_DEFAULT_" . $vendors_id . "', '0', 'Do not use a currency sign and use a dot to seperate the decimals.', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Default Handling Fee', 'MODULE_SHIPPING_PIPC_HANDLING_DEFAULT_" . $vendors_id . "', '0', 'Handling Fee for default shipping group', '6', '0', now(), '" . $vendors_id . "')"); for ($i = 1; $i <= $this->num_groups; $i++) { $default_countries = ''; if ($i == 1) { $default_countries = 'China,Hong Kong,United States,United Kingdom'; $default_price = '1.00'; } else if ($i == 2) { $default_countries = 'Zambia,India'; $default_price = '2.00'; } else if ($i == 3) { $default_countries = 'Japan'; $default_price = '10.00'; } tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Group " . $i ." Countries', 'MODULE_SHIPPING_PIPC_COUNTRIES_" . $vendors_id ."_".$i . "', '" . $default_countries . "', 'Comma separated list of full country names that are part of Group " . $i . ".', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Group " . $i ." Per Item Price', 'MODULE_SHIPPING_PIPC_COST_" . $vendors_id ."_".$i . "', '" . $default_price . "', 'Do not use a currency sign and use a dot to seperate the decimals.', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Group " . $i ." Handling Fee', 'MODULE_SHIPPING_PIPC_HANDLING_" . $vendors_id . "_".$i . "', '0', 'Handling Fee for this shipping group', '6', '0', now(), '" . $vendors_id . "')"); } } function remove($vendors_id) { tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys($vendors_id)) . "')"); } function keys($vendors_id) { $keys = array("MODULE_SHIPPING_PIPC_STATUS_$vendors_id", "MODULE_SHIPPING_PIPC_TAX_CLASS_$vendors_id", "MODULE_SHIPPING_PIPC_SORT_ORDER_$vendors_id", "MODULE_SHIPPING_PIPC_COST_DEFAULT_$vendors_id", "MODULE_SHIPPING_PIPC_HANDLING_DEFAULT_$vendors_id"); for ($i = 1; $i <= $this->num_groups; $i++) { $keys[] = 'MODULE_SHIPPING_PIPC_COUNTRIES_' . $vendors_id . '_' . $i; $keys[] = 'MODULE_SHIPPING_PIPC_COST_' . $vendors_id . '_' . $i; $keys[] = 'MODULE_SHIPPING_PIPC_HANDLING_' . $vendors_id . '_' . $i; } return $keys; } } ?>
  2. Marcog85

    MVS PIPC

    osCommerce Online Merchant v2.2 RC2a am I using, thanks so far.
  3. Marcog85

    MVS PIPC

    http://www.oscommerce.com/community/contributions,4934 is the original PIPC contribution. http://www.oscommerce.com/community/contributions,4129, is the MVS 1.0 contribution. I guess the difficultness is to combine the array of the countries. Thanks so far. Marco
  4. Marcog85

    MVS PIPC

    Hello, I'm hoping that someone has modified the shipping module PIPC(price per item per country) for MVS because It's to difficult for me to make the modifications myself. Hope someone can help me. Thanks in advance. Marco
  5. You're right, was missing <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> sorry about that, all works well.
  6. Are there people who has the same problem as I. Image in Fancybox aren't resized correctly in IE, FF is okay. http://shop.myastrolife.nl/product_info.php?products_id=240. As you can see image in IE8 isn't resized, in FF it is. Is this a stylesheet issue ? Hope someone can help me. Thanks again.
  7. Thanks a lot, this works really fine. Superb
  8. Really great contribution, thanks. After some time it was working for me but I've still one question. Beneath the original image there is a standard text, TEXT_CLICK_TO_ENLARGE. However when I click on the individual images I can go forward/backward but not when I click on the text. I know I've put the array in this part but I'm not sure how, who can help me with this. //FILE product_info.php if($vertical_format) { $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { if ($thumb) { $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image); $source=str_replace('&','&',$image[1]); } echo '<a rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>'; ++$row; if ($row > $image_group) { $row = 1; } } } ?> //THIS IS WHERE IT IS ALL ABOUT-->HOW CAN I GET ALSO FORWARD/BACKWARD BUTTONS ON THE IMAGE ??? <?php echo '<a class="enlarge" title="'.$product_info['products_name'].'" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?></div> Thanks in advance..
×