Forums / Managing Customers and Orders / is there a TEXT_INFORMATION for steps 2 and 3?

is there a TEXT_INFORMATION for steps 2 and 3?

Locked

Views: 1,376

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
19 Mar 2010, 5:50 PM
#1
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

is there a TEXT_INFORMATION for steps 2 and 3?

Hi -

I'm curious whether there's an equivalent to the TEXT_INFORMATION field (that's picked up by tpl_shopping_cart_default.php) for steps 2 and 3 of the checkout process. It would be nice to have the option to display some (different) information on those pages.

Thanks.

19 Mar 2010, 9:01 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

I take it you are talking about line 33 in that file that reads:

<div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>

Confirm if I am correct...

20 years a Zencart User

19 Mar 2010, 9:13 PM
#3
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

Yep, that's the one. Sorry that I wasn't more precise.

19 Mar 2010, 9:32 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

This is just echoing what is in a define statement. It's not the database, so it's easy to mimic.

Let's look at a bit more of that file... say, lines 32 - 37

<?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
<div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>

<?php if (!empty($totalsDisplay)) { ?>
  <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
  <br class="clearBoth" />

IF you do THIS...

<?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
<div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>

<div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION_ZIMMERS; ?></div>

<?php if (!empty($totalsDisplay)) { ?>
  <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
  <br class="clearBoth" />

... you will have created a your own place holder for a define, for a constant called TEXT_INFORMATION_ZIMMERS.


Now, you need to create that DEFINE statement, so open:

includes/languages/english/shopping_cart.php

And look for:

define('TEXT_INFORMATION', 'You may want to add some instructions for using the shopping cart here. (defined in includes/languages/english/shopping_cart.php)');

Just UNDER that, put the following:

define('TEXT_INFORMATION_ZIMMERS', 'This is Zimmers custom text... Hey Wow!');

Save the files (in your custom folders if you have them set up) and visit your shopping cart page.

20 years a Zencart User

19 Mar 2010, 9:43 PM
#5
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

I must be missing something. It looks like you're creating a second constant to hold some additional information, but that additional information will appear whenever the original TEXT_INFORMATION is echoed.

What I want is for TEXT_INFORMATION_ZIMMERS to show up only on step 2 of the checkout process. This looks like it will show up on step 1, no?

19 Mar 2010, 9:50 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

Ah... yes mike... I did not read your OP well enough.

Follow my PRINCIPLE above, but the DIV you have created should go somewhere into:
**
tpl_checkout_shipping_default.php**

... which is the NEXT page after shopping cart.

Just where you put it may be a matter of trial and error...

Also, bear in mind that you can give it its own STYLE ID as well.

In my example, I just copied the original <div id="cartInstructionsDisplay" class="content">

You could call it anything you like. <div id="cartInstructionsDisplayZimmer" class="content">

This will allow you to style it individually later.

20 years a Zencart User

19 Mar 2010, 9:57 PM
#7
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

OK, I can see how that would work. And, I assume for the following page, it would be file tpl_checkout_payment_default.php, and for the one after that, tpl_checkout_confirmation_default.php?

Thanks.

19 Mar 2010, 10:19 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

Yes... looks like the correct chronology...

20 years a Zencart User

19 Mar 2010, 11:16 PM
#9
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

OK...here's the line I put in tpl_checkout_shipping_default.php:

<div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION_SHIPPING; ?></div>

and here's the definition:

define('TEXT_INFORMATION_SHIPPING', '<b>SHIPPING INSURANCE:</b> Insurance is required on all shipments and will be automatically added to your order. We calculate insurance based on the rates supplied by UPS. You will see this amount on the next page. Insurance with the USPS is somewhat higher. Part of the USPS shipping rates you see on this page reflect their higher insurance rates.');

Now, for some reason, instead of displaying the text defined by the constant, the page is just printing out the name of the constant (TEXT_INFORMATION_SHIPPING).

I cut and pasted this verbatim...any ideas what I could have done wrong? It is at least showing up in the right place (and formatted like the TEXT_INFORMATION field on the preceding page), so I'm guessing I put the code in the right place.

Thanks.

20 Mar 2010, 12:51 AM
#10
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

I put a telltale in the file; apparently the definition isn't "taking." Is there some limit on the length of names used to define constants?

The page HTML validates...given that this is such a clone job, there really doesn't seem to be too many places to look for a mistake.

20 Mar 2010, 2:22 AM
#11
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

A-HA!!

There's something behind the scenes that links shopping_cart.php to tpl_shopping_cart_default.php, but not to tpl_checkout_shipping_default.php. The correct language file is in fact checkout_shipping.php. I inserted my new define in there and all is good now.

Score one for the good guys.

20 Mar 2010, 6:32 AM
#12
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: is there a TEXT_INFORMATION for steps 2 and 3?

mzimmers:

...The correct language file is in fact checkout_shipping.php...

Glad you found it... I did say in my earlier post... "Follow my PRINCIPLE above... "

I assumed you'd have seen that there is a separate language file for checkout shipping, just as there is for shopping cart.

20 years a Zencart User