Jump to content

insaini

Members
  • Content count

    207
  • Joined

  • Last visited

Everything posted by insaini

  1. I have modified the Step By Step Manual Order Entry contribution to be completely AJAX searchable and loadable. Features include Select Customer From a Drop down list (can be disabled if there are way too many registered customers on your site) Select Customer by ID Select Customer by Name (Returns 5 top customers based on a search string via ajax) All searches are done by AJAX and all information is loaded via AJAX. The modified Manual Order Entry is one single page containing all processing. One AJAX file, One AJAX Javascript file and two Module files. If anyone is interested.. let me know and I would be more than happy to upload the modified contribution Here are a couple simple screen-shots.. When clicking confirm it creates the order and redirects to Order Editor..
  2. insaini

    Country-State Selector

    I found the problem.. kinda stupid but ah well.. open catalog/includes/functions/html_output.php find the function tep_draw_pull_down_menu(...) find the code if ($default == $values[$i]['id']) { $field .= ' SELECTED'; } change it to if ($default === $values[$i]['id']) { $field .= ' SELECTED'; } notice the === operator instead of the == operator.. thats it .. J
  3. insaini

    Country-State Selector

    I had noticed this as well.. I have not looked into yet.. but i have noticed it.. im not sure exactly why its doing that yet..
  4. insaini

    Country-State Selector

    Well what you are trying to do in your javascript is copy billing_states.value to shipping_states.value. This isnt possible. The name of the SELECT drop down for each states dropdown for both billing and shipping is 'zone_id' or 'state' if there are no zones.. both have the same form name.. the only way to reference each of them is the way i said to above.. by getting the DIV element and then going to its node with is the select element.. that is the only way to get to them in order to get their values.. However I have just realized another problem which I didnt see before.. when someone submits this form.. you are only going to get one zone_id or one state value to your process. You need to two of course.. there is only one way that I can see to do this.. and that is modifying the original ajax function and adding a name parameter and then the way you have your javascript now should be just fine to work.. this is probably the easier way.. you can change the function in catalog/includes/functions/ajax.php to function ajax_get_zones_html($name, $country, $default_zone = '', $ajax_output = true) { $output = ''; $zones_array = array(); $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']); } if ( tep_db_num_rows($zones_query) ) { $output .= tep_draw_pull_down_menu($name.'_zone_id', $zones_array,$default_zone); } else { $output .= tep_draw_input_field($name.'_state',$default_zone); } if (tep_not_null(ENTRY_STATE_TEXT)) $output .= ' <span class="inputRequirement">' . ENTRY_STATE_TEXT; if ($ajax_output) { header('Content-type: text/html; charset='.CHARSET); echo $output; } else { return $output; } } As you can see from the code change above $name is appended to the front of _zone_id or _state .. so when you change the code by adding the name "billing" or "shipping" to the states dropdown code.. the javascript variable will be "billing_zone_id" or "shipping_zone_id" you will have to make the changes in your process function to $_GET['billing_zone_id'] and not just $_GET['zone_id'] ..etc.. everything else should be ok.. I hope this makes sense? J
  5. insaini

    Country-State Selector

    those names are still there.. infact they are exactly the same.. but there is no way to directly reference them .. in order to get to them.. you have to go through the DIV that surrounds the states dropdown.. you have to reference the DIV .. and then loop through the nodes of the DIV ... (there is only one node so its not like it will loop for a long time.. the only node is a SELECT element) this is your states dropdown.. you can then see which of these is selected and copy it over.. its a little more coding to your javascript function.. <td class="main"><div id="states"> <?php // +Country-State Selector echo ajax_get_zones_html($country,'',false); // -Country-State Selector ?> </div></td> see the <div id="states"> you should have two of them.. because you have two dropdowns.. they should also be renamed to "billing_states" and "shipping_states" in the javascript code you would reference them like this var _div = getObject("billing_states"); for (i=0; i<_div.childNodes.length; i++){ if (_div.childNodes[i].nodeName=="SELECT") { _div.childNodes[i].focus(); // this is what you would use in your custom code would go. You can now get the id and name of the billing_states dropdown box which is selected .. and copy it over to the "shipping_states" but getting that dropdown in the same manner.. } }
  6. insaini

    Country-State Selector

    when you duplicate the code for your shipping address section.. you need to rename the DIV element id parameter for both states drop-downs.. name the first one to "billing_states" and second to "shipping_states" you will probably also need to change the name of the country drop-down boxes for both .. once thats done.. in the javascript code that you have.. when the customer clicks same as billing or whatever.. you can reference the billing states and countries easily.. for the states first you need to use the getObject function ie...getObject('billing_states') .. and use that to loop to the select element contained in it.. from there you can get the states values .. next you can also simply reference the country in basically the same manner.. although I dont think you need to use getObject .. in either case you will need to modify that custom javascript function you have in order to copy that info over the shipping country-state boxes..
  7. insaini

    Country-State Selector

    You also have to make the change I show above your last post.. AND in your create_account45.php .. where it has the country dropdown code.. you have onChange="getStates(this.value, this.form, 'states'); you have to change that to onChange="getStates(this.value, 'states'); the latest contribution gets rid of the requirement for this.form J
  8. insaini

    Country-State Selector

    Oh and another thing I just realized.. because you are making the modifications to create_account45.php you also need to update the function function getStates(countryID) { if (request.readyState == 4 || request.readyState == 0) { // indicator make visible here.. getObject("indicator").style.visibility = 'visible'; var contentType = "application/x-www-form-urlencoded; charset=UTF-8"; var fields = "action=getStates&country="+countryID; request.open("POST", 'create_account.php', true); request.onreadystatechange = getStatesRequest; request.setRequestHeader("Content-Type", contentType); request.send(fields); } } located in catalog/includes/ajax.js.php see where it says create_account.php you need to change that ... change it to <?php echo basename($PHP_SELF); ?> .. i think that may be the actual problem so basically change it from request.open("POST", 'create_account.php', true); to request.open("POST", '<?php echo basename($PHP_SELF); ?>', true); J
  9. insaini

    Country-State Selector

    Dave.. I just accessed your link create_account45.php and it still shows the old javascript code.. are you sure you updated the changes to your server? this is the javascript code that is showing up at this link http://www.dirtbikebitz.com/create_account45.php function getStatesRequest() { var next = false; if (request.readyState == 4) { // make hidden getObject('indicator').style.visibility = 'hidden'; getObject("states").innerHTML = request.responseText; document.account.state.focus(); } } it SHOULD be from the latest contribution.. try updating to the code changes from the latest contribution.. overwrite your existing catalog/includes/ajax.js.php and catalog/includes/functions/ajax.php and make the change necessary to your create_account45.php file and I can test it again.. J
  10. hmm.. well that does say libcurl 7.10 .. which isnt libcurl 7.16 .. but give it a go and see how it works out..
  11. Chris, it may work on 7.16 .. I can't say for sure..the most important thing is that curl is built with openssl .. the way you can verify this is by going to admin -> tools -> server info .. scroll to curl and see how its been built (it should include openssl at least v0.97) you can also see if it works by commenting out step 3 to step 10 in ship_canadapost_ajax.php case 1: break; case 2: break; /* case 3: break; .. case 10: break; */ default: break; comment out case 3 to case 10 .. if when you click submit it displays "Logged In" for step 2 .. then you know it will work. J
  12. insaini

    Country-State Selector

    I understand... but updating on a weekly basis when a product that undergoes many revisions in one day is kinda pointless dont you think? Most of the changes were minor missed things.. at 1.5.5 i feel its all been taken care of .. as for upgrade documents.. it the reason why I didnt include any from 1.5 to 1.5.5 is really the changes are at most 3 lines of code with 2 replaced files... the new files from a new installation.. just over-write (ajax files) and then the 3 lines of code modified.. just compare the changes from a manual new install to your current files.. dont think its that difficult .. imo
  13. insaini

    Country-State Selector

    finally if that doesnt work.. try changing the getObject function in ajax.js.php to this function getObject(name) { var ns4 = (document.layers) ? true : false; var w3c = (document.getElementById) ? true : false; var ie4 = (document.all) ? true : false; if (ns4) return document.layers[name]; // eval('document.' + name); if (w3c) return document.getElementById(name); if (ie4) return document.all[name]; // eval('document.all.' + name); return false; }
  14. insaini

    Country-State Selector

    Well im not sure... but ive tried my contribution in IE and Firefox and it works just fine.. but it doesnt work on your site for either.. there is a function in that file global.js called fetch_object .. this is basically the same as getObject function that is in ajax.js.php see if you can do this.. remove or comment out the getObject function in ajax.js.php and modify the getStatesRequest function so that instead of getObject(something)... change it to fetch_object(something)... there are two lines that need to be changed to that in the function getStatesRequest let me know how that works out p.s you may need to change it to fetch_object(something, true)... J
  15. insaini

    Country-State Selector

    Dave.. I see that you have a link to a file called global.js .. can you post the contents of that file please..
  16. insaini

    Country-State Selector

    Actually you may just want to download the new package and update manually... ive changed the ajax function and now there is no need to pass in this.form in those function calls anymore .. J
  17. insaini

    Country-State Selector

    Ive updated the code so that it works with multiple country drop-downs and any form name.. code changes.. first open catalog/includes/ajax.js.php remove the original two functions named getStates and getStatesRequest and replace with these functions function getStates(countryID, form, div_element) { if (request.readyState == 4 || request.readyState == 0) { // indicator make visible here.. getObject("indicator").style.visibility = 'visible'; var contentType = "application/x-www-form-urlencoded; charset=UTF-8"; var fields = "action=getStates&country="+countryID; request.open("POST", 'create_account.php', true); //request.onreadystatechange = getStatesRequest; request.onreadystatechange = function() { getStatesRequest(request, form, div_element); }; request.setRequestHeader("Content-Type", contentType); request.send(fields); } } //Called when the AJAX response is returned. function getStatesRequest(request, form, div_element) { var next = false; if (request.readyState == 4) { // make hidden getObject('indicator').style.visibility = 'hidden'; getObject(div_element).innerHTML = request.responseText; if (form.state) { form.state.focus(); } else if (form.zone_id) { form.zone_id.focus(); } } } next open catalog/create_account.php change <?php echo tep_get_country_list('country',$country,'class="formtextinput" onChange="getStates(this.value);"') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?> to <?php echo tep_get_country_list('country',$country,'class="formtextinput" onChange="getStates(this.value, this.form, \'states\');"') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?> notice the difference in the getStates function call.. two added parameters.. this.form (should never change) and \'states\' this you need to change for any page with multiple country select boxes .. basically if you have a billing select and shipping select change it to be \'billing_states\' and \'shipping_states\' then you also need to change the <DIV element which surrounds the states dropdown in each .. from <div id="states"> to <div id="billing_states"> and for the other one.. shipping states.. should be clear enough? make the above code changes to the files catalog/includes/modules/checkout_new_address.php and catalog/includes/modules/address_book_details.php that should be all there is to it.. new package will be uploaded soon.. J
  18. insaini

    Country-State Selector

    The problem i guess is partially my fault i should have realized.. it seems as though you changed the stock osc form name for that page.. the name of the form is usually 'account' youve changed it to 'checkout' not really sure why that is but in any case you need to open /catalog/includes/ajax.js.php and in the getStatesRequest function find the line that begins with document.account and change it to document.checkout .. for the time being.. let me see if I can change that so its not necessary.. as well you have multiple country selections for shipping address and billing address.. ill see if i can modify it so that it works for multiple country selection boxes.. but for the time being use the above fix... should work.. J
  19. insaini

    Country-State Selector

    Ahhh i think i found the problem.. open catalog/address_book_process.php around line 40 if (isset($_POST['action']) && ($_POST['action'] == 'process')) { change to if (isset($_POST['action']) && (($_POST['action'] == 'process') || ($_POST['action'] == 'update'))) { Sorry about that.. I will make that change and upload it as a new package hopefully that resolves all issues OH and also .. you may want to put the a css tag for the indicator somewhere in your css file #indicator { visibility:hidden; } you can position this as you see fit for your site..
  20. insaini

    Country-State Selector

    Ok I have uploaded the fixed version 1.5.3 There are a few small code changes necessary.. First open catalog/includes/functions/ajax.php change the function declaration line from function ajax_get_zones_html($country, $ajax_output = true) { to function ajax_get_zones_html($country, $default_zone = '', $ajax_output = true) { Next in that same function change this part if ( tep_db_num_rows($zones_query) ) { $output .= tep_draw_pull_down_menu('zone_id', $zones_array); } else { $output .= tep_draw_input_field('state'); } to this if ( tep_db_num_rows($zones_query) ) { $output .= tep_draw_pull_down_menu('zone_id', $zones_array, $default_zone); } else { $output .= tep_draw_input_field('state', $default_zone); } Now open catalog/create_account.php change <?php // +Country-State Selector echo ajax_get_zones_html($country,false); // -Country-State Selector ?> to this <?php // +Country-State Selector echo ajax_get_zones_html($country,'',false); // -Country-State Selector ?> Do the same above change to file catalog/includes/modules/checkout_new_address.php Now open catalog/includes/modules/address_book_details.php and change this // +Country-State Selector echo ajax_get_zones_html($entry['entry_country_id'], false); // -Country-State Selector to this // +Country-State Selector echo ajax_get_zones_html($entry['entry_country_id'],($entry['entry_zone_id'] == 0 ? $entry['entry_state'] : $entry['entry_zone_id']), false); // -Country-State Selector That should take care of it all
  21. insaini

    Country-State Selector

    Hmm.. so this is only when updating an address in the 'my account' area and not when creating an account? Let me check
  22. Uploaded is Canada Post Automated Labels 2.2 and Canada Post Shipping Module 4.1 The only changes were to the Automated Labels .. there was a missing include and a button file.. There was also a custom input text field function which wasnt necessary and cut out.. also updated were the install instructions.. no extra added functionality in this release. J
  23. insaini

    Country-State Selector

    Done and Accepted.. I do know what you mean about a lot of junk be added to contribution pages.. makes it tough to know what to download..
  24. insaini

    Seperate Pricing Per Customer v3.5

    Allowing a customer to choose their group is not more practical.. it is time saving however it is problematic.. wholesale purchasers generally are exempt from certain taxes.. i suppose it also depends on where you are.. it also allows regular customers to register as a certain group and see pricing of that particular group.. it is better that a company that wishes to purchase wholesale contact you directly and then you can set them up under a wholesale account.. they will get pricing and even if they have to wait a day its a better way of handling things.. although IMO.. you can setup your store as you like.. you will however have to create a drop down with the available groups you want allowed to be chosen.. and then when the customer is being added you have to add that information to the insert code..
  25. Ok just to clarify.. if you remove the Ultimate SEO .. everything works fine.. but when you install Ultimate SEO it breaks? Try removing it.. and verify that everything works fine.. (but leave your .htaccess file the same as it is now)
×