Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping Estimator


drillsar

Recommended Posts

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 by drillsar
Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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 by Andy79
Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...