Jump to content

a.forever

Members
  • Content count

    253
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by a.forever

  1. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    So upon further review of the USPS API it appears that they restricted pulling rates to only 13 ounces. So even though you can go to the post office and ship a 1 pound item, you can't use their online postage calculator to estimate postage costs for anything over 13 ounces. My only solution to this was to utilize and modify the Table shipping method that's already within osC. Props for still being alive. This module is still pretty great. Thanks for all your hard work many years ago!
  2. Arjan, If all you want is to change quantity automatically within catalog/shopping_cart.php then wouldn't this workaround be just as functional? $products_name .= '<br>' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'style="width: 65px;" min="0"', 'number') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . ' ' . tep_draw_button(NULL, 'fa fa-refresh', NULL, NULL, NULL, 'btn-info btn-xs') . ' ' . tep_draw_button(NULL, 'fa fa-remove', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&action=remove_product'), NULL, NULL, 'btn-danger btn-xs'); to $products_name .= '<br>' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'onfocusout="cart_quantity.submit();" style="width: 65px;" min="0"', 'number') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . ' ' . tep_draw_button(NULL, 'fa fa-refresh', NULL, NULL, NULL, 'btn-info btn-xs') . ' ' . tep_draw_button(NULL, 'fa fa-remove', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&action=remove_product'), NULL, NULL, 'btn-danger btn-xs');
  3. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    I would make any necessary line-by-line changes on the usps.php file that applies to you, since fortunately this is not a major upgrade. You don't even need to make updates for the Retail Ground services if you don't use them. The new 16/16 weight limit is probably required if you use Online, not Retail, rates since you can finally ship parcels under a pound. If what you have works for you, I wouldn't do anything ultra crazy and risk it breaking afterwards. Perhaps the next USPS change will prove more complicated.
  4. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    Updated the module. Only the includes/modules/shipping/usps.php file needs to be updated if you had the latest version prior to this new one. It looks like the new First-Class weight limit isn't in full effect anywhere. When USPS realizes this oversight and changes it, this module update will allow the new weight limits. One very important note is that the new defaulted pricing is Retail, not Online. This is because Commercial Base is being phased out, which means if you don't have a third-party postage provider account then you won't be getting discounted postage anyways. One less reason to use USPS' own Click-N-Ship now.
  5. a.forever

    Shipping Insurance - 2.3?

    I had a magical thought on this just now since I was testing the USPS API changes for the month. Did any of you change the Module -> Order Total -> Sort Order to 1) Subtotal, 2) Shipping, 3) Insurance, 4) Tax?
  6. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    It'll be replacing code and it's not just that one line. Two lines need to change, and you'll need to uninstall and reinstall the module for it to accept those changes (because the changes affect how the shipping module installs the new USPS Retail Ground). Will likely post an updated module on Sunday evening for this since I already have it working in testing, although I still think people should just use Priority Mail. But if you want to change it sooner (although the change won't be visible until January 17, 2016), for this particular module, all two instances of Standard PostRM should be replaced with USPS Retail GroundTM For the most part the USPS API changes won't affect most users, with the exception of First-Class Mail Parcel for shipments within the USA. The test server hasn't updated the new 16 ounce limit. And the current module is coded to only 13 ounces. That is a very simple 1-line change where in includes/modules/shipping/usps.php you find 13/16 and change it to 16/16
  7. a.forever

    Shipping Insurance - 2.3?

    Hmm. I can't seem to replicate the error using the settings provided. Here's a thought: if you changed Customer Chooses? Does the customer have a choice to elect insurance? from True to False and force insurance on an international order, does it still calculate incorrectly? Or perhaps everything is tallying correctly at customer checkout and something else is modifying the amount once the customer goes from your site to PayPal (I'm assuming a PayPal payment). If a PayPal payment is used, perhaps a review of the IPN History would be ideal for that transaction. The Message ID that PayPal keeps should identify all variables PayPal used to calculate the total payment.
  8. a.forever

    Shipping Insurance - 2.3?

    Sure; I can try to replicate the error using the info you give me.
  9. a.forever

    Shipping Insurance - 2.3?

    The domestic and international sections are pretty much copy/paste in the coding. Do you have an example for me that I could try and replicate? I can't seem to duplicate this error and can only assume either a tax error, zone error, or rounding error to be the cause for the overcharge.
  10. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    I thought about testing/fixing the Extra Services portion of this module, but been too busy. I've never tested it and assume it's just broken. Perhaps this summer and definitely not this month. The workaround seems to be okay and I too have recently restructured the sort order on my own store. Will look into it someday... Just wanted to point out that if your Configuration > Shipping/Packaging > Max Package Weight is set AND your customer's shopping cart exceeds that weight, this module will [ (shopping cart weight / max package weight) * shipping cost for one package] to calculate postage costs. Max Package Weight essentially assumes each box you plan to ship will not exceed that weight. I've memorized most of them, since USPS sneakily prints those weight limits on most of their Flat Rate/Regional Rate boxes. But low and behold USPS has intentions to change domestic First-Class (including its CLASSID for parcels) and almost all Extra Service <ServiceID> around May 31, 2015.
  11. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    It shouldn't put Express on top. Are you sure $sort_id is first in the array_multisort() and not $sort_cost? And I don't think this particular module even cares about address. It just pulls postal code and weights.
  12. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    I'm assuming that First-Class International Package, Priority Mail International, and Priority Mail Express International are the only three service methods available. If so, then your personal fix to the usps.php code should be something like: FIND: array_multisort($sort_cost, (MODULE_SHIPPING_USPS_RATE_SORTER == 'Ascending' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods); REPLACE WITH: array_multisort($sort_id, (MODULE_SHIPPING_USPS_RATE_SORTER == 'Descending' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods); That should put Priority Mail International on top, Priority Mail Express International in the middle, and First-Class Package International Service at the bottom. Does this trick work for you?
  13. I feel game to figure this out, even though I don't check these boards as often as I once did. I assume you cloned this contribution: http://addons.oscommerce.com/info/164 I have an older version of that installed and did clone it a long time ago. There appears to be 5 instances of "spu" (including the $Id on line 3) and 21 instances of "_SPU_" that need to be changed. Personally I wouldn't use additional special characters or common words in the renaming process, so I'd opt for something like "frcoll" and "_FRCOLL_" and "frcoll.php" instead. Additionally this module has some kind of zone check, so ensure your cloned module settings and the shipping zone for your purchase allows the module to even activate properly. And if that doesn't work, you can compare to my cloned version of spu.php to vaspu.php (this is version 1.4 and I had commented out some of the zone checks to suit my store's needs): <?php /* $Id: vaspu.php,v 1.4 2002/11/10 14:29:56 mattice Exp $ CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164'>http://www.oscommerce.com/community/contributions,164) Based upon flat.php / vaspu.php by M. Halvorsen (http://www.arachnia-web.com) Made to work with latest check-out procedure by Matthijs (Mattice) >> e-mail: mattice@xs4all.nl >> site: http://www.matthijs.org TO TRANSLATE IN GERMAN !! osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License CHANGES: - formatted to work with latest checkout procedure - removed icon references - updated the db queries */ class vaspu { var $code, $title, $description, $icon, $enabled; // class constructor function vaspu() { global $order; $this->code = 'vaspu'; $this->title = MODULE_SHIPPING_VASPU_TEXT_TITLE; $this->description = MODULE_SHIPPING_VASPU_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_VASPU_SORT_ORDER; $this->icon = ''; $this->enabled = ((MODULE_SHIPPING_VASPU_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_VASPU_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id, zone_country_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_VASPU_ZONE . "' and zone_country_id = '" . $order->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'] == $order->delivery['zone_id']) { } elseif ($check['zone_country_id'] == $order->delivery['country']['id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } function quote($method = '') { global $order,$customer_id; $codep_query = tep_db_query("select c.configuration_value, ab.entry_postcode from " . TABLE_CONFIGURATION . " c, " . TABLE_ADDRESS_BOOK . " ab where c.configuration_key = 'MODULE_SHIPPING_VASPU_ZIP' and ab.customers_id = '" . (int)$customer_id . "'"); $codep = tep_db_fetch_array($codep_query); $dept_allow = split("[, ]", $codep['configuration_value']); $cust_cp = substr($codep['entry_postcode'], 0, 2); if((in_array($cust_cp, $dept_allow))||($codep['configuration_value'] == '')){ $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_VASPU_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_VASPU_TEXT_WAY, 'cost' => MODULE_SHIPPING_VASPU_COST))); return $this->quotes; }else{ return; } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_VASPU_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } 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 ('Enable Store Pick Up', 'MODULE_SHIPPING_VASPU_STATUS', 'True', 'Do you want to offer Store Pickup?', '6', '0', '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 ('Store Pickup Cost', 'MODULE_SHIPPING_VASPU_COST', '0.00', 'What is the pickup cost? (The Handling fee will NOT be added.)', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_VASPU_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Store Pick Up Zip Code Allowed', 'MODULE_SHIPPING_VASPU_ZIP', '01, 07, 26, 38, 42, 69, 74', 'Departement autorisé pour le retrait magasin ?', '6', '0', 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_SHIPPING_VASPU_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { $keys = ''; $keys_array = $this->keys(); for ($i=0; $i<sizeof($keys_array); $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")"); } function keys() { return array('MODULE_SHIPPING_VASPU_STATUS', 'MODULE_SHIPPING_VASPU_COST', 'MODULE_SHIPPING_VASPU_SORT_ORDER', 'MODULE_SHIPPING_VASPU_ZONE', 'MODULE_SHIPPING_VASPU_ZIP'); } } ?>
  14. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    Yeah, my bad. I wasn't thinking when I did this 18 months ago as I was still working under osC 2.2 RC2a. It works fine with osC 2.3.4, and I suppose we should mention that more often each time we push a new update. Perhaps in a readme.txt, new update description, etc.
  15. a.forever

    USPS Methods and South Korea

    This might be a country issue. USPS has South Korea listed as: South Korea (Korea, Republic of) Is it listed like that in your osCommerce?
  16. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    So that error I reported went away. +1. Here are some new problems: Media Mail and Library Mail no longer function. I'm assuming it's the change to Flat. So, I just reverted back to the Parcel coding back in your #3 version. I also figured out why Small FRB wasn't showing up for international. The dimensions are causing this. Length, Width, and Height should probably be hard-coded to 0.2 for now. Doing so makes the service appear! Finally, this is a cosmetic issue I found on Chrome. It's been bugging me, but I never bothered to push a fix. I personally think that 5px matters. Around line 739, FIND: <div style="width:50px;float:right;text-align:center;">Handling</div> CHANGE TO: <div style="width:55px;float:right;text-align:center;">Handling</div> Around line 749, FIND: $string .= '<div style="float:left;">' . preg_replace(array ( CHANGE TO: $string .= '<div style="float:left;padding:5px;">' . preg_replace(array ( Around line 780, FIND: $string .= '<div style="width:50px;float:right;text-align:center;">$ CHANGE TO: $string .= '<div style="width:55px;float:right;text-align:center;">$ EDIT: I think I've attached my file to this post. Plus, some pictures of the working attached file. usps.php
  17. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    When using an international address, I get the following error: Warning: Illegal string offset 'ServiceName' in /html/includes/modules/shipping/usps.php on line 118 EDIT: Also, you need to remove all ** in function get_usps_services_list() for international services. And within the same function, Global Express GuaranteedRT should probably change to Global Express GuaranteedRM.
  18. Based on the email USPS sent, that seems to be the correct way to test. But it's still heavily reliant on the USPS side being up, running, and accurate with all the stuff they say they're going to do.
  19. Nope. Based on the last time, USPS said they were instituting the changes they emailed. But then they added several more additional changes without telling us (i.e. 1-Day, 2-Day, 3-Day). Which in turn, broke the module. My main concern is their First-Class Package Service Update, which I hope is limited to international. I'm very confident this USPS update will shatter something in international shipping. Then there's the Length/Width/Height filtering out Flat Rate. And maybe Media/Library Mail if anyone uses those. This is what I'll probably be doing on Labor Day weekend. ~~ugh
  20. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    Standard Post has changed. According to USPS, Standard Post is "Available for Zones 5-9, up to 70 lbs. Prices in Zones 1-4, up to 70 lbs, are only for the mailing of hazardous materials, live animals, or other items required to be shipped by ground/surface transportation." Additional fine print reads that it's only available at retail, so if you opt for online prices using this module you won't get rates anyways. Could probably override this restriction in a future update, or make it its own unique shipping module, but it seems USPS is passively persuading everything to jump to Priority Mail. Parcel Select is a domestic business service, in the sense that it isn't a regular service you can find at your post office. On the USPS website, it would be classified under Business Solutions along with the Every Door Direct Mail and other crazy business shipping options like Critical Mail, Periodicals, Priority Mail Open & Distribute, etc. Most of these services, while cheaper, don't apply to the average person unless you have some sort of permit or agreement with the post office and ship a certain required volume per day/week/month. It also has its own Business Price Calculator, which I don't want to learn at all. tl;dr -- No, switch to Priority Mail or other shipper instead of using Standard Post.
  21. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    Thanks for reporting this. I've uploaded a fix that should work nicely. Let me know how it goes. You should be able to utilize all three services properly without any duplicated services in your results.
  22. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    If your total package weight is under 13 ounces, consider using First-Class Mail® Parcel as your shipping method? Then fiddle around with your tare weight settings, individual product weight, and handling costs per shipping service (which can be negative if I recall). I believe First-Class Mail® Parcel has a max shipping cost of $4.12 for a 13-ounce-total package. Or depending on package weight, fully utilize the Priority Mail services because it comes with $50 insurance anyways and is generally a faster shipping service. Standard Post service pulls a $5ish rate anyways.
  23. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    You say "Standard Shipping", but are you referring to Standard Post? If so, you might run into problems since USPS has changed the requirements for that method. You can only use Standard Post for USPS Shipping Zones 5-9, While USPS Shipping Zones 1-4 are only for the mailing of hazardous materials, live animals, or other items required to be shipped by ground/surface transportation. If you're shipping those items, then there might be an issue with this add-on since I don't recall this module having RateV4Request / Package / Content / ContentType ever being programmed into it. That being said, you should probably use Priority Mail for general shipping of packages and then add your own handling fees to balance costs.
  24. a.forever

    USPS Rate V4, Intl Rate V2 (official support thread)

    If you did all that, did you remember to modify the admin/modules.php file on your fresh osC 2.3.4 install? I saw kymation post about that earlier, but didn't see any response as whether it was actually completed. Your admin/modules.php file should look something like this for a osC 2.3.4 install (also attached to this post for convenience): <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2013 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $set = (isset($HTTP_GET_VARS['set']) ? $HTTP_GET_VARS['set'] : ''); $modules = $cfgModules->getAll(); if (empty($set) || !$cfgModules->exists($set)) { $set = $modules[0]['code']; } $module_type = $cfgModules->get($set, 'code'); $module_directory = $cfgModules->get($set, 'directory'); $module_language_directory = $cfgModules->get($set, 'language_directory'); $module_key = $cfgModules->get($set, 'key');; define('HEADING_TITLE', $cfgModules->get($set, 'title')); $template_integration = $cfgModules->get($set, 'template_integration'); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'save': reset($HTTP_POST_VARS['configuration']); while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { // USPS START if (is_array($value)) $value = implode(', ', $value); // USPS END tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])); break; case 'install': case 'remove': $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $class = basename($HTTP_GET_VARS['module']); if (file_exists($module_directory . $class . $file_extension)) { include($module_directory . $class . $file_extension); $module = new $class; if ($action == 'install') { if ($module->check() > 0) { // remove module if already installed $module->remove(); } $module->install(); $modules_installed = explode(';', constant($module_key)); if (!in_array($class . $file_extension, $modules_installed)) { $modules_installed[] = $class . $file_extension; } tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $modules_installed) . "' where configuration_key = '" . $module_key . "'"); tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class)); } elseif ($action == 'remove') { $module->remove(); $modules_installed = explode(';', constant($module_key)); if (in_array($class . $file_extension, $modules_installed)) { unset($modules_installed[array_search($class . $file_extension, $modules_installed)]); } tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $modules_installed) . "' where configuration_key = '" . $module_key . "'"); tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set)); } } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class)); break; } } require(DIR_WS_INCLUDES . 'template_top.php'); $modules_installed = (defined($module_key) ? explode(';', constant($module_key)) : array()); $new_modules_counter = 0; $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $directory_array = array(); if ($dir = @[member=dir]($module_directory)) { while ($file = $dir->read()) { if (!is_dir($module_directory . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { if (isset($HTTP_GET_VARS['list']) && ($HTTP_GET_VARS['list'] = 'new')) { if (!in_array($file, $modules_installed)) { $directory_array[] = $file; } } else { if (in_array($file, $modules_installed)) { $directory_array[] = $file; } else { $new_modules_counter++; } } } } } sort($directory_array); $dir->close(); } ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> <?php if (isset($HTTP_GET_VARS['list'])) { echo ' <td class="smallText" align="right">' . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_MODULES, 'set=' . $set)) . '</td>'; } else { echo ' <td class="smallText" align="right">' . tep_draw_button(IMAGE_MODULE_INSTALL . ' (' . $new_modules_counter . ')', 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&list=new')) . '</td>'; } ?> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MODULES; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SORT_ORDER; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php $installed_modules = array(); for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) { $file = $directory_array[$i]; include($module_language_directory . $language . '/modules/' . $module_type . '/' . $file); include($module_directory . $file); $class = substr($file, 0, strrpos($file, '.')); if (tep_class_exists($class)) { $module = new $class; if ($module->check() > 0) { if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) { $installed_modules[$module->sort_order] = $file; } else { $installed_modules[] = $file; } } if ((!isset($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['module'] == $class))) && !isset($mInfo)) { $module_info = array('code' => $module->code, 'title' => $module->title, 'description' => $module->description, 'status' => $module->check(), 'signature' => (isset($module->signature) ? $module->signature : null), 'api_version' => (isset($module->api_version) ? $module->api_version : null)); $module_keys = $module->keys(); $keys_extra = array(); for ($j=0, $k=sizeof($module_keys); $j<$k; $j++) { $key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_keys[$j] . "'"); $key_value = tep_db_fetch_array($key_value_query); $keys_extra[$module_keys[$j]]['title'] = $key_value['configuration_title']; $keys_extra[$module_keys[$j]]['value'] = $key_value['configuration_value']; $keys_extra[$module_keys[$j]]['description'] = $key_value['configuration_description']; $keys_extra[$module_keys[$j]]['use_function'] = $key_value['use_function']; $keys_extra[$module_keys[$j]]['set_function'] = $key_value['set_function']; } $module_info['keys'] = $keys_extra; $mInfo = new objectInfo($module_info); } if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) { if ($module->check() > 0) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n"; } } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MODULES, 'set=' . $set . (isset($HTTP_GET_VARS['list']) ? '&list=new' : '') . '&module=' . $class) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $module->title; ?></td> <td class="dataTableContent" align="right"><?php if (in_array($module->code . $file_extension, $modules_installed) && is_numeric($module->sort_order)) echo $module->sort_order; ?></td> <td class="dataTableContent" align="right"><?php if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . (isset($HTTP_GET_VARS['list']) ? '&list=new' : '') . '&module=' . $class) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } } if (!isset($HTTP_GET_VARS['list'])) { ksort($installed_modules); $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_key . "'"); if (tep_db_num_rows($check_query)) { $check = tep_db_fetch_array($check_query); if ($check['configuration_value'] != implode(';', $installed_modules)) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $installed_modules) . "', last_modified = now() where configuration_key = '" . $module_key . "'"); } } else { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Modules', '" . $module_key . "', '" . implode(';', $installed_modules) . "', 'This is automatically updated. No need to edit.', '6', '0', now())"); } if ($template_integration == true) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'TEMPLATE_BLOCK_GROUPS'"); if (tep_db_num_rows($check_query)) { $check = tep_db_fetch_array($check_query); $tbgroups_array = explode(';', $check['configuration_value']); if (!in_array($module_type, $tbgroups_array)) { $tbgroups_array[] = $module_type; sort($tbgroups_array); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $tbgroups_array) . "', last_modified = now() where configuration_key = 'TEMPLATE_BLOCK_GROUPS'"); } } else { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Template Block Groups', 'TEMPLATE_BLOCK_GROUPS', '" . $module_type . "', 'This is automatically updated. No need to edit.', '6', '0', now())"); } } } ?> <tr> <td colspan="3" class="smallText"><?php echo TEXT_MODULE_DIRECTORY . ' ' . $module_directory; ?></td> </tr> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'edit': $keys = ''; reset($mInfo->keys); while (list($key, $value) = each($mInfo->keys)) { $keys .= '<strong>' . $value['title'] . '</strong><br />' . $value['description'] . '<br />'; if ($value['set_function']) { eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');"); } else { $keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']); } $keys .= '<br /><br />'; } $keys = substr($keys, 0, strrpos($keys, '<br /><br />')); $heading[] = array('text' => '<strong>' . $mInfo->title . '</strong>'); $contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save')); $contents[] = array('text' => $keys); $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']))); break; default: $heading[] = array('text' => '<strong>' . $mInfo->title . '</strong>'); if (in_array($mInfo->code . $file_extension, $modules_installed) && ($mInfo->status > 0)) { $keys = ''; reset($mInfo->keys); while (list(, $value) = each($mInfo->keys)) { $keys .= '<strong>' . $value['title'] . '</strong><br />'; if ($value['use_function']) { $use_function = $value['use_function']; if (preg_match('/->/', $use_function)) { $class_method = explode('->', $use_function); if (!isset(${$class_method[0]}) || !is_object(${$class_method[0]})) { include(DIR_WS_CLASSES . $class_method[0] . '.php'); ${$class_method[0]} = new $class_method[0](); } $keys .= tep_call_function($class_method[1], $value['value'], ${$class_method[0]}); } else { $keys .= tep_call_function($use_function, $value['value']); } } else { $keys .= $value['value']; } $keys .= '<br /><br />'; } $keys = substr($keys, 0, strrpos($keys, '<br /><br />')); $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=edit')) . tep_draw_button(IMAGE_MODULE_REMOVE, 'minus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=remove'))); if (isset($mInfo->signature) && (list($scode, $smodule, $sversion, $soscversion) = explode('|', $mInfo->signature))) { $contents[] = array('text' => '<br />' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' <strong>' . TEXT_INFO_VERSION . '</strong> ' . $sversion . ' (<a href="http://sig.oscommerce.com/' . $mInfo->signature . '" target="_blank">' . TEXT_INFO_ONLINE_STATUS . '</a>)'); } if (isset($mInfo->api_version)) { $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' <strong>' . TEXT_INFO_API_VERSION . '</strong> ' . $mInfo->api_version); } $contents[] = array('text' => '<br />' . $mInfo->description); // USPS START // $contents[] = array('text' => '<br>' . $keys); $contents[] = array ( 'text' => '<br />' . preg_replace(array ( '/RM/', '/TM/', '/International/', '/Envelope/' ), array ( '®', '™', 'Int\'l', 'Env' ), $keys) ); // USPS END } elseif (isset($HTTP_GET_VARS['list']) && ($HTTP_GET_VARS['list'] == 'new')) { if (isset($mInfo)) { $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_MODULE_INSTALL, 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=install'))); if (isset($mInfo->signature) && (list($scode, $smodule, $sversion, $soscversion) = explode('|', $mInfo->signature))) { $contents[] = array('text' => '<br />' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' <strong>' . TEXT_INFO_VERSION . '</strong> ' . $sversion . ' (<a href="http://sig.oscommerce.com/' . $mInfo->signature . '" target="_blank">' . TEXT_INFO_ONLINE_STATUS . '</a>)'); } if (isset($mInfo->api_version)) { $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' <strong>' . TEXT_INFO_API_VERSION . '</strong> ' . $mInfo->api_version); } $contents[] = array('text' => '<br />' . $mInfo->description); } } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> </table> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> modules.php
  25. a.forever

    Credit Class & Gift Vouchers for 2.3.4

    I see this twice: require(DIR_WS_INCLUDES . 'template_bottom.php'); I don't see this code: // BEGIN CCGV -- if we have been here before and are coming back get rid of the credit covers variable if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); if(tep_session_is_registered('cot_gv')) tep_session_unregister('cot_gv'); // END CCGV // Stock Check And I don't know if it's your browser's copy/paste, or if it's actually in your current file, but the following (as well as many other instances) shouldn't take multiple lines: // if there is nothing in the customers cart, redirect them to the shopping cart page You should use the CODE tag when posting stuff like these. The button looks like: < >
×