Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 09-06-2006 15:04:27

andyM
Member
Registered: 08-28-2005
Posts: 161

Where To Edit The Code Around The Shipping Info

I need to track down the code around the shipping info on page 1 of checkout. Basically i want to shove it inside a div tag so i can make it disappear unless required smile

Offline

 

#2 09-06-2006 17:09:15

andyM
Member
Registered: 08-28-2005
Posts: 161

Re: Where To Edit The Code Around The Shipping Info

Looking at it, the billing form and the shipping form are the same code in the ste_chkout.pl file, so i can't put a div around just the shipping form...

Offline

 

#3 09-06-2006 17:28:38

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Where To Edit The Code Around The Shipping Info

You could get a DIV tag around the shipping information table with a bit of PERL coding, if you're comfortable with such.  In ste_chkout.pl, in the subroutine ste_chkout_intro_table_proc, look for the code:

Code:

#########
######### Print the table header.
#########

if ($caller eq "A") {

print <<ENDOFTEXT;
<BR>
<CENTER>
<TABLE WIDTH="$html_content_table_size" COLS="2" CELLPADDING="10" CELLSPACING="3">
ENDOFTEXT

} else {

print <<ENDOFTEXT;
<BR>
<CENTER>
<TABLE WIDTH="$html_content_table_size" COLS="2" CELLPADDING="10" CELLSPACING="3">
ENDOFTEXT

} ######### End of if statement.

To put in the DIV tag, only for the shipping information fields, you could do something like this:

Code:

#########
######### Print the table header.
#########

if ($caller eq "A") {

print <<ENDOFTEXT;
<BR>
<CENTER>
<TABLE WIDTH="$html_content_table_size" COLS="2" CELLPADDING="10" CELLSPACING="3">
ENDOFTEXT

} elsif ($caller eq "S") {

print <<ENDOFTEXT;
<DIV ID="Whatever">
<BR>
<CENTER>
<TABLE WIDTH="$html_content_table_size" COLS="2" CELLPADDING="10" CELLSPACING="3">
ENDOFTEXT

} else {

print <<ENDOFTEXT;
<BR>
<CENTER>
<TABLE WIDTH="$html_content_table_size" COLS="2" CELLPADDING="10" CELLSPACING="3">
ENDOFTEXT

} ######### End of if statement.

Then, to close the DIV tag, look a little further down in the same subroutine for the code:

Code:

#########
######### Print the table header.
#########

print <<ENDOFTEXT;
</TABLE>
</CENTER>
<BR>
ENDOFTEXT

&initialize_sub_remove('ste_chkout_intro_table_proc');

And add in an if statement to add the closing DIV tag if the caller is 'S', like:

Code:

#########
######### Print the table header.
#########

print <<ENDOFTEXT;
</TABLE>
</CENTER>
<BR>
ENDOFTEXT

if ($caller eq "S")  {

  print "</DIV>";

} ## End of if statement

&initialize_sub_remove('ste_chkout_intro_table_proc');

This is untested, so make sure you check it out first before taking it live.  But I have a pretty high confidence level in the code, so it's worth a shot.  Good luck!


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#4 09-06-2006 17:39:34

andyM
Member
Registered: 08-28-2005
Posts: 161

Re: Where To Edit The Code Around The Shipping Info

Nice one Rachael! The only thing is i would now need the radio options that select whether to use billing or new shipping info moved above that div...

Offline

 

#5 09-06-2006 20:04:35

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Where To Edit The Code Around The Shipping Info

Thanks!  I see what you're trying to do now... hide the shipping fields until they change the radio button, right?  If that's what you're after, then try it this way instead.  Undo the first mods if you did it, as this one is a bit different.  Start by finding this code (same sub as before):

Code:

if ($caller eq "S" && $fd_func eq "ste_chkout_intro") {

if ($ship_items_found eq "1") {

&display_print('ste_shipinfotys');

} else {

&display_print('ste_shipinfoty');

} ######### End of if statement.

$row_count++;

} ######### End of if statement.

And change that to:

Code:

if ($caller eq "S" && $fd_func eq "ste_chkout_intro") {

if ($ship_items_found eq "1") {

&display_print('ste_shipinfotys');

} else {

&display_print('ste_shipinfoty');

} ######### End of if statement.

$row_count++;

print "<DIV ID=\"Whatever\">";

} ######### End of if statement.

Then, further toward the end of the sub, find:

Code:

} ######### End of if statement.

} ######### End of foreach statement.

#########
######### Print the table header.
#########

print <<ENDOFTEXT;
</TABLE>
</CENTER>
<BR>
ENDOFTEXT

Change that code to:

Code:

} ######### End of if statement.

} ######### End of foreach statement.

if ($caller eq "S" && $fd_func eq "ste_chkout_intro") {

  print "</DIV>";

} ## end of if statement

#########
######### Print the table header.
#########

print <<ENDOFTEXT;
</TABLE>
</CENTER>
<BR>
ENDOFTEXT

That should put the DIV around just the table rows that contain the shipping information fields.  Once again untested code, but should work.  Make sure to check for valid HTML.  I believe where I put the DIV tags should make all the TR and TD tags correct, but double check it once you do the mod.

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#6 09-06-2006 22:25:56

celdirect
Member
From: UK
Registered: 04-01-2005
Posts: 782

Re: Where To Edit The Code Around The Shipping Info

Hi,

This looks like a great mod.

What else do you need to do, to make the shipping details show when the radio bitton is selected?

Cheers
Charlie smile  smile

Offline

 

#7 09-07-2006 03:09:05

andyM
Member
Registered: 08-28-2005
Posts: 161

Re: Where To Edit The Code Around The Shipping Info

Thanks purrfect rachael wink

Had to change it by getting rid of the div, closing the previous table ,adding a new table and setting the display:none to the new table.

One thing though, now the cells in the shipping form in firefox are bunched in the middle and don't span the whole table. Weird, can't see why this would be the code looks the same as the table above...

Celdirect, basically using a tiny bit of javascript in header to change the state of the table's display from none to block. And using the call to that function as an onclick on the radio buttons when selecting whether to use bill/ship

Offline

 

#8 01-29-2007 13:50:51

Social Smoke
Member
Registered: 09-21-2003
Posts: 39

Re: Where To Edit The Code Around The Shipping Info

Can anyone post the final code to make this work with the radio buttons in both firefox and IE properly?

Offline

 

Board footer