Jump to content
Sign in to follow this  
Farrukh

[Contribution] All Products v3.0 MS 2.2 with Images

Recommended Posts

Hey Guys,

 

can you please help me,

 

I would like to adapt all products into all manufacturers, exactly the same, but showing all manufacturers a-z.

 

Can someone help me to adapt it, I am running all prdocuts allready and want to run to two side to side.

 

Help will be appreciated, thanks

 

Mitchell

Share this post


Link to post
Share on other sites

It pardons jack, I am Spanish and I use the translator and my little English to write here, where and what install the changes of database? , I have added the archives and modified those that that to modify

 

thanks

Share this post


Link to post
Share on other sites

Look for the file named allprods.sql in the contribution. You have to install that using phpmyadmin.

 

Jack

Share this post


Link to post
Share on other sites

not to know how to install allprod.sql, upload when sever, first in catalog. later upload to admin. , nothing, to add the text to him of allprods.sql in configuration.php, nothing, as allprods.sql install?

 

pardon to bother as much but nonwhole

 

 

thanks

 

Fran

Share this post


Link to post
Share on other sites

I just downloaded this contribution and started with the sql file and when i tried to run it in myadmin, i receive the following error.

 

SQL query: 

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function ) 
VALUES (

'219', 'All Products Image Width', 'ALLPROD_IMAGE_WIDTH', '100', 'The pixel width of heading images', '4', '5', '2003-07-31 19:35:01', '2003-07-24 17:45:15', NULL , NULL 
);



MySQL said:  

#1062 - Duplicate entry '219' for key 1

 

The tables are there, but the values won't install, the only two contributions I can think of are frooglefeeds and products extra fields have been installed. Not sure what else would conflict, any suggestions.

Share this post


Link to post
Share on other sites

The 219 value is already in use. Try changing it to some other number, like 700, and see what happens. If you don't want to guess, you can look at the value in the table using phpmyadmin.

 

Jack

Share this post


Link to post
Share on other sites

thanks jack,

 

i did look at the values and saw it was already used, i just wasn't sure if it was ok to change the value to something else in the sql file.

Share this post


Link to post
Share on other sites

ok I change the values in the first part of the code in the sql file, and it installed fine, well so I thought, after added the php files, and adding the code, i have a link on my index page in the catagories box, and in the information box.

 

heres the issue, in the admin panel there is no on/off or any listing of all products under the configuration tab. First thought was something went wrong with the .sql file because there were no mods or php files added to the admin directory.

 

Heres what I have in the second half of the code for the sql file

 

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','All Products: ON/OFF', 'ALL_PRODUCTS', 'false', 'All Products <br>(true=on false=off)', '17', '1', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL);
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','All Products: filename', 'ALL_PRODUCTS_FILENAME', 'allprods.php', 'All Products filename Default=allprods.php', '17', '2', '', now(), NULL);
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','All Products: Display Mode', 'ALL_PRODUCTS_DISPLAY_MODE', 'true', 'Display in standard table format <br>(true=on false=off)', '17', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL);

 

I noticed right off the bat, the first INSERT INTO at the end where is says VALUES ('','all products <---- right there i notice the first value is missing, the second line of code is the same right after values the first '' is missing a value, I didn't delete these, was this intentionally left blank or what, and if its supposed to have values what do I use, can I just use anything that isnt already being used in the table. I have a feeling I can't re-run the code or I am going to get duplicate errors for all the other values, is there a way to just write a snippet to go back in and fill in the two missing values

Share this post


Link to post
Share on other sites

I think I sorta figured this out, i did get it working, I saw that the all products functions were set in the Group "17" which was not visable, so I checked the configuration_group ID using an sql query I noticed all the things I normally see are set to a visable value of 1, and the All Products Id was set to a value of 2, so I changed it to 1 and walah there it is in the admin panel.

Edited by Gameprodigy

Share this post


Link to post
Share on other sites
The 219 value is already in use. Try changing it to some other number, like 700, and see what happens. If you don't want to guess, you can look at the value in the table using phpmyadmin.

 

Jack

hey Jack

 

I'm trying to install all products but I get this error .

 

/home/www/thedecoreshoppe.com/OSCommerce/catalog/allprods.sql: line 1: syntax error near unexpected token `('

/home/www/thedecoreshoppe.com/OSCommerce/catalog/allprods.sql: line 1: `insert into configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('600', 'All Products Image Width', 'ALLPROD_IMAGE_WIDTH', '100', 'The pixel width of heading images', '4', '5', '2003-07-31 19:35:01', '2003-07-24 17:45:15', NULL, NULL);

'

this is the line of the allprods.sql

 

insert into configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('600', 'All Products Image Width', 'ALLPROD_IMAGE_WIDTH', '100', 'The pixel width of heading images', '4', '5', '2003-07-31 19:35:01', '2003-07-24 17:45:15', NULL, NULL);

 

 

I cant find what it is talking about.

Share this post


Link to post
Share on other sites

There's nothing wrong with that line. It looks like the sql file is corrupted and you are loading part of the previous line since it is failing on an extra ).

 

Jack

Share this post


Link to post
Share on other sites

I have allprods up and running wonderfully - great contrib.!! :thumbsup:

 

Now I am trying to create an infobox for category pages that will show all the products within that category. Unfortunately - my PHP is limited and I was attempting to do this through dreamweaver - but I keep getting an error on this code:

while ($row_products = mysql_fetch_assoc($products));

 

Here is the full code I have - I've tried with and without the DB Connection being in the page (it shouldn't need to be I wouldn't think as it's just an infobox)

 

$colname_products = "1";
if (isset($_GET['categories_id'])) {
 $colname_products = (get_magic_quotes_gpc()) ? $_GET['categories_id'] : addslashes($_GET['categories_id']);
}

mysql_select_db($database_mmhdata, $mmhdata);
$query_products = sprintf("SELECT products_to_categories.products_id, products_to_categories.categories_id, products_description.products_id, products_description.products_name FROM products_to_categories, products_description WHERE products_to_categories.categories_id = %s and products_description.products_id = products_to_categories.products_id  ORDER BY products_description.products_name ASC", $colname_products);
$products = mysql_query($query_products, $mmhdata) or die(mysql_error());
$row_products = mysql_fetch_assoc($products);
$totalRows_products = mysql_num_rows($products);

mysql_free_result($products);
?>


<table width="100%"  border="0" cellspacing="0" cellpadding="0">
 <tr>
<?php do { ?>
<td><?php echo $row_products['products_description.products_name']; ?>
</td>
<?php } while ($row_products = mysql_fetch_assoc($products)); ?>
 </tr>
</table>

 

Seeing as how you were able to create the wonderful allprods contrib. I'm hoping that with something as simple as what I'm trying to do you will be able to glance at it and see the problem :)

 

Once I can at least get it listing the products that are within that category I can hopefully then add the URL's as well - but one step at a time ;)

 

Any advice anyone can offer would be most appreciated :)


~Tracy
 

Share this post


Link to post
Share on other sites

Hi guys,

 

I'm trying another way around this. I am trying to get a listing of all products within a category and have that as an infobox on the side.

 

I have tried to modify the allprods code to do this - but I am getting this error:

 

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 'fromproducts_to_categories pc on pc.categories_id = 1 left join manufacturers m ' at line 1

 

select count(p.products_id) as total fromproducts_to_categories pc on pc.categories_id = 1 left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on pc.products_id = pd.products_id AND p.products_master_status = 1 and pd.language_id = '1' left join specials s on pc.products_id = s.products_id left join products p on pc.products_id = p.products_id

 

Here is the script I am using

<?php 
/* 
$Id: allprods.php,v 4.4 2006/09/18 20:28:47 Mgx Co. Exp $


All Products v4.3 MS 2.2 with Images http://www.oscommerce.com/community/contributions,1501

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

Copyright (c) 2004 osCommerce

Released under the GNU General Public License

*/
?> 

 <tr>
   <td>
<?php
$colname_products = "1";
if (isset($_GET['categories_id'])) {
 $colname_products = (get_magic_quotes_gpc()) ? $_GET['categories_id'] : addslashes($_GET['categories_id']);
}
// create column list
$define_list = array('PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
				  'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
asort($define_list);

$column_list = array();
reset($define_list);
while (list($column, $value) = each($define_list)) {
  if ($value) $column_list[] = $column; 
}

$select_column_list = '';

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
  if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_NAME') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {
 continue;
  }
}

// listing all products
$listing_sql = sprintf("select pc.products_id, p.products_master_status, p.products_model, pd.products_name, p.products_image, m.manufacturers_name, pc.categories_id from" . TABLE_PRODUCTS_TO_CATEGORIES . " pc on pc.categories_id = %s left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pc.products_id = pd.products_id AND p.products_master_status = 1 and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on pc.products_id = s.products_id " . " left join " . TABLE_PRODUCTS . " p on pc.products_id = p.products_id $where order by pd.products_name", $colname_products);

if (ALL_PRODUCTS_DISPLAY_MODE == 'true')
include(DIR_WS_MODULES . 'product_listing.php'); //display in standard format
else
include(DIR_WS_MODULES . 'allprods.php');
?>
   </td>
 </tr>

 

Currently I believe it is calling the product_listing.php file to list it in, which is where the 2nd block of info in the error message is coming from (I think). Do I need to rename that file for this use?

 

Any ideas as to what I need to do to my query to get this all working correctly? I am at such a loss here - I appreciate any assistance any of you can provide :)


~Tracy
 

Share this post


Link to post
Share on other sites

Small announcement:

 

I've released AllProducts_V_4.4c (Mutlilanguage friendly)

 

Only a small change compared to the previous version (v4.4b w SQL fix): All Products is now multilanguage friendly.

 

There is no more English text embedded in the code, but instead some variables in the different language files, which then permits this contribution to fully support different languages.

 

Nothing else made. Full credit goes to the original authors.

 

Included in the zip file are the English, French and German versions of All Products.

 

Regards,

 

-Ben

Share this post


Link to post
Share on other sites

Update:

 

I also released the Spanish language file for the latest version of All Products.

 

No further code changes, only this language file. This latest package contains everything (English, French, German & Spanish).

 

-Ben

Share this post


Link to post
Share on other sites

I have a problem with the installation...

 

when trying to access directly to www.mydomain/allprods.php, I get this error message:

 

Fatal error: Cannot redeclare tep_show_category() in /home/www/public_html/includes/boxes/categories.php on line 13

 

 

Any clue how can I fix it? :huh:

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites
It's not a problem with the contribution. See this thread.

 

Jack

I realised of that, as I have already installed another ontribution and got the same problem.

 

Thank you very much for your help! Now it works perfectly ;)

Edited by Mookie_Jam

Share this post


Link to post
Share on other sites

New version is out: 4.4d.

 

Strange Install instructions:

 

6) If you do not have Header Tags installed, skip this step. The following

code is for Header Tags version greater than 4.3.9. If you have an

earlier version, you will need to alter this code.

 

Well the latest version of Header Tags is: 2.6.0

 

I have Header Tags 2.5.9 and was now going to install All Products.

Dont really know if i dare, get a bit confused when the instructions is saying that...

Share this post


Link to post
Share on other sites

I can't say whether any version after my last one works with Header Tags or not, but I know mine does. The instructions are saying to install the code into your header tags files if you have that installed. However, that is no longer necessary since the code comes pre-installed in Header Tags.

 

Jack

Share this post


Link to post
Share on other sites

Thank you Jack!

 

So this means that the nr: 6 & 7 which says: If you do not have Header Tags installed, skip this step...

can also be skipped if you have a newer version of Header Tags where it is already inside that code.

Share this post


Link to post
Share on other sites

Thanks. great.

 

Haha, now i even got the loveley error:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/galoppsh/public_html/includes/header.php:220) in /home/galoppsh/public_html/includes/boxes/categories.php on line 13

 

because of the template, never use a template again bläh.

Took away column_left.php so i could see it...nice. My categories is in header.php even though it is on the left side hmm.

 

Well suppose i have to rip some parts out and stop when it works, sound very professional doesnt it =).

 

Not really shure if i should try to change allprods.php or the categories.php mentioned above.

Share this post


Link to post
Share on other sites

Found the help you gave earlier regarding templates (on page 11)

 

You are most likely using a template. If so, go to includes/header.php and change all instance of CODE :

tep_show_category

 

to something else, likeCODE:

tep_show_category_template

 

Will this not destroy the whole template ???

Share this post


Link to post
Share on other sites

The template makers copied existing code to make their code changes work. But when a normal oscommerce change is made, like installing this contribution, it causes that code to be added twice. So renaming what they added, which is only used on that one page, will work fine. They should have done that in the first place but it is more work for them so they don't.

 

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×