Zen Cart Logo
Forums / All Other Contributions/Addons / Moving Shopping Cart text to define pages

Moving Shopping Cart text to define pages

Views: 4,600

Results 1 to 13 of 13
1 Sep 2007, 6:50 PM
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Moving Shopping Cart text to define pages

I decided I was tired of having to stop and get the shopping cart English file and wipe out the instructions that appear at the top of the shopping cart. I set up everything to move it to the define pages instead so that my clients can customize this themselves. Perhaps the zen gurus don't see this as logical since most define pages links appear in the information and more information sideboxes.

So, I added this line to the shopping cart header:

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_SHOPPING_CART, 'false');
/**

this line to the filenames.php
define('FILENAME_DEFINE_SHOPPING_CART', 'define_shopping_cart');

and these lines to the shopping cart template:

<?php /** * require the html_defined text for shopping cart */ require($define_page); ?> </div>

which looks to be all that needs to be done.

I can edit the file in the define pages editor but I get this error in the cart:
Fatal error: require() [function.require]: Failed opening required '' (include_path='.:')...

So it's not finding the file. What did I miss?

1 Sep 2007, 8:29 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Moving Shopping Cart text to define pages

And you loaded a copy in the original /html_includes so there is a file to override?

1 Sep 2007, 8:35 PM
#3
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Moving Shopping Cart text to define pages

Yes ma'am - though I laughed when I read your post '[cause I figured I had done that kind of thing! Wasn't that dumb though! So how dumb am I? Head cold doesn't help.

Afternoon, Linda, glad to see you hard at work today!

3 Sep 2007, 1:50 PM
#4
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Moving Shopping Cart text to define pages

I just read my previous post and realized how dumb I am this week. I meant to say that I had done that so that wasn't the problem. What a very long weekend!

28 Dec 2007, 10:13 AM
#5
crusty avatar

crusty

New Zenner

Join Date:
Dec 2007
Posts:
8
Plugin Contributions:
0

Re: Moving Shopping Cart text to define pages

delia:

I decided I was tired of having to stop and get the shopping cart English file and wipe out the instructions that appear at the top of the shopping cart. I set up everything to move it to the define pages instead so that my clients can customize this themselves. Perhaps the zen gurus don't see this as logical since most define pages links appear in the information and more information sideboxes.

So, I added this line to the shopping cart header:

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_SHOPPING_CART, 'false');
/**

this line to the filenames.php
define('FILENAME_DEFINE_SHOPPING_CART', 'define_shopping_cart');

and these lines to the shopping cart template:

<?php /** * require the html_defined text for shopping cart */ require($define_page); ?> </div>

which looks to be all that needs to be done.

I can edit the file in the define pages editor but I get this error in the cart:
Fatal error: require() [function.require]: Failed opening required '' (include_path='.:')...

So it's not finding the file. What did I miss?

i don't suppose you could be a little more clear in exactly which files you had to edit? i've followed most of the instructions but hae come up with non-functional code when putting the code into the shopping cart header

like so

define('NAVBAR_TITLE', 'The Shopping Cart');

define('HEADING_TITLE', 'Your Shopping Cart Contents');

define('HEADING_TITLE_EMPTY', 'Your Shopping Cart');

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_SHOPPING_CART, 'false');
/**

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', ' - ');

?>

28 Dec 2007, 2:16 PM
#6
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Moving Shopping Cart text to define pages

I never got this working and Linda never gave me any more hints. I can probably get it working now but don't have time immediately. Will get to it.

5 Jan 2008, 5:13 PM
#7
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Moving Shopping Cart text to define pages

Okay, complete instructions plus I am posting a mod in the contributions section.

In order to add information with the define pages function to any page:

(instructions are for the shopping cart - I'm using v1.3.8)

create your html includes file - it is a blank file named define_shopping_cart.php
upload that to your includes/language/english/html_includes and to includes/language/english/html_includes/your folder.

Edit includes/modules/pages/shopping_cart/header.php.php. Add this line
// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_SHOPPING_CART, 'false');
before
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_SHOPPING_CART');

Edit includes/filenames.php - add
define('FILENAME_DEFINE_SHOPPING_CART', 'define_shopping_cart');
be nice to yourself and put it in alphabetically- line 68

Edit includes/templates/your folder/templates/tpl_shopping_cart_default.php.
line 33
Replace <?php echo TEXT_INFORMATION ?> with <?php echo define_page ?>

5 Jan 2008, 6:06 PM
#8
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Moving Shopping Cart text to define pages

Sorry - just was reminded of something that my subconscious was trying to tell me - instead of altering filenames.php, add a file instead.

includes/extra_datafiles/define_shopping_cart_filenames.php

with at least this in it

<?php define('FILENAME_DEFINE_SHOPPING_CART', 'define_shopping_cart'); ?>
28 Oct 2008, 1:52 PM
#9
chcholman avatar

chcholman

New Zenner

Join Date:
Nov 2007
Posts:
9
Plugin Contributions:
0

Re: Moving Shopping Cart text to define pages

Hi - I was just looking to do the exact same thing and figured I'd ask if you'd ever gotten a mod together?
Thanks!

Cait

3 Nov 2008, 9:16 PM
#10
chcholman avatar

chcholman

New Zenner

Join Date:
Nov 2007
Posts:
9
Plugin Contributions:
0

Re: Moving Shopping Cart text to define pages

Just in case anyone was wondering how to do this, the instructions above worked well right up until the end where the text wouldn't display properly on the page. I finally got it to work, and the process went like this:

  1. create your html includes file - it is a blank file named define_shopping_cart.php

  2. upload that to your includes/language/english/html_includes

  3. and to includes/language/english/html_includes/YOUR_TEMPLATE/

  4. Edit includes/modules/pages/shopping_cart/header.php.php. Add this line

    // include template specific file name defines
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_SHOPPING_CART, 'false');
    before
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_SHOPPING_CART');

  5. Add file:
    includes/extra_datafiles/define_shopping_cart_filenames.php

    with at least this in it

    <?php define('FILENAME_DEFINE_SHOPPING_CART', 'define_shopping_cart'); ?>
  6. Edit includes/templates/your folder/templates/tpl_shopping_cart_default.php.
    line 33
    **
    Replace**

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

with :

<div id="cartInstructionsDisplay" class="content"> <?php /** * require the html_defined text for checkout success */ require($define_page); ?> </div>

:D

19 Nov 2008, 6:30 AM
#11
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Re: Moving Shopping Cart text to define pages

chcholman:

  1. Edit includes/templates/your folder/templates/tpl_shopping_cart_default.php.
    line 33
    **
    Replace**
<div id="cartInstructionsDisplay" class="content"><?php echo define_page ?> </div>

with :

<div id="cartInstructionsDisplay" class="content"> <?php /** * require the html_defined text for checkout success */ require($define_page); ?> </div>

:D

That last step made it so that when I go to the shopping cart after adding products nothing displays in the cart, just the page title and side boxes and all other stuff but no shopping cart text or items added.

I am using 1.3.8 ac version. Not sure if that has something to do with it.

1 Jan 2011, 12:35 PM
#12
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Moving Shopping Cart text to define pages

I have submitted an updated version of the mod Define Pages - Shopping Cart - **available here**

The version number is 1.4 and should be approved and ready for download in a few days from now.

It is tested on ZC 1.3.9h but may work with earlier versions (proceed with caution).

===========
Change Log:

01/01/2011, added German language files, fixed bug relating to > require($define_page); as per last post and made instructions clearer
30/04/2010, added version for 1.3.9a

9 Jan 2011, 10:10 PM
#13
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Moving Shopping Cart text to define pages

The updated v1.4 has been approved and is now available for **download here**