Forums / General Questions / Where to edit shopping cart message?

Where to edit shopping cart message?

Started by dat311 on 7 Jun 2011, 9:02 PM · Views: 2,947

Results 21 to 32 of 32
28 Dec 2012, 12:05 AM
#21
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Where to edit shopping cart message?

Your shopping cart page does actually have the right container div:```
... method="post"><div id="cartInstructionsDisplay" class="content">For more information regarding Gift Certif...

/includes/languages/english/gv_redeem.php

Line #24 : define('TEXT_INFORMATION', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>'); 

It appears that the gift certificate version of that constant is being defined. If so, it cannot be redefined by the correct shopping cart version, even if it tries. (Actually, if it tries, it will cause a PHP error and crash.)
28 Dec 2012, 7:40 AM
#22
budy avatar

budy

New Zenner

Join Date:
Jun 2009
Posts:
56
Plugin Contributions:
0

Re: Where to edit shopping cart message?

gjh42:

Your shopping cart page does actually have the right container div:```
... method="post"><div id="cartInstructionsDisplay" class="content">For more information regarding Gift Certif...

> /includes/languages/english/gv_redeem.php
> 
> Line #24 : define('TEXT_INFORMATION', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>'); 
> 
> It appears that the gift certificate version of that constant is being defined. If so, it cannot be redefined by the correct shopping cart version, even if it tries. (Actually, if it tries, it will cause a PHP error and crash.)

:shocking:Well, it looks that I have a bit of a problem here. My shopping cart version is v1.3.9h. Is there any way to solve this?
28 Dec 2012, 2:59 PM
#23
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Where to edit shopping cart message?

For starters, change TEXT_INFORMATION to TEXT_INFORMATION_GVR in both relevant files:

/includes/languages/english/RI_TEMPLATE_07/gv_redeem.php

Line #24 : define('TEXT_INFORMATION_GVR', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>');

/includes/templates/RI_TEMPLATE_07/templates/tpl_gv_redeem_default.php

Line #19 : <div id="gvRedeemDefaultMainContent" class="content"><?php echo TEXT_INFORMATION_GVR; ?></div>

This will force that define to only ever apply to the gv_redeem page. If that frees up the correct define to operate, your problem is solved. (At least the symptom is solved... still don't know why it was trying to do that in the first place...)

28 Dec 2012, 4:56 PM
#24
budy avatar

budy

New Zenner

Join Date:
Jun 2009
Posts:
56
Plugin Contributions:
0

Re: Where to edit shopping cart message?

Thanks for the reply gjh42,

There isn't this file in the shopping cart:

/includes/templates/RI_TEMPLATE_07/templates/tpl_gv_redeem_default.php

Do you reckon this might be the cause of the problem? Should I upload this file from the zencart v1.3.9h (my version).

I've changed already the other one following your instructions.

28 Dec 2012, 6:08 PM
#25
budy avatar

budy

New Zenner

Join Date:
Jun 2009
Posts:
56
Plugin Contributions:
0

Re: Where to edit shopping cart message?

Modifications:

includes/templates/RI_TEMPLATE_07/templates/tpl_gv_redeem_default.php

<?php
/**
 * Page Template
 *
 * Display information related to GV redemption (could be redemption details, or an error message)
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_gv_redeem_default.php 4155 2006-08-16 17:14:52Z ajeh $
 */
?>
<div class="centerColumn" id="gvRedeemDefault">

<h1 id="gvRedeemDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

<div id="gvRedeemDefaultMessage" class="content"><?php echo sprintf($message, $_GET['gv_no']); ?></div>

<div id="gvRedeemDefaultMainContent" class="content"><?php echo TEXT_INFORMATION_GVR; ?></div>

<div class="buttonRow forward"><?php echo '<a href="' . ($_GET['goback'] == 'true' ? zen_href_link(FILENAME_GV_FAQ) : zen_href_link(FILENAME_DEFAULT)) . '">' . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>'; ?></div>

</div>

includes/languages/english/RI_TEMPLATE_07/gv_redeem.php

<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//   * @version $Id: J_Schilz for Integrated COWOA - 14 April 2007
//

define('NAVBAR_TITLE', 'Redeem ' . TEXT_GV_NAME);
define('HEADING_TITLE', 'Redeem ' . TEXT_GV_NAME);
define('TEXT_INFORMATION_GVR', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>');
define('TEXT_INVALID_GV', 'The ' . TEXT_GV_NAME . ' number %s may be invalid or has already been redeemed. To contact the shop owner please use the Contact Page');
define('TEXT_VALID_GV', 'Congratulations, you have redeemed a ' . TEXT_GV_NAME . ' worth %s.');

define('ERROR_GV_CREATE_ACCOUNT', 'To redeem a Gift Voucher you must create an account.');
define('ERROR_GV_COWOA', 'To redeem a Gift Voucher you must create an account.  You may not enter a Gift Voucher once you have begun checking out without an account. If you would like to use a Gift Voucher, you may <a href="' . zen_href_link(FILENAME_LOGOFF, '', 'SSL', false) . '">click here</a> to end your session, empty your cart, and begin again.');
// eof

:no: no change

28 Dec 2012, 7:48 PM
#26
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Where to edit shopping cart message?

So the shopping cart page is still outputting the text now defined for TEXT_INFORMATION_GVR? That means that somewhere TEXT_INFORMATION is still defined the same way.

Try a search in the DTK for

For more information regarding

and see if there is any other file that has that. (Ignore any that are definitely not related to this case, but have different messages that just happen to contain those words.)

What do you have in /includes/languages/english/RI_TEMPLATE_07/shopping_cart.php around <div id="cartInstructionsDisplay" ?

You might try it in the other direction, changing TEXT_INFORMATION to TEXT_INFORMATION_SC in the above file and in /includes/languages/english/RI_TEMPLATE_07/shopping_cart.php.

By the way, in your post #9 above, the "bit" of text is actually two completely separate output items. What we have been discussing is only the second part.

28 Dec 2012, 9:17 PM
#27
budy avatar

budy

New Zenner

Join Date:
Jun 2009
Posts:
56
Plugin Contributions:
0

Re: Where to edit shopping cart message?

So the shopping cart page is still outputting the text now defined for TEXT_INFORMATION_GVR? That means that somewhere TEXT_INFORMATION is still defined the same way.

Try a search in the DTK for

For more information regarding

and see if there is any other file that has that. (Ignore any that are definitely not related to this case, but have different messages that just happen to contain those words.)

Below are the files found with the DTK

includes/languages/english/RI_TEMPLATE_07/gv_redeem.php

Line #24 : define('TEXT_INFORMATION_GVR', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>');

includes/languages/english/extra_definitions/RI_TEMPLATE_07/gv_redeem.php

Line #24 : define('TEXT_INFORMATION', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>');

includes/languages/english/gv_redeem.php

Line #24 : define('TEXT_INFORMATION', 'For more information regarding ' . TEXT_GV_NAME . ', please see our <a href="' . zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL').'">' . GV_FAQ . '.</a>'); 

What do you have in /includes/languages/english/RI_TEMPLATE_07/shopping_cart.php around <div id="cartInstructionsDisplay" ?

As you can see there isn't that bit

<?php
/*

GPL released as part of the big_royalmail_v2.3 package

see CREDITS.txt for the contributors and support forum.

*/

define('NAVBAR_TITLE', 'The Shopping Cart');
define('HEADING_TITLE', 'Your Shopping Cart Contents');
define('HEADING_TITLE_EMPTY', 'Your Shopping Cart');
define('TEXT_INFORMATION', 'For printed books, you will receive your book(s) on standard delivery times. <br/> For ebooks, you may download your ebook <b> immediately upon purchase<b/>. <br/> Payments are processed through PayPal. <b> No PayPal account required<b/>');
define('TABLE_HEADING_REMOVE', 'Remove');
define('TABLE_HEADING_QUANTITY', 'Qty.');
define('TABLE_HEADING_MODEL', 'Model');
define('TABLE_HEADING_PRICE','Unit');
define('TEXT_CART_EMPTY', 'Your Shopping Cart is empty.');
define('SUB_TITLE_SUB_TOTAL', 'Sub-Total:');
define('SUB_TITLE_TOTAL', 'Total:');

define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' are out of stock or there are not enough in stock to fill your order.<br />Please change the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '). Thank you');
define('OUT_OF_STOCK_CAN_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' are out of stock.<br />Items not in stock will be placed on backorder.');

define('TEXT_TOTAL_ITEMS', 'Total Items: ');
define('TEXT_TOTAL_WEIGHT', '  Weight: ');
define('TEXT_TOTAL_AMOUNT', '  Amount: ');

define('TEXT_VISITORS_CART', '<a href="javascript:session_win();">[help (?)]</a>');
define('TEXT_OPTION_DIVIDER', ' - ');

In fact I just checked the files in my template folder and there is not shopping_cart.php file

By the way, in your post #9 above, the "bit" of text is actually two completely separate output items. What we have been discussing is only the second part.

I don't know if to cry or laugh :blink:

28 Dec 2012, 11:17 PM
#28
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Where to edit shopping cart message?

What do you have in /includes/languages/english/RI_TEMPLATE_07/shopping_cart.php around <div id="cartInstructionsDisplay" ? Sorry, that should have been /includes/templates/RI_TEMPLATE_07/templates/tpl_shopping_cart_default.php.
If you don't have a customized copy in your template folder, you would look at the original in /includes/templates/template_default/templates/tpl_shopping_cart_default.php.

The /extra_definitions/ folder is only for files that are not present in a stock install. You should not have /includes/languages/english/extra_definitions/RI_TEMPLATE_07/gv_redeem.php when there is /includes/languages/english/gv_redeem.php; make any edits in /includes/languages/english/RI_TEMPLATE_07/gv_redeem.php.

This may be the cause of the issue, as all /extra_definitions/ files are autoloaded for all pages.

29 Dec 2012, 1:25 PM
#29
budy avatar

budy

New Zenner

Join Date:
Jun 2009
Posts:
56
Plugin Contributions:
0

Re: Where to edit shopping cart message?

Hi gjh42,

What do you have in /includes/languages/english/RI_TEMPLATE_07/shopping_cart.php around <div id="cartInstructionsDisplay" ?
Sorry, that should have been /includes/templates/RI_TEMPLATE_07/templates/tpl_shopping_cart_default.php.
If you don't have a customized copy in your template folder, you would look at the original in /includes/templates/template_default/templates/tpl_shopping_cart_default.php.

This is what I have:

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

The /extra_definitions/ folder is only for files that are not present in a stock install. You should not have /includes/languages/english/extra_definitions/RI_TEMPLATE_07/gv_redeem.php when there is /includes/languages/english/gv_redeem.php; make any edits in /includes/languages/english/RI_TEMPLATE_07/gv_redeem.php.

When you say make any edits in /includes/languages/english/RI_TEMPLATE_07/gv_redeem.php you mean remove this file? I suppose it is so, since I already have the file you mentioned.

29 Dec 2012, 6:37 PM
#30
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Where to edit shopping cart message?

You should not have /includes/languages/english/extra_definitions/RI_TEMPLATE_07/gv_redeem.php.
Delete that file; I think it is causing the issue you have.

All of your customization should be in
/includes/languages/english/RI_TEMPLATE_07/gv_redeem.php.

29 Dec 2012, 8:43 PM
#31
budy avatar

budy

New Zenner

Join Date:
Jun 2009
Posts:
56
Plugin Contributions:
0

Re: Where to edit shopping cart message?

Well, finally it seems we are getting somewhere. Thank you gjh42,

I deleted that file, and I did the customization in
/includes/languages/english/RI_TEMPLATE_07/gv_redeem.php.
and the site went down. I redid the customization and the text I wanted appeared. Then I checked in which files the text is, as I put it in some places, and I found it in 4 different places.

/includes/languages/english/RI_TEMPLATE_07/login.php

/includes/languages/english/RI_TEMPLATE_07/shopping_cart.php

/includes/languages/english/login.php

/includes/languages/english/shopping_cart.php

I went for, /includes/languages/english/RI_TEMPLATE_07/shopping_cart.php, to do some editing but I can do some but not much, do you thing having that text in four different places is interfering with it?

31 Dec 2012, 1:51 AM
#32
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Where to edit shopping cart message?

Make a small change in each of those defines (say add the folderpath of the current file to each define) so you know for sure which file is actually being used where. Ignore
/includes/languages/english/login.php
and
/includes/languages/english/shopping_cart.php
since the override versions of each of those will cause these originals to be ignored by Zen Cart.

And search the DTK for a snippet of the other part of text that you want to change, to find which file defines that.