Providing word wrap on the Checkout page

Get help with nopcart formatting or style related issues.

Moderators: Koibito, Stefko, Randy

Providing word wrap on the Checkout page

Postby bogorman » Wed Oct 06, 2010 3:19 pm

I have two USERENTRYs on my product page. These can contain fairly long strings of text (with spaces within the strings).
When the managecart page appears, these blocks of text are formatted perfectly, the text wrapping when it comes to the side of the cell but in the checkout page the strings are each on one line with a horizontal scrollbar at the foot of the page.
How can I get the text to wrap as it does in managecart?
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby Koibito » Wed Oct 06, 2010 9:00 pm

Code: Select all
str = str.replace(/\n/g, '<br />');


You'll have to replace the line breaks (\n) in the string by br tags.
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA

Re: Providing word wrap on the Checkout page

Postby bogorman » Thu Oct 07, 2010 3:34 pm

Hi Koibito,
Do you mean in nopcart.js :

if ( PaymentProcessor != '' ) {
//Process description field for payment processors instead of hidden values.
//Format Description of product as:
// ID, Name, Qty X
strPP += fields[0] + ", " + fields[3];
if ( fields[5] != "" )
strPP += " - " + fields[5];
strPP += ", Qty. " + fields[1] + "\n";

(in the last line of the above extract) ?

Brian
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby Stefko » Thu Oct 07, 2010 3:48 pm

I don't think the about will work, that is the section that sends data to the payment process

Not knowing the HTML of your site i would think if you placed just the checkout cart within a table, set the table size then see if that solves the issue.
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Providing word wrap on the Checkout page

Postby bogorman » Fri Oct 08, 2010 6:43 pm

My nopcart.js contains (in the CheckoutCart() function)the coding:

if ( bDisplay )
strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +
"<TD CLASS=\"nopheader\"><B>"+strILabel+"</B></TD>" +
"<TD CLASS=\"nopheader\"><B>"+strDLabel+"</B></TD>" +
"<TD CLASS=\"nopheader\"><B>"+strQLabel+"</B></TD>" +
"<TD CLASS=\"nopheader\"><B>"+strPLabel+"</B></TD>" +
(DisplayShippingColumn?"<TD CLASS=\"nopheader\"><B>"+strSLabel+"</B></TD>":"") +
"</TR>";

The css for the site is in:

\FaithStyles\FaithStyles.css

If I define a style:

.NopcartCheckoutTable{
width=400px;
}

and alter the line (above) strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +

to strOutput = "<TABLE CLASS=\"FaithStyles\FaithStyles.css\NopcartCheckoutTable"><TR>" +

Should that work?
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby Stefko » Fri Oct 08, 2010 8:18 pm

You where on the right path until:

and alter the line (above) strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +
to strOutput = "<TABLE CLASS=\"FaithStyles\FaithStyles.css\NopcartCheckoutTable"><TR>" +


just add <link rel="stylesheet" type="text/css" href="FaithStyles.css" /> to your checkout page's header section and change the code like so:

strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +
to strOutput = "<TABLE CLASS=\"NopcartCheckoutTable\"><TR>" +
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Providing word wrap on the Checkout page

Postby bogorman » Sat Oct 09, 2010 2:21 pm

Hi Stefko,
Have done as you suggested and (by using Firebug) I can see that the style NopcartCheckoutTable is applied to the whole table which contains the order and the totals but the table contains a cell with a style of td.nopentry which has the lengthy data in it and this seems to expand the table to contain the long lines.
How can I apply the style to that cell but only on the checkout page (I assume if the width of a cell is defined the long lines are forced to wrap round and the width will be maintained)
I am sure we are very nearly there!!!
Brian
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby bogorman » Sat Oct 09, 2010 2:25 pm

One further point.
When the Paypal page opens it only gives the description of the order and the price. That's fine, but will the email sent to the "business" email address also contain the ADDITIONALINFO and USERENTRY data?
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby bogorman » Sat Oct 09, 2010 2:35 pm

Stefko. Have just noticed that, on the Paypal page there is an arrow below the description/price data. Clicking on that displays SOME of the ADDITIONALINFO/USERENTRY fields but it then cuts off. It also contains <BR><BR characters. What I really want to do is to send the ADDITIONALINFO and USERENTRY data to the "business" email, if possible not to Paypal, though I suppose it doesn't matter if it appears on the Paypal page as long as it is sent to the email address.
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby Stefko » Sat Oct 09, 2010 3:51 pm

Actually a visual would make things easier,if you can PM a product page URL, this way i can better understand what you describe.
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Providing word wrap on the Checkout page

Postby bogorman » Sun Oct 10, 2010 10:45 am

Here is the URL:
http://www.faith.org.uk/events/WinterBook2010.html
If you enter data into all the textboxes (including several lines of text into Comments) and click Continue. If you then click on Go to Checkout you will see how the long text forces the table to expand (presumably I should apply the style to that cell but I'm not quite sure which one it is). If you then click on Pay Now and click on the arrow (above "Paypal simple safer smarter") you will see only a truncated version of the USERENTRY fields appears (I get

<BR><BR>My First Faith Conference<BR><BR>I am At School<BR> <BR:

In fact, I don't really need any of this to appear on the Paypal page, though I suppose it might be nice to have all the data to appear here if possible. If one cannot avoid the tags showing, it would be better for none of it to appear, just the booking title and the cost. The main thing is that I need all the data to be sent to the "business" email. Have not yet tried putting a payment through to test the emailing. Will do this (reducing the cost temporarily) when we get everything else right.
Thanks again for your help.
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby bogorman » Sun Oct 10, 2010 5:56 pm

Re the expanding table I have investigated further.
Have opened Firebug and have set a breakpoint on the line:

document.write (strOutput);

on the checkout page.

This, I think, contains the coding for the table at the top of the page with the order details in it.
When I copy this into a new page based one of the templates of my site in Dreamweaver and select Design it displays a table well within the width of the page (in fact too narrow).
Also, I regularly paste long text into the same region to pages based on this template and it never expands beyond the width of the region.

When, however, in Firebug I advance to the next line of the coding, the table appears but, as before, it is too wide for the region, at least where the text of a "field" is long this text is all on one line with a horizontal scrollbar at the foot of the page.

Sorry to be so long-winded but I thought maybe this additional information might help you.

If it's any help to you the coding is:


<TABLE CLASS="NopcartCheckoutTable"><TR><TD CLASS="nopheader"><B>Product Id</B></TD><TD CLASS="nopheader"><B>Product Name</B></TD><TD CLASS="nopheader"><B>Quantity</B></TD><TD CLASS="nopheader"><B>Price</B></TD><TD CLASS="nopheader"><B>Shipping</B></TD></TR><TR><TD CLASS="nopentry">wsRPC0</TD><TD CLASS="nopentry">WS Reduced Price. No Coach required - <I> <BR><BR>My First Faith Conference<BR><BR>I am At School<BR> <BR> Group Leader is Mr J Boggle<BR> <BR> My Dietary Requirements are: Strawberries and Raspberries only!!!!1 <BR> <BR> Comments: Three centuries ago, and the Catholic Church, that great creation of God's power [...was] blotted out. ... The vivifying principle of truth, the shadow of St. Peter, the grace of the Redeemer, left it... Truth was disposed of, and shovelled away and there was a calm, a silence, a sort of peace. Second Spring sermon 1852<BR></I></TD><TD CLASS="nopentry">1</TD><TD CLASS="nopentry">£85.00/ea</TD><TD CLASS="nopentry">0.00</TD></TR><input type=hidden name="item_number_1" value="wsRPC0"><input type=hidden name="quantity_1" value="1"><input type=hidden name="amount_1" value="85.00"><input type=hidden name="item_name_1" value="WS Reduced Price. No Coach required"><input type=hidden name="shipping_1" value="0.00"><input type=hidden name="on0_1" value=" <BR><BR>My First Faith Conference<BR><BR>I am At School<BR> <BR> Group Leader is Mr J Boggle<BR> <BR> My Dietary Requirements are: Strawberries and Raspberries only!!!!1 <BR> <BR> Comments: Three centuries ago, and the Catholic Church, that great creation of God's power [...was] blotted out. ... The vivifying principle of truth, the shadow of St. Peter, the grace of the Redeemer, left it... Truth was disposed of, and shovelled away and there was a calm, a silence, a sort of peace. Second Spring sermon 1852<BR>"><TR><TD CLASS="noptotal" COLSPAN=3><B>SUBTOTAL</B></TD><TD CLASS="noptotal" COLSPAN=2 ALIGN=RIGHT><B>£85.00</B></TD></TR><TR><TD CLASS="noptotal" COLSPAN=3><B>SHIPPING</B></TD><TD CLASS="noptotal" COLSPAN=2 ALIGN=RIGHT><B>£0.00</B></TD></TR><TR><TD CLASS="noptotal" COLSPAN=3><B>TOTAL</B></TD><TD CLASS="noptotal" COLSPAN=2 ALIGN=RIGHT><B>£85.00</B></TD></TR></TABLE>
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am

Re: Providing word wrap on the Checkout page

Postby bogorman » Tue Oct 12, 2010 9:42 am

Hi Stefko,
Sorry to push you but wonder if you have had time to look at this again.
Regards
Brian
bogorman
WebMaster
 
Posts: 18
Joined: Fri May 09, 2008 11:48 am


Return to Help: Formatting and Style

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron