yarndog Posted January 8, 2005 Posted January 8, 2005 Hello, I am running the STS system and have also added the country-state contribution. My web address is: blanketsandbags.com. However my problem exists whether I use the country-state contribution or not, I have tried it with and without. When I go to checkout then get to the delivery information section, I click on the change address button. I have had two problems at this point. If I have previously added an alternate shipping address I can just click on the shipping address I want. When I click one of the radio buttons I get a document.change_address.shipping.0 null or not an object error. I fixed this error by just adding <input type=hidden name="shipping" value=0> line to the checkout_shipping_address.php file. This seems to take care of this problem, although I just feel I am messing something up for why is it looking for an input field named "shipping" in the first place, and perhaps this is causing my second problem of which I do not know how to fix. Here it is. When I click on the continue button at the bottom of the page I get: A Runtime Error has occured Line 133 Error: Object Expected I get this error no matter what I do. If I click on an alternate address I get the error. If I type another new delivery address I get the error. If I do nothing and just click continue I get the error. Help. Has anyone experienced this before and how do I fix this? I get these same errors when I try to change the checkout payment address and I have not made any changes to any of those related files. I am so close to opening my shop, and I am chomping at the bit. Any help is appreciated and I thank you kindly in advance!!!
yarndog Posted January 10, 2005 Author Posted January 10, 2005 Hello, I am running the STS system and have also added the country-state contribution. My web address is: blanketsandbags.com. However my problem exists whether I use the country-state contribution or not, I have tried it with and without. When I go to checkout then get to the delivery information section, I click on the change address button. I have had two problems at this point. If I have previously added an alternate shipping address I can just click on the shipping address I want. When I click one of the radio buttons I get a document.change_address.shipping.0 null or not an object error. I fixed this error by just adding <input type=hidden name="shipping" value=0> line to the checkout_shipping_address.php file. This seems to take care of this problem, although I just feel I am messing something up for why is it looking for an input field named "shipping" in the first place, and perhaps this is causing my second problem of which I do not know how to fix. Here it is. When I click on the continue button at the bottom of the page I get: A Runtime Error has occured Line 133 Error: Object Expected I get this error no matter what I do. If I click on an alternate address I get the error. If I type another new delivery address I get the error. If I do nothing and just click continue I get the error. Help. Has anyone experienced this before and how do I fix this? I get these same errors when I try to change the checkout payment address and I have not made any changes to any of those related files. I am so close to opening my shop, and I am chomping at the bit. Any help is appreciated and I thank you kindly in advance!!! <{POST_SNAPBACK}> I have figured out my own solution. It is a case of if all else fails read the instructions. The STS readme document explains that one must use the $headcontent tag in all the sts related files to ensure that functions that are needed everywhere are able to work in all of the sts pages. The 2nd problem I had is that all the links created in osCommerce must use the tep_href_link() function in the html_output.php file under the functions directory. Not using this function and using a regular link <a href=...> causes all sorts of problems using the STS Template System. This function ensures that sessions aren't lost and navigation works properly. However the browser does not understand PHP code when used in an html file. To get around this one must define variables in the sts_user_code.php file. In this file, a variable is defined as being equivalent to a block of PHP code. So I might set the variable $plaidLink equal to the PHP code calling the tep_href_link() function just like I would in a regular PHP file. I then reference this defined variable in my html code where I need the tep_href_link() function. The sts system interprets the PHP code, grabs the output from it, and where it sees the $plaidLink variable in my html files it replaces it with the html output of the PHP code. There is a small example in the sts_user_code.php file that comes with the sts contribution. The example is the commented lines out at the front of the file. It is not a well explained example, but read the Readme file, then go look at that example and you will see how it works. If you have troubles just shoot me a message or email and I will try to help. Once I understood these two things I no longer had sessions lost problems or stuff disappearing from my shopping cart or crummy navigation. I read these before but being so new I didn't understand the implications, and my life was difficult. Now I understand and life is much easier! Again it was a case of "If all else fails read the instructions."
Recommended Posts
Archived
This topic is now archived and is closed to further replies.