Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

pm2checkout - passing descriptions to 2checkout


elzmaddy

Recommended Posts

I can checkout just fine (in test mode) with one product in my cart, but when I add a second item, I get this error when moving to 2Checkout's site: "414 Request URI is too long". Then I check the URL and I see that it is indeed very long. 2CO support says that I am passing the "TCOID," or what looks like the product descriptions into the URL that sends the customer to 2CO. I of course would like to remove this since 2CO really doesn't need to know my product description. The install.txt says to comment out c_description, but I cannot find this string in pm2checkout.php. I am using the latest versions of all code.

 

Any help would be appreciated and thanks for reading.

Link to comment
Share on other sites

I can checkout just fine (in test mode) with one product in my cart, but when I add a second item, I get this error when moving to 2Checkout's site: "414 Request URI is too long". Then I check the URL and I see that it is indeed very long. 2CO support says that I am passing the "TCOID," or what looks like the product descriptions into the URL that sends the customer to 2CO. I of course would like to remove this since 2CO really doesn't need to know my product description. The install.txt says to comment out c_description, but I cannot find this string in pm2checkout.php. I am using the latest versions of all code.

 

Any help would be appreciated and thanks for reading.

 

 

Same problem here. Where do you get the install.txt? Any helop?

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the late reply... I'm still having this problem. I believe I'm being affected by it because I have a not-insignificant percentage of customers that sign up and fail to complete an order.

 

Opera and Firefox give me the error "414 Request URI too long" Internet Explorer just says, "The page cannot be displayed"

 

If I press BACK and then "Confirm order" again, I can get to the 2Checkout site successfully. What's going on here?

Link to comment
Share on other sites

OK, Here is the response from 2Checkout support:

 

"The reason for this issue is that your URL strings exceed the maximum amount set by the browser, you will need to shorten your descriptions down. This should resolve your issue."

 

So that means I need to shorten descriptions on 150 products?????

 

Hasn't any other 2CO user experienced this issue?

Link to comment
Share on other sites

OK, Here is the response from 2Checkout support:

 

"The reason for this issue is that your URL strings exceed the maximum amount set by the browser, you will need to shorten your descriptions down. This should resolve your issue."

 

So that means I need to shorten descriptions on 150 products?????

 

Hasn't any other 2CO user experienced this issue?

 

Seriously, i do not plan to shorten any product description. Because product description gives more details to the customer.

Link to comment
Share on other sites

I think I got it.

 

Edit pm2checkout.php and find this section:

 

			// fill 2Checkout V2 details with osc order info
		// these fields automate product creation on 2checkout's site. comment out all except c_prod if you do not want this feature
		for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
			$process_button_string .= tep_draw_hidden_field('c_prod_' . $i, $order->products[$i]['model'] . ',' . $order->products[$i]['qty']);
			$process_button_string .= tep_draw_hidden_field('c_name_' . $i, $order->products[$i]['name']);

			// format product description (from Short Description contrib)
			$product_id = $order->products[$i]['id'];
			$product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "' and language_id = '" . $languages_id . "'");
			$product_description = tep_db_fetch_array($product_query);
			$text = $product_description['products_description'];
			$text = strip_tags($text);
			$text = nl2br($text);
			$text = str_replace("<br />","<br>",$text);
			$process_button_string .= tep_draw_hidden_field('c_description_' . $i, $text);
			$process_button_string .= tep_draw_hidden_field('c_price_' . $i, $order->products[$i]['final_price']);
			// $process_button_string .= tep_draw_hidden_field('c_tangible_' . $i, 'Y'); // uncomment and change to N if you sell only non-tangible (ie downloadable) goods
		}

 

Notice that I commented out the two lines that contain c_name and c_description:

 

//				$process_button_string .= tep_draw_hidden_field('c_name_' . $i, $order->products[$i]['name']);

 

//				$process_button_string .= tep_draw_hidden_field('c_description_' . $i, $text);

 

I tested it and it seems to be working with large carts.

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