Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

One Page Checkout Support


Guest

Recommended Posts

More details from internet explorer: At bottom left on the browser a message states "error on page" when I click on that it opens up a box and where the details are shown it states:

 

Line 20

Char 27021

Error Unknown Name

Code:0

URL: https:mysecuredstite...root/catalog/checkout.php

 

Firefox works fine but need to fix this internet exporer error. Anyone?

i think it should be in checkout_shipping

			tep_redirect(tep_href_link(FILENAME_CHECKOUT, $_SERVER['QUERY_STRING'] , 'SSL'));

 

its function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)

as there was only 2 varables being passed in old link they said to add im sure its the way above, let us know if above works or not

Edited by steve_s
Link to comment
Share on other sites

It also seems on v1.0.5 first time you login besides shipping & billing address not auto populating, when you do select address for them and checkout, order is written but customer fields are blank, then when you click continue and go back to index.php, you are loged out, put an order through again login, addresses auto populate click continue

order is written and customer fields is there 2

 

Seems this login might need to refresh twice, to get all details into one page checkout.

 

For those with the update cart problems, bear with me, i will be getting someone to look at it and login issues to if not to much money, im using 1.0.5 though so it might still work on previous versions

Edited by steve_s
Link to comment
Share on other sites

look in /includes/checkout/column_right.php text is entered via admin so might be able to change style in there

 

Thanks for the hint Steve. I'll take a look in there and see what I can find. Any idea about the button errors? Update Cart shows error message and login doesn't work at all. Help please!

Link to comment
Share on other sites

Thanks for the hint Steve. I'll take a look in there and see what I can find. Any idea about the button errors? Update Cart shows error message and login doesn't work at all. Help please!

When you login it doesn't even log you in?, or just no shipping billing address, look in firefox tools error console also your error log see if anything is in there

Link to comment
Share on other sites

When you login it doesn't even log you in?, or just no shipping billing address, look in firefox tools error console also your error log see if anything is in there

 

I can login from going to login.php but not within the checkout page's login button. If I log in elsewhere and go to checkout then it does load the account information onto checkout.php. There's a "a href..." link is there for login button but nothing happens when i click it. Firefox says there's "Warning: Empty string passed to getElementById()." when I click on Login or Update Cart Buttons.

Link to comment
Share on other sites

When you login it doesn't even log you in?, or just no shipping billing address, look in firefox tools error console also your error log see if anything is in there

 

BTW, I set "Require Login" to false. Forgot to mention this to you. I checked column_right.php but not in there, I found it in checkout.php. I guess it's built as an infoBox so I can't change css class. Any suggestion on how to modify the checkout page's boxes since I've already set infoBox css sets to complement STS.

Link to comment
Share on other sites

Yes, I have the same problem with the update cart button. Otherwise 1.05 is looking good in my opinion. Any ideas? :)

 

/Jarkko

 

I'm also having the same problem and have been working all night to try and debug the problem. I've given up for the night, but will try for a little bit tomorrow.

Hopefully someone can look this over and help!

 

Here's all the code that takes care of the Update Cart button:

Inside 'Checkout.php' (javascript)

 $('#updateCartButton').click(function (){
	queueAjax({
		url: '<?php echo fixSeoLink(tep_href_link(FILENAME_CHECKOUT, 'rType=ajax&action=updateQuantities', $request_type));?>&qty=1&id=29',
		beforeSendMsg: 'Updating Product Quantities',
		dataType: 'json',
		data: $('input', $('#shoppingCart')).serialize(),
		success: updateCartView,
		errorMsg: 'There was an error updating shopping cart, please inform IT Web Experts about this error.'
	});
  return false;
});

 

Inside 'Checkout.php' (php)

case 'updateQuantities':
		  echo $onePageCheckout->updateCartProducts($_GET['qty'], $_GET['id']);
	  break;

Inside 'includes/classes/onepage_checkout.php'

function updateCartProducts($qtys, $ids){
	global $cart;
	  foreach($qtys as $pID => $qty){
		  $cart->update_quantity($pID, $qty, $ids[$pID]);  
	  }

	  $json = '';
	  if (isset($_GET['rType']) && $_GET['rType'] == 'ajax'){
		  $json .= '{
			  success: true
		  }';
	  }else{
		  tep_redirect(tep_href_link(FILENAME_CHECKOUT));
	  }
	return $json;
  }

 

Now here's what I've found so far:

 

1) When the button is clicked, this is the line of data that is ajaxed to the server:

$('input', $('#shoppingCart')).serialize()

 

What this JQuery code does is it finds the input fields within the shopping cart and stores it as a jQuery object ([object Object]) which is then serialized into post data.

Whether this line is the problem line I'm not sure. It seems like it might be, from what I've observed below.

 

Here's an example of data that is ajaxed to the server during one of my tests:

qty%5B29%5D=1&qty%5B28%5D=1

That's for 2 products, one with an id of 29 and another 28. Both of their quantities were set to 1.

Now I'm not familiar with sending arrays via post data, which is why I don't know if this is wrong, but I'll look into it tomorrow. (Anyone?)

 

2) The server then gets the post data successfully here:

case 'updateQuantities':
		  echo $onePageCheckout->updateCartProducts($_GET['qty'], $_GET['id']);
	  break;

 

I put a little debug line in there and found that the server is getting the post data correctly. BUT the post data might not be correct.

My debugging found that $_GET['qty'] is an array, or at least the actual word "Array" as I can't for the life of me get the array to print out:

echo "alert('"; 
$trythis = $_GET['qty'];
print_r($trythis);
echo "')";

 

But maybe I'm just being dumb. Anyway, the second part of the data is $_GET['id'], which from my debugging is always just a number- usually the first product in the cart- not an array. This doesn't sound right, as you'd need both an array of quantity values and an array of product IDs in order for this to work!

 

In fact, the function updateCartProducts() to which those values are passed needs two arrays, one for the quantity values and product ids. Without them the function is screwed.

 

3) Those values are then passed to the updateCartProducts() function here:

function updateCartProducts($qtys, $ids){
	global $cart;
	  foreach($qtys as $pID => $qty){
		  $cart->update_quantity($pID, $qty, $ids[$pID]);  
	  }

	  $json = '';
	  if (isset($_GET['rType']) && $_GET['rType'] == 'ajax'){
		  $json .= '{
			  success: true
		  }';
	  }else{
		  tep_redirect(tep_href_link(FILENAME_CHECKOUT));
	  }
	return $json;
  }

 

Conclusion: The javascript line

$('input', $('#shoppingCart')).serialize()

does not seem to be sending the correct post data, which would be two arrays.

 

As I mentioned, I'm not familar with sending arrays via post data, so here's that example again of what that line of code is sending to the server:

 

qty%5B29%5D=1&qty%5B28%5D=1

 

That's for 2 products, one with an id of 29 and another 28. Both of their quantities were set to 1.

Perhaps someone who is familiar with sending arrays in post data can look at this and see if the above line is correct?

If it is, then it's not the javascript, but something in the php code, maybe even the final function the data is passed to.

 

Hopefully someone can help me out here! :) Will look into this again in the morning.

 

- Taven

Link to comment
Share on other sites

I can login from going to login.php but not within the checkout page's login button. If I log in elsewhere and go to checkout then it does load the account information onto checkout.php. There's a "a href..." link is there for login button but nothing happens when i click it. Firefox says there's "Warning: Empty string passed to getElementById()." when I click on Login or Update Cart Buttons.

Ok when you goto checkout.php look at source and check if all javascript includes are there and all the java are you using STS?

Link to comment
Share on other sites

Ok when you goto checkout.php look at source and check if all javascript includes are there and all the java are you using STS?

Another couple of days i will have answer to this update cart problem

Link to comment
Share on other sites

Hi

We are also having problems with the update button and the login, fingers crossed someone figures it out as it looks really good, far better than the long checkout i had before. I have the shipping options on the first checkout page and wondered whether anyone knew whether i can disable the shipping options in the one page checkout and just leave the payment options as standard instead of all the updating?

Thanks

Lianne

Link to comment
Share on other sites

Ok. Here's the problem with the "update cart button".

The ajax call is not sending the correct data.

It should be sending two arrays- one for quantities and one for Ids.

Instead, it's sending a string with the value "Array" for quantities and absolutely nothing for Ids.

 

Here's the debug code I used:

case 'updateQuantities':
		  //echo $onePageCheckout->updateCartProducts($_GET['qty'], $_GET['id']);
		  echo "alert(' qty value: " . $_GET['qty'] . " and qty is a " . gettype($_GET['qty']) . ""; 
		  echo "   |   id value: " . $_GET['id'] . " and id is a " . gettype($_GET['id']) . "')";
	  break;

 

Which outputs the following, regardless of what is in your cart:

qty value: Array and qty is a string   |   id value:  and id is a NULL

 

As you can see, "qty" is always a string that says "array" while "id" is always nothing, and is "NULL"

That means the problem lies in this code here:

	$('#updateCartButton').click(function (){
	queueAjax({
		url: '<?php echo fixSeoLink(tep_href_link(FILENAME_CHECKOUT, 'rType=ajax&action=updateQuantities', $request_type));?>',
		beforeSendMsg: 'Updating Product Quantities',
		dataType: 'json',
		data: $('input', $('#shoppingCart')).serialize(),
		success: updateCartView,
		errorMsg: 'There was an error updating shopping cart, please inform IT Web Experts about this error.'
	});
  return false;
});

 

Solution?

I'm afraid I don't have one yet. I'm not too familar with json or jQuery ajax syntax- I only know the basics. I'll see if I can ask on a Javascripting forum and get an answer to this.

If there are any javascripters out there hopefully they can take a look and provide an answer to this perplexing problem!

 

- Taven

Link to comment
Share on other sites

BTW, I set "Require Login" to false. Forgot to mention this to you. I checked column_right.php but not in there, I found it in checkout.php. I guess it's built as an infoBox so I can't change css class. Any suggestion on how to modify the checkout page's boxes since I've already set infoBox css sets to complement STS.

Look back in forums someone got it working with STS, pm him he might be able to send you the files

Link to comment
Share on other sites

Ok. Here's the problem with the "update cart button".

The ajax call is not sending the correct data.

It should be sending two arrays- one for quantities and one for Ids.

Instead, it's sending a string with the value "Array" for quantities and absolutely nothing for Ids.

 

Here's the debug code I used:

case 'updateQuantities':
		  //echo $onePageCheckout->updateCartProducts($_GET['qty'], $_GET['id']);
		  echo "alert(' qty value: " . $_GET['qty'] . " and qty is a " . gettype($_GET['qty']) . ""; 
		  echo "   |   id value: " . $_GET['id'] . " and id is a " . gettype($_GET['id']) . "')";
	  break;

 

Which outputs the following, regardless of what is in your cart:

qty value: Array and qty is a string   |   id value:  and id is a NULL

 

As you can see, "qty" is always a string that says "array" while "id" is always nothing, and is "NULL"

That means the problem lies in this code here:

	$('#updateCartButton').click(function (){
	queueAjax({
		url: '<?php echo fixSeoLink(tep_href_link(FILENAME_CHECKOUT, 'rType=ajax&action=updateQuantities', $request_type));?>',
		beforeSendMsg: 'Updating Product Quantities',
		dataType: 'json',
		data: $('input', $('#shoppingCart')).serialize(),
		success: updateCartView,
		errorMsg: 'There was an error updating shopping cart, please inform IT Web Experts about this error.'
	});
  return false;
});

 

Solution?

I'm afraid I don't have one yet. I'm not too familar with json or jQuery ajax syntax- I only know the basics. I'll see if I can ask on a Javascripting forum and get an answer to this.

If there are any javascripters out there hopefully they can take a look and provide an answer to this perplexing problem!

 

- Taven

This is going to be worked on tomorrow, i should have an answer on what to change in 24 hours

Link to comment
Share on other sites

Hi all,

 

Just installed version 1.05 and same problem with the update button. Doesn't work. When I click on it a box pops up saying

 

There was an error updating shopping cart, please inform IT Web Experts about this error.

 

I also have freeshipping module installed and that doesn't seem to work either. After filling out the details in the billing and shipping address, and selecting the payment method, the shipping option is not there for me to select.

 

On the top of the page it does show free shipping and the total price is correct. However, when I click continue, up pops a box stating that the shipping option is not selected!!

 

This addon was installed on a fresh osCommerce 2.2RC2a and I hardly have anything else installed.

 

Any help would be appreciated.

 

Thanks.

Link to comment
Share on other sites

Hi all,

 

Just installed version 1.05 and same problem with the update button. Doesn't work. When I click on it a box pops up saying

 

 

 

I also have freeshipping module installed and that doesn't seem to work either. After filling out the details in the billing and shipping address, and selecting the payment method, the shipping option is not there for me to select.

 

On the top of the page it does show free shipping and the total price is correct. However, when I click continue, up pops a box stating that the shipping option is not selected!!

 

This addon was installed on a fresh osCommerce 2.2RC2a and I hardly have anything else installed.

 

Any help would be appreciated.

 

Thanks.

Are you using STS?

Link to comment
Share on other sites

Hi steve_s,

 

No, not using STS. In anycase, to get the shipping bit working what I did was to activate the Flat Rate shipping and specify zero as cost and that solved the shipping problem. The free shipping module that I installed and uninstalled a few times just didn't work with Onepage Checkout.

 

So that leaves the update button which I hope you will post the solution soon.

 

The other problem I have is I did a test run and ordered something but as the owner, I did not receive any email of that order but as a buyer, I did received an email. I haven't seen that been mentioned in this thread before. Is there something that I must do to receive emails when someone orders from my store using this Onepage Checkout?

 

Thanks.

Link to comment
Share on other sites

Hi steve_s,

 

No, not using STS. In anycase, to get the shipping bit working what I did was to activate the Flat Rate shipping and specify zero as cost and that solved the shipping problem. The free shipping module that I installed and uninstalled a few times just didn't work with Onepage Checkout.

 

So that leaves the update button which I hope you will post the solution soon.

 

The other problem I have is I did a test run and ordered something but as the owner, I did not receive any email of that order but as a buyer, I did received an email. I haven't seen that been mentioned in this thread before. Is there something that I must do to receive emails when someone orders from my store using this Onepage Checkout?

 

Thanks.

you can set it to send extra email in admin-config-my store look for send extra emails

Link to comment
Share on other sites

Is there any way to remove the shipping address option, so items are only sent to the billing address?

in checkout.php this seems to be the code for it

	   <td class="main" width="50%" valign="top"><?php
	$header = TABLE_HEADING_SHIPPING_ADDRESS;

	ob_start();
	include(DIR_WS_INCLUDES . 'checkout/shipping_address.php');
	$shippingAddress = ob_get_contents();
	ob_end_clean();

	if (!isset($_SESSION['customer_id'])){
		$shippingAddress = '<table border="0" width="100%" cellspacing="0" cellpadding="2">
		 <tr>
		  <td class="main">Different from billing address? <input type="checkbox" name="diffShipping" id="diffShipping" value="1"></td>
		 </tr>
		</table>' . $shippingAddress;
	}

	buildInfobox($header, $shippingAddress);
   ?><table id="changeShippingAddressTable" border="0" width="100%" cellspacing="0" cellpadding="2" <?php echo (isset($_SESSION['customer_id']) ? '' : ' style="display:none"');?>>
	<tr>
	 <td class="main" align="right"><a id="changeShippingAddress" href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', $request_type);?>"><?php echo tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS);?></a></td>
	</tr>
   </table></td>
  </tr>
   <td class="main" width="50%" valign="top"><?php
	$header = TABLE_HEADING_SHIPPING_ADDRESS;

	ob_start();
	include(DIR_WS_INCLUDES . 'checkout/shipping_address.php');
	$shippingAddress = ob_get_contents();
	ob_end_clean();

	if (!isset($_SESSION['customer_id'])){
		$shippingAddress = '<table border="0" width="100%" cellspacing="0" cellpadding="2">
		 <tr>
		  <td class="main">Different from billing address? <input type="checkbox" name="diffShipping" id="diffShipping" value="1"></td>
		 </tr>
		</table>' . $shippingAddress;
	}

	buildInfobox($header, $shippingAddress);
   ?><table id="changeShippingAddressTable" border="0" width="100%" cellspacing="0" cellpadding="2" <?php echo (isset($_SESSION['customer_id']) ? '' : ' style="display:none"');?>>
	<tr>
	 <td class="main" align="right"><a id="changeShippingAddress" href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', $request_type);?>"><?php echo tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS);?></a></td>
	</tr>
   </table></td>
  </tr>
 </table></td>

might have removed to many for the end tables so play around till page lines up correctly

Link to comment
Share on other sites

I'm finally starting to get somewhere (I hope!) with the install of PayPal IPN for CCGV which was introduced in May of this year. PayPal does apply the discount coupon with this IPN module used in conjunction with One Page Checkout.

 

Problem is: One Page Checkout does not account for the fact that the coupons may be assigned for one time use only or one time use per customer and just allows any valid coupon to be used over and over again. It's not checking against the customer login or anything. In fact, you can put something in your cart...go to checkout...enter your coupon code and click Redeem and it will deduct whatever the value of the coupon is before even entering any customer details or login info whatsoever. Big problem.

 

- Andrea

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...