Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need help to edit .pdf files


DnL Crafts

Recommended Posts

I have edited a couple files using the admin-tools-define Languages feature.  One being Shipping and Returns - I made sure to stay between ' ' like it should be, now I get this in the nav bar Top » Catalog » NAVBAR_TITLE and on the page where my shipping information should be is showing this,  

HEADING_TITLE

TEXT_INFORMATION
 

I edited the index file and now on the catalog and Top pages I get this 

HEADING_TITLE

Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?
TEXT_MAIN
TABLE_HEADING_NEW_PRODUCTS

The backup files did not fix the problem.

What can I do to fix the problem  short of uninstalling the program  -  I am using 2.3.4  

Lou Brown

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

Probably you have damaged the english index file.

catalog/includes/languages/english/index.php

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2007 osCommerce

  Released under the GNU General Public License
*/

define('TEXT_MAIN', '');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
define('HEADING_TITLE', 'Welcome to ' . STORE_NAME);
define('TABLE_HEADING_IMAGE', '');
define('TABLE_HEADING_MODEL', 'Model');
define('TABLE_HEADING_PRODUCTS', 'Product Name');
define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
define('TABLE_HEADING_QUANTITY', 'Quantity');
define('TABLE_HEADING_PRICE', 'Price');
define('TABLE_HEADING_WEIGHT', 'Weight');
define('TABLE_HEADING_BUY_NOW', 'Buy Now');
define('TEXT_NO_PRODUCTS', 'There are no products available in this category.');
define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
define('TEXT_SHOW', '<strong>Show:</strong>');
define('TEXT_BUY', 'Buy 1 \'');
define('TEXT_NOW', '\' now');
define('TEXT_ALL_CATEGORIES', 'All Categories');
define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
?>

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I edited the index file and now on the catalog and Top pages I get this 

HEADING_TITLE

Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?
TEXT_MAIN
TABLE_HEADING_NEW_PRODUCTS

 

You don't edit the index file. You edit the language definition file where terms like HEADING_TITLE are defined as macros. During the page build, whatever text you defined for it is substituted for that term, e.g.,

define('TEXT_MAIN', 'Welcome Guest! Would you like.... ?');

Is that what you have? It sounds like something went wrong. Maybe you overwrote TEXT_MAIN instead?

 

By the way, these are PHP files, not PDF files. Two entirely different things.

Link to comment
Share on other sites

define('TEXT_MAIN', '');define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');define('HEADING_TITLE', 'Welcome to ' . STORE_NAME);define('TABLE_HEADING_IMAGE', '');

The only thing I touched to edit in the index.php file was - define('Text_Main', ' ');  and I made sure to put the statement I wanted to show inside the '' as instructed. This is what I have in there now.  

 

define('TEXT_MAIN', 'The woodcrafts are created by Don Brown and the paper quilling is created by Lou Brown. When we list clothing it is items that we have outgrown over the years. If we list collectibles, that is exactly why we have them. We have collected treasures for over 40 years from various places we have visited or lived. 

Please come back often, I will be adding product daily, I hope.

');

 

This is what shows to the public on the site.

HEADING_TITLE

Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?
TEXT_MAIN
TABLE_HEADING_NEW_PRODUCTS

and the product pictures are showing below this

I have copied and pasted what was posted above by Json and it fixed this problem.  I still do not know what I did wrong. 

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

I have tried editing the index page again in the  define('TEXT_MAIN', '');  section and it did the same thing as before I copied and pasted the code Json posted.  Where can I go to put in a welcome statement?  

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

your_web_root/includes/languages/english/index.php

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

No! Do not go changing index.php if there is already provision such as TEXT_MAIN for including your text.

 

You show both "TEXT_MAIN" and "Text_Main" in your posts. They are different! If TEXT_MAIN is what the index file is looking for, don't go changing it to Text_Main.

 

If your definition for TEXT_MAIN is not being picked up, you must have either removed (or damaged) the "include" statement that pulls in that file, or there's something odd about your PHP configuration's include search path. Are other "include" directory files being found OK? You didn't do something silly like give the file unreadable permissions, or edit the file and forget to upload it to the server?

Link to comment
Share on other sites

Hello phil,  I go to my site/admin/Tools/Define Languages/Index.php This is what I have there:

 

This shows in the box to edit before I click source:

 Show:'); define('TEXT_BUY', 'Buy 1 \''); define('TEXT_NOW', '\' now'); define('TEXT_ALL_CATEGORIES', 'All Categories'); define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers'); ?>

 

If I leave this in the box and click source to get to the html codes it shows at the top of my front page.

 

This is the code inside of the index.php 

<!--?php

/*
  $Id$
 
  osCommerce, Open Source E-Commerce Solutions
 
  Copyright © 2007 osCommerce
 
  Released under the GNU General Public License
*/
 
define('TEXT_MAIN', '');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
define('HEADING_TITLE', 'Welcome to ' . STORE_NAME);
define('TABLE_HEADING_IMAGE', '');
define('TABLE_HEADING_MODEL', 'Model');
define('TABLE_HEADING_PRODUCTS', 'Product Name');
define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
define('TABLE_HEADING_QUANTITY', 'Quantity');
define('TABLE_HEADING_PRICE', 'Price');
define('TABLE_HEADING_WEIGHT', 'Weight');
define('TABLE_HEADING_BUY_NOW', 'Buy Now');
define('TEXT_NO_PRODUCTS', 'There are no products available in this category.');
define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
define('TEXT_SHOW', '<strong-->
<p>Show:'); define('TEXT_BUY', 'Buy 1 \''); define('TEXT_NOW', '\' now'); define('TEXT_ALL_CATEGORIES', 'All Categories'); define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers'); ?></p>
 

I have never touched any php other than this one  define('TEXT_MAIN', ''); I make sure to only edit between ' here ' where the instructions says 

 

 

pixel_trans.gif

Editing Definitions

Each language definition is set using the PHP define() function in the following manner:

define('TEXT_MAIN', 'This text can be edited. It\'s really easy to do!');

The highlighted text can be edited. As this definition is using single quotes to contain the text, any single quotes within the text definition must be escaped with a backslash (eg, It\'s).
 

Here is what shows if I edit index.php

 

This is what shows to the public on the site.

HEADING_TITLE

Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?
TEXT_MAIN
TABLE_HEADING_NEW_PRODUCTS

and the product pictures are showing below this

 

What am I doing wrong??

This is what I have entered that messed up my world.  Is there something wrong with this statement that would cause everything to go crazy.

 

define('TEXT_MAIN', 'The woodcrafts are created by Don Brown and the paper quilling is created by Lou Brown. When we list clothing it is items that we have outgrown over the years. If we list collectibles, that is exactly why we have them. We have collected treasures for over 40 years from various places we have visited or lived. 

Please come back often, I will be adding product daily, I hope. ');

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

No I have not changed the permissions on anything.  The information box items Shipping and Returns is messed up on my site and Privacy is messed up on the other site I have.  They were both edited in admin/Tools/Defines Languages and the files mentioned above.  I have not dared to edit conditions.  Contact works fine. on both sites.

 

 

<!--?php
/*
  $Id$
 
  osCommerce, Open Source E-Commerce Solutions
 
  Copyright © 2002 osCommerce
 
  Released under the GNU General Public License
*/
 
define('NAVBAR_TITLE', 'Shipping & Returns');
define('HEADING_TITLE', 'Shipping & Returns');
 
define('TEXT_INFORMATION', ' Your order will ship United States Postal Service next business day after your payment clears.  All returns must have a return authorization before you return an item.  Contact us and describe the damage, but if return is requested just because you do not like the item there will be a 20% restocking fee and you will have to pay postage. ');
?-->

 

This is what shows to the public on my shipping and returns page. This in the nav bar Top » Catalog » NAVBAR_TITLE and on the page where my shipping information should be is showing this,  

HEADING_TITLE

TEXT_INFORMATION

 

This is on both conditions and shipping and receiving on two different sites..

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

Are you saying that the PHP define statements show up in your displayed page's HTML source? That shouldn't be.

 

 

This is what shows to the public on the site.

 

Are you seeing both TEXT_MAIN and Welcome Guest! Would... ? If you are, something (or someone) messed up the edit and put TEXT_MAIN in with the "Welcome" text. You used only the Defines Languages tool and didn't manually edit any language or index file?

 

What your files should look like, for example, is (/catalog/index.php)

...
  <div class="contentText">

    <?php echo TEXT_MAIN; ?>

  </div>

...

and (/catalog/includes/languages/english/index.php) has something like

define ('TEXT_MAIN', 'Our wonderful store has everything you\'d ever want, at low, low prices!');

When the page is produced, you would end up with

...
  <div class="contentText">

    Our wonderful store has everything you'd ever want, at low, low prices!

  </div>

...

You won't see a literal TEXT_MAIN on the output, unless the editing was messed up.

 

Above this TEXT_MAIN content (if you have any), is the HEADING_TITLE, which by default is "Welcome to STORE NAME" in a heading tag.

 

Finally, check your "language" file that you didn't somehow end up with several defines for entries like TEXT_MAIN. There should be only one.

Link to comment
Share on other sites

This is the code inside of the index.php when accessed using mysite/admin/Tools/Define Languages/ english.php comes up with a very long list of files,  I then click on index.php and this is what shows when I click the source button

 

<!--?php

/*
  $Id$
 
  osCommerce, Open Source E-Commerce Solutions
 
  Copyright © 2007 osCommerce
 
  Released under the GNU General Public License
*/
 
define('TEXT_MAIN', '');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
define('HEADING_TITLE', 'Welcome to ' . STORE_NAME);
define('TABLE_HEADING_IMAGE', '');
define('TABLE_HEADING_MODEL', 'Model');
define('TABLE_HEADING_PRODUCTS', 'Product Name');
define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
define('TABLE_HEADING_QUANTITY', 'Quantity');
define('TABLE_HEADING_PRICE', 'Price');
define('TABLE_HEADING_WEIGHT', 'Weight');
define('TABLE_HEADING_BUY_NOW', 'Buy Now');
define('TEXT_NO_PRODUCTS', 'There are no products available in this category.');
define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
define('TEXT_SHOW', '<strong-->
 
If I edit    define('TEXT_MAIN', '');   between '' like I am supposd to, this is what shows on the main page of my site.
 

HEADING_TITLE

Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?
TEXT_MAIN
TABLE_HEADING_NEW_PRODUCTS

and the product pictures are showing below this

I do not know how else to explain this problem.  I have copied and pasted the code that Json gave me way up top of this post and if cleared the problem.  I tried editing and fixing by coping the code from Json's post several times and it messed EVERY TIME so have just left it alone.  
 
If I can't fix things any other way, I will uninstall the program and start over using a different version of OSC or go back to ZenCart.  I had an OSC site years ago and it worked great until someone hacked into it and put a bunch of sex crap on it that I could not get off, so had to uninstall that too.
 
What version OSC would you reccommend?  Both my current sites are running v.2.3.4  
Thanks to you and Json for all your help so far.  I know I am a big thorn in your sides.

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

If I edit    define('TEXT_MAIN', '');   between '' like I am supposd to, this is what shows on the main page of my site.

 

Please show the resulting line. It should look something like

define('TEXT_MAIN', 'Here is my added text');

Then, did you remove any changes you manually added to index.php? It should just have the line

<?php echo TEXT_MAIN; ?>

in there, and not any text you added.

 

Good catch, @@bonbec, on the <!--?php  error. Fixing that might clear up a lot of the problem. @, did you change that line, or did the editor tool? Have you been using an HTML page editor to edit pages, e.g., Dreamweaver? DON'T!

Link to comment
Share on other sites

Thanks BonBec That must have been the problem, I have edited the home page https://dnlcrafts.com  and it shows correctly.  My only problem is the information boxes Shipping and Returns and such.  Please send me the correct code for those pages If you can.  Something evidently went wrong with the install.  I use Notepad++ to edit the files.  I learned long ago not to use word products because they put in extra code.  At least they did years ago.  Thanks Phil

 

I believe I have found the problem with my files Looks like something has put <!--?php at the beginning and ?--> at the end of all the editable files.  I edit those files in admin/Tools/Define Languages/ and any of the information box items.  I guess I will just have to remember to take out the ! and dashes before saving.  Sure would be nice to know why the source files comes in like that with the --- and such. I installed OSC using Softaculous so maybe that has caused my problems.

 

I am truly grateful for all the information that all you gentlemen, Json, MrPhil and bombec have given me.  I believe most, if not all my problems are solved.  At least for the moment.

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

Hi @

 

  I edit those files in admin/Tools/Define Languages/ and any of the information box items.  I guess I will just have to remember to take out the ! and dashes before saving.  

 

I tried to do for another member the same as I just go the admin login -->> just to say: forget it!! 

 

The same happened all the time - you can take out these extra "-->" etc - save the file - open it again and they are there again...

 

So NEVER edit files on the server directly. Always download what you want to change - make a copy of that file - edit the original file - upload it. 

If something goes wrong, you still have the copy of the original file to replace.

 

Use a ftp tool to access your server (eg FileZilla, which is free) - so you can quickly connect, up- and download.

 

Especially when starting with add-ons which might require coding some .php files.

 

Kind regards - Felix

Whoever finds errors and misspellings in my postings can keep them  o:)

 

Moving from 2.2 MS to 2.3.4 BS EDGE - and I love this version!

 

I might show "online" all the time - but I might be away from my computer  ;)

Link to comment
Share on other sites

Frankl, I  download Notepad++ several years ago and it probably did catch the error but my ignorance did not see it untilit was pointed out to me above by bonbec.  

 

Malcolm, I do download files edit them and then upload the edited file on most things, but it seemed so simple to use the admin tools feature.  Thanks to bonbec he caught the error that was causing me to tear out my hair.

 

Felix, I thank you for giving my friend the code for the information box files.  She did not understand how she was to use it but we now have that ironed out and I have fixed her files.  She and I both thank you.

 

I believe this problem is solved and I am a bit smarter.  You gentlemen have been good teachers.  Keep up the good work.

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

So it was the admin tool for editing files? Exactly what version of osC are you using? If it's a current version, the developers should either fix or remove the tool if it's going to do stuff like that.

Link to comment
Share on other sites

post-214535-0-90149500-1491578869_thumb.jpgYes Phil it is the tools function in admin that is causing the problem.  I used Softaculous to install on the server and it shows v 2.3.4 I installed on 2 different domains.  They both have the same problem when editing .php files using admin tools function.  You have to remove the !-- from the first line and the -- at the bottom even if you just go in and look and make no changes.

Lou Brown
Florida Panhandle USA

Link to comment
Share on other sites

osC 2.3.4 is obsolete and unsupported. All development work is proceeding with osC 2.3.4BS "Edge". Who knows when, if ever, the tool will be fixed.
 
There was a report today in Editing Privacy, Conditions, Shipping pages of someone else having the same trouble with this tool.

@@burt, has the Define Languages tool been fixed in 2.3.4BS? If not, you may want to disable or remove it.

Link to comment
Share on other sites

Probably corrupt HTML WYSIWYG page editors installed for define language editor.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I have no clue... What was considered broken in it?

 

Several people recently now reported using the Define Language tool to edit language files, and the result is that <?php gets corrupted into <!--?php. At least one of them apparently was on 2.3.4BS. @@Gergely suggests that it might be a bad WYSIWYG editor.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...