Jump to content


  • Content count

  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Rich Petersen
  • Gender
  1. Jim, regarding 2. That is exactly what I implemented in the modified code I sent to you for consideration for inclusion in your re-write. I saved shipping info in the session to avoid all of the unnecessary instances of re-quoting. This sped things up greatly.
  2. Some time ago I had version 1.7 of this module working just fine. Now when I select an Extra Service in Checkout (checkout_shipping.php) I get a JSON parse error. Safari indicates "JSON Parse error: Unrecognized token '<'". I also had modified the handling of the radio buttons to use AJAX to save their state on the server so that they would not reset on a reload. That was also working, but now clicking a radio button also get the same JSON Parse error. I'm not sure what might be causing this or where to look. Here's the javascript functions that perform the AJAX POST, checkboxSet and radioSet (modified from the original): function checkboxSet() { thisParent = $(this).parent().parent().parent(); if (thisParent.attr('data-module') == 'usps') $.ajax( { url: window.location.pathname, cache: false, dataType: 'json', type: 'POST', contentType: 'application/x-www-form-urlencoded; charset=UTF-8', data: 'ajax=addUspsServices&shipping=' + thisParent.attr('data-module') + '_' + thisParent.attr('data-method') + '&' + decodeURIComponent($('[type=checkbox]', thisParent).serialize()), success: function (data) { $('#shippingCost', thisParent.parent()).html(data.cost); }, error: function(XMLHttpRequest, textStatus, errorThrown) { if (XMLHttpRequest.responseText == 'session_expired') window.location = ''; alert('Error: ' + textStatus + errorThrown); }, }); } function radioSet() { $(this).parent().parent().siblings().removeClass('moduleRowSelected'); $(this).parent().parent().addClass('moduleRowSelected'); $('#shownString, #customerString, #shownStringHide, #customerStringHide, #shownStringInfo, #customerStringInfo, #shownStringShow, #customerStringShow', $(this).parent().parent().parent()).hide(); $('#shownString, #customerString, #shownStringShow, #customerStringShow', $(this).parent().parent()).show(); $('[type=checkbox]').bind('click', checkboxSet); // save selected mod START thisParent = $(this).parent().parent().parent(); $.ajax( { url: window.location.pathname, cache: false, global: false, // prevents #loader "Processing" dialog from displaying when radio button selected dataType: 'json', type: 'POST', contentType: 'application/x-www-form-urlencoded; charset=UTF-8', data: 'ajax=radioSetShipping&' + decodeURIComponent($('[type=radio]', thisParent).serialize()), error: function(XMLHttpRequest, textStatus, errorThrown) { if (XMLHttpRequest.responseText == 'session_expired') window.location = ' '; alert('Error: ' + textStatus + errorThrown); }, }); // save selected mod END } ...and here is the php code for the server side (again modified from the original): if (isset($_POST['ajax'])) { if ($_POST['ajax'] == 'radioSetShipping') { $shipping_id = $_POST['shipping']; list($module, $method) = explode('_', $shipping_id); if (isset($_SESSION['shipping_quotes'])) { foreach ($_SESSION['shipping_quotes']['quotes'] as $shipping_quote) { if ($shipping_quote['id'] == $module) { foreach ($shipping_quote['methods'] as $shipping_method) { if ($shipping_method['id'] == $method) { if ($shipping_id == 'free_free') { $shipping_method['title'] = FREE_SHIPPING_TITLE; $shipping_method['cost'] = '0'; } $shipping = array('id' => $shipping_id, 'title' => (($free_shipping == true) ? $shipping_method['title'] : $shipping_quote['module'] . ' (' . $shipping_method['title'] . ')'), 'cost' => $shipping_method['cost']); break; } // end if ($shipping_method['id'] == $method) } // end foreach ($shipping_quote['methods'] as $shipping_method) break; // found shipping quote in session } // end if ($shipping_quote['id'] == $module) } // end foreach ($_SESSION['shipping_quotes']['quotes']... } exit;break; } // if ($_POST['ajax'] == 'radioSetShipping' elseif ($_POST['ajax'] == 'addUspsServices') { if (!tep_session_is_registered('uspsServices')) tep_session_register('uspsServices'); $uspsServices = 0; foreach($_POST as $val) if (is_numeric($val)) $uspsServices += $val; if (isset($shipping['cost'])) $return['cost'] = $currencies->format($shipping['cost'] + $uspsServices); echo json_encode($return); exit;break; } } // if (isset($_POST['ajax'] Anyone have any ideas?
  3. DrGlitch

    [Addon} Theme Switcher

    @@kymation - Thanks, that helps. More specifically I was hoping to be able to get the values loaded for use with the Firefox ThemeRoller Dev tool. I'm guessing that might be doable by tweaking developertool.js.php
  4. DrGlitch

    [Addon} Theme Switcher

    I have an existing custom theme that I originally created using the Theme Roller page. Now I'd like to tweak it. Does anyone know of a way to upload an existing custom theme as a starting point or do I have to re-create everything from scratch?
  5. @@JeffroDH: This might not be the cause of your problem, but I found that the "Element content is incomplete according to the DTD/Schema." error occurs when no enabled services are available. As a test try enabling all of the the service options in Admin>Modules>Shipping for USPS and then see if any show up on the checkout page.
  6. @@HTMLguru2: Saved values should look something like "First-Class Mail® Large Env, 0, 70, 1.50, First-Class Mail® Parcel, 0, 70, 2.00, ..." As far as the problem saving changes, see http://forums.oscommerce.com/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/page__view__findpost__p__1640463
  7. I get the following error when I only have "1st Class Mail Parcel" selected for shipping methods in the admin setting for this module: Invalid XML Element content is incomplete according to the DTD/Schema. line= 0 pos= 1668 Anyone know why? Is this no longer a valid option with the USPS?
  8. @@vlad36: Thanks for the Test/Live info. However I'm not sure its worth everyones time to use it as currently the USPS testing API does not support RateV4. Trying to use it with the test server results in the error "API Authorization failure. RateV4 is not a valid API name for this protocol."
  9. @@reverseholic, not sure if you solved your problem, but I encountered a similar problem saving changes using the UPSXML module. The install notes for that module indicated a fix: In catalog/admin/modules.php, find this code (somewhere around line 36-46) if (tep_not_null($action)) { switch ($action) { case 'save': reset($HTTP_POST_VARS['configuration']); while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { and change the while statement to: foreach($_POST['configuration'] as $key => $value) {
  10. It was a bit hard to find but I finally figured out my problem. Apparently I had accidentally copied the admin>includes>functions>general.php into includes>functions. That was causing a failure when clicking on Edit attempted to eval tep_cfg_usps_services() as it did not exist. Nevermind ;)
  11. I just installed v1.7 of this module into a new OSC 2.3 installation. I also included the ADD-ON USPS restrict Methods by Product. Before installing I removed the "Flat Rate" module. I also previously installed the UPSXML 1.4 shippng module installed which is working. When I go to configure USPS, the default values are all displayed in the right column, but when I select "Edit" that column dissapears completely. I've done some recomparing of the files but cannot find anything wrong. Anyone have an idea of what the problem might be or where I should be looking?
  12. DrGlitch

    InternetSecure MerchantLink

    Has anyone implemented the use of returned tokens from IS Merchant Link and would like to share just what they did?
  13. I encountered the same problem and discovered that this is because the images are cached in the thumbnails directory ("catalog/images/_thumbnail_"). They do not get regenerated if they already exist. Either delete the contents of the thumbnails directory manually or in the Administration Tool: 1. Go to Configuration>Images 2. Edit "OPI: Cleanup Thumbnail" and set it to "true" 3. Go to Categories>Products 4. Edit any product. 5. Reload the page (no need to save). This causes the cleanup to occur and OPI: Cleanup Thumbnail gets reset back to "false". Subsequently reloading or displaying a product causes thumbnails to be regenerated using the new settings in opi_thumbnails.php.
  14. When preparing to upload an image I have a problem creating a new directory using a string that contains an underbar ('_') or dash ('-'). For some reason the RegExp test for alphanumeric in jquery.oscProductImage.js (unmodified) returns true and I get the 'error_create_alphanumeric' message. Everything works fine if only use a-Z. This is running on Linux 2.6.9-103.ELsmp Anybody have a clue?