drillsar Posted December 14, 2010 Share Posted December 14, 2010 (edited) I'm trying to get shipping estimator to work with the new Oscommerce 2.3.1, for some reason the tep_draw_button wont allow popup java to work. Im not sure what code I need to use. This is the Old Code: if (SHIP_ESTIMATOR_BUTTON_PRODUCTS_INFO == 'true') { echo ' <td class="main" align=center><a href="javascript:estimatorpopupWindow(\'' . tep_href_link (FILENAME_PRODUCTS_SHIP_ESTIMATOR, 'pid=' . (int) $_GET['products_id'], 'SSL') . '\')">' . tep_image_button ('button_estimate_shipping.gif', IMAGE_BUTTON_SHIP_ESTIMATOR) . '</a></td>'; } Anyone? Edited December 14, 2010 by drillsar Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 14, 2010 Share Posted December 14, 2010 Click "View Source" in your browser. Does the estimatorpopupWindow() script show up on the page? It should look like this: <script language="javascript"><!-- function estimatorpopupWindow(URL) { window.open(URL,'productsshippingestimator','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600') } //--></script> Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 14, 2010 Author Share Posted December 14, 2010 What I'm trying to do is, add Shipping Estimator to 2.3.1 in product_info ptoblem is Javascript dont work with tep_draw_button I beleive, so im tring to figure out how I can do it, thanks Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 14, 2010 Share Posted December 14, 2010 And? Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 14, 2010 Author Share Posted December 14, 2010 Is there another way of doing this in Oscommerce 2.3.1? THanks Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 14, 2010 Share Posted December 14, 2010 Yes. You can start by answering my question. Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 15, 2010 Author Share Posted December 15, 2010 Yes that's on the page Quote Link to comment Share on other sites More sharing options...
Andy79 Posted December 15, 2010 Share Posted December 15, 2010 (edited) I've been trying to get the combination of tep_draw_button and the JS estimatorpopupWindow working, too. But it had a strange behavior with the estimator poping up twice. My code was something like: if (SHIP_ESTIMATOR_BUTTON_PRODUCTS_INFO == 'true') { echo ' <td class="main" align=center><a href="javascript:estimatorpopupWindow(\'' . tep_href_link (FILENAME_PRODUCTS_SHIP_ESTIMATOR, 'pid=' . (int) $_GET['products_id'], 'SSL') . '\')">' . tep_draw_button (IMAGE_BUTTON_SHIP_ESTIMATOR, 'none', primary) . '</a></td>'; } I don't think this is related to the estimatorpopupWindow, but has to do with the tep_draw_button. Edited December 15, 2010 by Andy79 Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 15, 2010 Share Posted December 15, 2010 Try this: if (SHIP_ESTIMATOR_BUTTON_PRODUCTS_INFO == 'true') { echo ' <td class="main" align=center>' . tep_draw_button (IMAGE_BUTTON_SHIP_ESTIMATOR, 'none', '<a href="javascript:estimatorpopupWindow(\'' . tep_href_link (FILENAME_PRODUCTS_SHIP_ESTIMATOR, 'pid=' . (int) $_GET['products_id'], 'SSL') . '\'">', 'primary') . '</td>'; } Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 15, 2010 Author Share Posted December 15, 2010 Didnt work, strange characters at end: http://giftboundgifts.com/product_info.php?products_id=28&osCsid=1c70adb1ffba74e52b59a92639f7088f Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 15, 2010 Share Posted December 15, 2010 The characters at the end are the SID. That's normal and won't affect operation. That's why your popup works as expected when you click the link. The button isn't working right. I need to play with this a bit. You need to define TEXT_PRODUCTS_SHIP_ESTIMATOR in your language file. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 15, 2010 Author Share Posted December 15, 2010 Ok Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 15, 2010 Share Posted December 15, 2010 Got it working: echo ' <div>' . tep_draw_button (IMAGE_BUTTON_SHIP_ESTIMATOR, 'check', 'javascript:estimatorpopupWindow(\'' . tep_href_link (FILENAME_PRODUCTS_SHIP_ESTIMATOR, 'pid=' . (int) $_GET['products_id'], 'SSL') . '\')', 'primary') . '</div>'; Feel free to change the icon if you can find a better one. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 16, 2010 Author Share Posted December 16, 2010 It's working but however it's buggy. When you enter the address and do ship estimator again it says Error: Product was not found. Please close this window and try again So I guess it has something to do with the coding. Quote Link to comment Share on other sites More sharing options...
♥kymation Posted December 16, 2010 Share Posted December 16, 2010 I'm not going to fix the whole thing piecemeal. If you want me to do all of the work, you'll have to wait until I have time to do it and post the result. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
drillsar Posted December 16, 2010 Author Share Posted December 16, 2010 I'm not going to fix the whole thing piecemeal. If you want me to do all of the work, you'll have to wait until I have time to do it and post the result. Regards Jim I understand, I just wanted you to be aware of this, I will see if I can figure it out or maybe someone else can. Thanks Quote Link to comment Share on other sites More sharing options...
aeroflight Posted January 13, 2011 Share Posted January 13, 2011 Jim, Using 2.2.3 (no overlay from an early version) and adding it to 2.2RC2a as well as an update of 2.3.1 A couple of questions if you have a moment. 2.2 two issues. I notice a lot of the MVS code is in the system, not an issue as far as I can tell. Never installed MVS. Just coupon codes, pwa and onecheckout. standard paypal express and standard as well as amazon. shipping USPS, per item shipping. In product info. shipping estimate is there. click and the page is blank. window pops up, but does not display anything. Cross check the code and found no errors. My first thought is to remove the product info code for pop up and button since nothing has been put in the cart yet. side note in your instructions, In catalog/shopping_cart.php, around line 308, look for... that should be line 208. In shopping card, after selecting the product, then shipping estimate, you get almost everything normal. java window pops up the box enter zip/country. brings up the box gives rates. at the the bottom says Click the "Change Address" button to enter a different shipping destination. Cool idea, except there is no change address button. Closing the window will not clear the address. Clearing the entire session does. There is no button that came along with shipping estimator that is change address.What am I missing? I've searched the file but cannot find where change address is actually called from. find -name does not yield anything rgrep is also no joy. Any idea where this change button is being generated from? Where is the session data being stored? ie zipcode/ country for the popup estimator. I assume a cookie? 2.3.1 is a who different matter. I'll watch the thread a little more there. Rick Quote Link to comment Share on other sites More sharing options...
♥kymation Posted January 13, 2011 Share Posted January 13, 2011 You have an error in your Product Info shipping estimator. Check your PHP error log or turn on ALL errors in your application_top.php. You can't fix it if you don't know what's wrong. Ignore the instructions and use a file comparison program (like Meld) to find the changes. There is an image named button_reset.gif in catalog/includes/languages/english/images/buttons/. That's the change address button. Look for the button name in the code. Session is stored in a file or the database, depending on your osCommerce settings. It is keyed to a session cookie or osCsid, depending on the acceptance of the test cookie by the client browser. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
aeroflight Posted January 14, 2011 Share Posted January 14, 2011 You have an error in your Product Info shipping estimator. Check your PHP error log or turn on ALL errors in your application_top.php. You can't fix it if you don't know what's wrong. Ignore the instructions and use a file comparison program (like Meld) to find the changes. There is an image named button_reset.gif in catalog/includes/languages/english/images/buttons/. That's the change address button. Look for the button name in the code. Session is stored in a file or the database, depending on your osCommerce settings. It is keyed to a session cookie or osCsid, depending on the acceptance of the test cookie by the client browser. Regards Jim Jim: (2.2rc2) wanted to give you a quick update. There appears to be a few buttons missing in 2.2.3. In 2.2 there are alternative and more importantly the reset_button. :) Downloaded and added the gif. Now everything in shopping cart works great. Product info, since adding the button, crashes the entire page. Funny actually, no debug data generated. Went back to default, only two entries in the modified product_info file is for the shipping estimator per diff. Which means forest and trees and something stupid. So for tonight, customers will have to add it their cart. :) Thank you for your help. Rick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.