Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need to create two types of Manufacturers


Benjjj6

Recommended Posts

Hi

 

I think I need to create two types of manufacturers because Im creating a site where I sell alternative/music t-shirts and I want to sort the products by 'Brand' and by 'Band'. Considering no band t-shirt will be related to a brand and no brands have band t-shirts I cant do this with attributes. I also want to have two dropdown lists, one for Brands and one for Bands, so I cant just group them both together under 'manufacturers'.

 

Its like I need a second manufacturers list, or can this be done with attributes, if I kept the manufacturer as 'none' for the band T-shirts and then added an attribute saying what band they were?

 

Could anyone help?

Link to comment
Share on other sites

I would in fact use the contribution "manufacturer 2" for this problem

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

hi Monika,

 

I installed the contrib and everythign seems to be fine apart from one SQL error.

 

Running the SQL code was the first thing I did and I got an error after running it, however, I continued anyway. Now I have finished installing it when i click manufacturers2 under catalog in the admin section i get this error message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-6, 6' at line 1

select manufacturers2_id, manufacturers2_name, manufacturers2_image, date_added, last_modified from manufacturers2 order by manufacturers2_name limit -6, 6

 

 

 

The SQL code I ran was this:

 

CREATE TABLE `manufacturers2` ( 
 `manufacturers2_id` int(11) NOT NULL auto_increment, 
 `manufacturers2_name` varchar(32) NOT NULL default '', 
 `manufacturers2_image` varchar(64) default NULL, 
 `date_added` datetime default NULL, 
 `last_modified` datetime default NULL, 
 PRIMARY KEY  (`manufacturers2_id`), 
 KEY `IDX_MANUFACTURERS2_NAME` (`manufacturers2_name`) 
) TYPE=MyISAM AUTO_INCREMENT=12; 


ALTER TABLE `products` ADD `manufacturers2_id` int(11) default NULL

CREATE TABLE `manufacturers2_info` (
 `manufacturers2_id` int(11) NOT NULL default '0',
 `languages_id` int(11) NOT NULL default '0',
 `manufacturers2_url` varchar(255) NOT NULL default '',
 `url_clicked` int(5) NOT NULL default '0',
 `date_last_click` datetime default NULL,
 PRIMARY KEY  (`manufacturers2_id`,`languages_id`)
) TYPE=MyISAM;

 

 

however, this contrib came with two txt files, one called readme.txt and one called manufacturers2.txt

 

The readme file contained that SQL code and install instructions, whilst the manufacturers2.txt file only contained this SQL code:

 

CREATE TABLE `manufacturers2` ( 
 `manufacturers2_id` int(11) NOT NULL auto_increment, 
 `manufacturers2_name` varchar(32) NOT NULL default '', 
 `manufacturers2_image` varchar(64) default NULL, 
 `date_added` datetime default NULL, 
 `last_modified` datetime default NULL, 
 PRIMARY KEY  (`manufacturers_id`), 
 KEY `IDX_MANUFACTURERS_NAME` (`manufacturers_name`) 
) TYPE=MyISAM AUTO_INCREMENT=12;

ALTER TABLE `products` ADD `manufacturers2_id` int(11) default NULL

 

Should I try and run this new code? I just spotted the only difference is the first one uses manufacturers2_id and manufacturers2_name whilst the second file just uses manufacturers_id and manufacturers_name

 

 

looking forward to your reply.... this is almost working,

 

Ben

Link to comment
Share on other sites

there is no problem with your code from the contrib.

 

you do not have the patches installed ... get them and add them, what you see is the "-20,20" bug (shows when no rows are in a table)

http://www.monikamathe.com/downloads.php (4th link)

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

thanx Monika that solved that problem, I also patched the bug where you would get slashes where you put apostrophes in the products description - thats been bothering me for a while lol

 

However, when I click 'manufacturers2' under catalog to view the manufacturers or add a new one I get this error on the page

 

1054 - Unknown column 'manufacturers2_id' in 'where clause'

select count(*) as products_count from products where manufacturers2_id = '12'

[TEP STOP]

 

 

Do you know what the problem could be?

Link to comment
Share on other sites

hi yes, did you add the column manufacturers2_id to your products table?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

that's the new table. Please check table products

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

add it , it's needed!

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Alter TABLE products add manufacturers2_id int NULL;

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

thanx, i ran that and i no longer get the error when I click 'manufacturers2' although, when I click insert to create a new manufacturer2 i get this error:

 

1054 - Unknown column 'manufacturers2_url' in 'field list'

insert into manufacturers_info (manufacturers2_url, manufacturers2_id, languages_id) values ('', '14', '1')

[TEP STOP]

Link to comment
Share on other sites

Ben, I'm really confused. I believed that contrib was a nice install, but you have errors on every step. I'm pretty sure all sql statements are in there also, and the last error makes me wonder if you followed all steps. Can you please double check?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Here are the problems I came across reading through the install instructions again:

 

 

It asked me to:

 

7.) open admin/includes/english/categories.php

look for:

define('TEXT_PRODUCTS_MANUFACTURER', '>manufacturers:');

after add:

define('TEXT_PRODUCTS_MANUFACTURER2', '>manufacturers2:');

 

Considering this directory doesnt exist I went to admin/includes/languages/english/categories.php assuming this is what he meant. Next i couldn't find what it was asking for but I did find:

 

define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');

 

Considering the two were so similar, I assumed the difference was due to updates with OsCommerce, so I added the following straight after:

 

define('TEXT_PRODUCTS_MANUFACTURER2', 'Products Manufacturer2:');

 

 

 

 

The next problem was in admin/includes/languages/english.php I managed to follow the first half of the instructions, but couldn't find the manufacturers box in the code at all, so i left the second half out:

 

look for:

 define('BOX_CATALOG_MANUFACTURERS', 'manufacturers');

after add:

 define('BOX_CATALOG_MANUFACTURERS2', 'manufacturers2');


look for:

// manufacturers box text in includes/boxes/manufacturers.php
define('BOX_HEADING_MANUFACTURERS', 'manufacturers');

after add:

// manufacturers box text in includes/boxes/manufacturers.php
define('BOX_HEADING_MANUFACTURERS2', 'manufacturers2');

 

 

 

sorry, i should have told you about this before,

 

Ben

Link to comment
Share on other sites

please make sure you are using this contrib

http://www.oscommerce.com/community/contri...,manufacturer+2

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

yes thats the one I am using, as you can see it dates from 2004. There must have been a number of changes to OsCommerce since then, perhaps thats why im having trouble with it? any ideas?

Link to comment
Share on other sites

ok, I just installed (only the admin part) of this contrib, it's extremely buggy, and install file mistakes etc etc. In that case, you will have to work through it slowly or have someone install it for you including the fixes. Sorry, no easier solution...

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Unfortunately, I dont really know anything about php or what would make this contrib work, it looks like I would have to ask someone to fix it for me; would you be willing to do it? I know i've asked you for quite alot of help so far and you have been very helpful every time, it would be great if you were able to do this for me too.

 

pleeaassse :P

 

ben

Link to comment
Share on other sites

see my siggy, and if you want to, please PM me.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

  • 1 month later...

Really this contibuttion is really buggy… and incomplete… I’ll try to make this contribution works, after that, I going to upload it to test on vanilla installation… and to check for bugs… next I will make the long, long… install instructions manual.

Any help will be welcome due to lack of time.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...