Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A "simple" change in the code?


Guest

Recommended Posts

I need something similar...

 

I'm doing a website for a bookseller. We don't want to list the authors as "manufacturers", so I thought it'd be easy enough to change the text and filenames.

 

I used a PHP editor with a global search and replace to find all instances of the word "manufacturer" or "manufacturers". There were a total of 48 files with this change, including the language files. I was very careful about the case of the text, and changed "MANUFACTURER" to "AUTHOR" and "manufacturer" to "author" in all of them, then renamed "manufacturer.php" and "manufacturer_info.php" to "author.php" and "author_info.php" respectively.

 

So I created a new database and started the install. Everything looks good until I go to the Catalog section and click "Authors" (remember, it doesn't say "Manufacturers" anymore).

 

I then get an error message:

 

--------------------

1146 - Table 'osCommerce.authors' doesn't exist

select count(*) as total from authors

--------------------

 

I'm sure I missed something somewhere, and I think it didn't create a field or table in the database, but I'm not a programmer and don't know what I'm looking for. Can anyone help?

 

- Jamie -

Link to comment
Share on other sites

:(

 

Change all those files back. It's so easy, you're going to kick yourself...

 

Although, admittedly it's very hard to find.

 

Look in

 

catalog/includes/languages/YOURLANGUAGEHERE/YOURLANGUAGE.php

 

So for example,

 

catalog/includes/languages/english/english.php

 

Now, find the line that says

 

define('BOX_HEADING_MANUFACTURERS', 'Manufacturers');

 

And change it to say

 

define('BOX_HEADING_MANUFACTURERS', 'Authors');

 

That will globally change the display setting.

 

The backend will still be using the word "Manufacturers" but it will never display the word. In every place it would have displayed "Manufacturers" it will now display "Authors."

 

;)

 

Oh, the added benefit of this is that you don't have to modify the database at all. That's what your problem is - it uses the page context to determine which database table to look in, which can be a problem if you rename the pages.

Link to comment
Share on other sites

Wow!

 

Actually, your pathname is one level too long, but I got to the right place without a problem.

 

And I was making it much more difficult for myself, it wasn't necessary to do ANY of that stuff. It worked, like you said, first try. Although I had already damaged my database and had to reinstall it, on my hosting service that's a breeze. I deleted the entire site and uploaded it again (with the original files), set up the fresh database, and set up the site again in a matter of minutes.

 

I'll have the catalog in it tomorrow... there aren't but 9 books for sale at the moment, so this is a very easy project.

 

I really appreciate the help. Not only accurate, but fast too!

 

- Jamie -

Link to comment
Share on other sites

Wow!

 

Actually, your pathname is one level too long, but I got to the right place without a problem.

 

And I was making it much more difficult for myself, it wasn't necessary to do ANY of that stuff. It worked, like you said, first try. Although I had already damaged my database and had to reinstall it, on my hosting service that's a breeze. I deleted the entire site and uploaded it again (with the original files), set up the fresh database, and set up the site again in a matter of minutes.

 

I'll have the catalog in it tomorrow... there aren't but 9 books for sale at the moment, so this is a very easy project.

 

I really appreciate the help. Not only accurate, but fast too!

 

- Jamie -

Lol ack you're right, it's catalog/languages/blahblah

 

Sorry 'bout that :) I was working in two different directories at once when I posted and got myself mixed up ;)

 

Glad it helped!

 

Makes me feel like I did my good deed for the day :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...