Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution Update] All Prods v2.4


Farrukh

Recommended Posts

Hi,

 

I've just added your latest All Products to an out-of-the-box MS2 and the listing works fine (it's really good - thank you) but when I went back to the main page and clicked on a category (I clicked on 'Hardware') I got the following MySQL 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 'and c.parent_id = '1' and c.categories_id = cd.categories_id an





select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where and c.parent_id = '1' and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name



[TEP STOP]

 

A similar error happens when clicking on either of the other 2 categories ('Software' and 'DVD Movies') with slightly different errors (cd.parent_id = 2 and 3 respectively).

 

(I've copied the MySQL error exactly - the 1st section of the error report does end with 'an' )

 

I used your normal 'allprods.php' rather than the one without a model.

 

 

:(

Link to comment
Share on other sites

I was having a problem getting this to display my product name in the URL. The problem was my product has an apostrophe( ' ) in it. It wouldn't display anything past the apostrophe.

 

Here is what I did incase anybody has a similar problem:

 

In allprods.php find this:

$this_url = tep_href_link(FILENAME_PRODUCT_INFO,  'store=' . str_replace(" ", "_", $this_name) . '&products_id=' . $this_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false);

 

Change it to this:

$this_url = tep_href_link(FILENAME_PRODUCT_INFO,  'store=' . str_replace($search_name, $replace_name, $this_name) . '&products_id=' . $this_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false);

 

Then right above it add this:

$search_name  = array (" ", "'");

$replace_name = array ("_", "ft");

 

As you can see in my above example, when an apostrophe is found, it is replaced with "ft". You can change it anything you want. To have the apostrophe deleted, just delete ft in the example, leaving only the quotation marks with no spaces in there. You can use this example to replace any characters or letters you wish by adding the letter, number or character to $search_name and then add the letter, number, or character you want to replace it with in $replace_name. Some other examples may be to find "&" and replace it with "&amp".

 

It's not brain surgery, but it helped get allprods working with my products so I thought I would share it just in case somebody else is having the same problem as me.

Link to comment
Share on other sites

Hello to all developers.

 

I have a question about this mod.

 

1) I am not familiar with all ther perks of this mod. Is there a live demonstration (admin + catalog) where i can see the benefits of this prod?

 

2) I am using snapshot 5-18-2003 and all i really want to do is to have a search engine friendly urls and i wanted to have the ability to place the product name on the url. If i just want this, can some1 please advice me?

 

Thanks.

Link to comment
Share on other sites

First off nice contro .. very well done .. Just one quick question the docs state

 

 

4. Add this hidden link to where ever you like it i placed it in the catalog/includes/Header.php but you can also place it in footer or whereecer you want too :-)

 

Ok now this hidden link must be hidden real well cause there is nothing there to add to the footer. What do you us to do?

 

Kmcar

 

:lol:

Link to comment
Share on other sites

First off nice contro .. very well done .. Just one quick question the docs state

 

 

4. Add this hidden link to where ever you like it i placed it in the catalog/includes/Header.php but you can also place it in footer or whereecer you want too :-)

 

Ok now this hidden link must be hidden real well cause there is nothing there to add to the footer. What do you us to do?

 

Kmcar

 

:lol:

 

Ok goping to add to this also, got it all installed except for the question above but also when I click on the link.. .. I get nothing just goes back to index.php .. Now I heard of errors but this is hsowing no errors in fact no nothing. <grin>

Link to comment
Share on other sites

First off nice contro .. very well done .. Just one quick question the docs state

 

 

4. Add this hidden link to where ever you like it i placed it in the catalog/includes/Header.php but you can also place it in footer or whereecer you want too :-)

 

Ok now this hidden link must be hidden real well cause there is nothing there to add to the footer. What do you us to do?

 

Kmcar

 

:lol:

 

 

Which version of All Products are you using?

 

Ok goping to add to this also, got it all installed except for the question above but also when I click on the link.. .. I get nothing just goes back to index.php .. Now I heard of errors but this is hsowing no errors in fact no nothing. <grin>

Link to comment
Share on other sites

First off nice contro .. very well done .. Just one quick question the docs state

 

 

4. Add this hidden link to where ever you like it i placed it in the catalog/includes/Header.php but you can also place it in footer or whereecer you want too :-)

 

Ok now this hidden link must be hidden real well cause there is nothing there to add to the footer. What do you us to do?

 

Kmcar

 

:lol:

 

I am using OSC MS2

 

&

 

<?php

/*

$Id: allprods.php,v 1.5 2002/09/29 1

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

 

*/

 

 

Which version of All Products are you using?

 

Ok goping to add to this also, got it all installed except for the question above but also when I click on the link.. .. I get nothing just goes back to index.php .. Now I heard of errors but this is hsowing no errors in fact no nothing. <grin>

Link to comment
Share on other sites

First off nice contro .. very well done .. Just one quick question the docs state

 

 

4. Add this hidden link to where ever you like it i placed it in the catalog/includes/Header.php but you can also place it in footer or whereecer you want too :-)

 

Ok now this hidden link must be hidden real well cause there is nothing there to add to the footer. What do you us to do?

 

Kmcar

 

:lol:

 

I am using OSC MS2

 

&

 

<?php

/*

$Id: allprods.php,v 1.5 2002/09/29 1

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

 

*/

 

 

Which version of All Products are you using?

 

Ok goping to add to this also, got it all installed except for the question above but also when I click on the link.. .. I get nothing just goes back to index.php .. Now I heard of errors but this is hsowing no errors in fact no nothing. <grin>

 

Hmmmm did I dl the wrong one?

Link to comment
Share on other sites

First of all...I wouldn't keep it as a hidden link. Search engines get upset when you try to trick them. Put it out there where everyone can see it. On my site I named it "Product Index". Go ahead and take a look at it here.

Edited by Johnson
Link to comment
Share on other sites

First of all...I wouldn't keep it as a hidden link.  Search engines get upset when you try to trick them.  Put it out there where everyone can see it.  On my site I named it "Product Index".  Go ahead and take a look at it here.

 

I agree with you. The Hidden text link was posted by the original author.

 

I have placed it under Categories on the main page.

Edited by Johnson
Link to comment
Share on other sites

I need some guidance on having the link appear. It seems I am doing something wrong, I have added

 

'<a href="http://www.mywebsite.com/catalog/allprods.php' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a><br>' .

 

to my categories.php under includes/boxes but it isn't showing up.

 

I tried to add it to the What's new box and it didn't show there either.

 

Please someone have mercy on me, and tell me what I have to fix. Thanks

CIndyd

Link to comment
Share on other sites

I tried to install the all products version 2.5 all in one and got the following 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 'and c.parent_id = '21' and c.categories_id = cd.categories_id a

 

select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where and c.parent_id = '21' and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name

 

[TEP STOP]

 

Currently my item names are only reflected when I link to an item through my all products page. I would really them to be reflected when I access items through my categories. Is there any way to do this?

Link to comment
Share on other sites

  • 3 weeks later...
I tried to install the all products version 2.5 all in one and got the following 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 'and c.parent_id = '21' and c.categories_id = cd.categories_id a

 

select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where and c.parent_id = '21' and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name

 

[TEP STOP]

 

Currently my item names are only reflected when I link to an item through my all products page. I would really them to be reflected when I access items through my categories. Is there any way to do this?

Try taking out the 'and' after the 'where'

Link to comment
Share on other sites

excellent contribution my friend very helpful

 

 

just one small question

 

in my css productlisting-data i have create a border on top

 

 

check here

 

my problem is for example if a cell is empty as you can see above it doesnt pick up the css

 

 

any ideas through this??

 

ps: if i wasnt descriptive enough check the link you will understand what i mean

Link to comment
Share on other sites

Ok, I love the AllProds contribution, but has anyone figured out a way to eliminate duplicate entries on the allprods.php page for items that are categorized in more than one category? For instance, we might have the same book listed in the "Gift Books" and the "Children's Books" categories. Unfortunately, allprods.php lists the book twice. So our list is about three times the length that it should be due to duplicate and triplicate entries.

 

I'm sure the change is a minor one, but I'm as clueless as they come.

 

Any suggestions is appreciated.

 

Bob

Link to comment
Share on other sites

Ok, I love the AllProds contribution, but has anyone figured out a way to eliminate duplicate entries on the allprods.php page for items that are categorized in more than one category? For instance, we might have the same book listed in the "Gift Books" and the "Children's Books" categories. Unfortunately, allprods.php lists the book twice. So our list is about three times the length that it should be due to duplicate and triplicate entries.

 

I'm sure the change is a minor one, but I'm as clueless as they come.

 

Any suggestions is appreciated.

 

Bob

I get the same thing. It makes my site seem pretty unprofessional. I'll find out what the fix is & post it.

Link to comment
Share on other sites

Ok, here's the fix... The bold lines are the ones I added...

 

$duplicates = array();

 

$languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");

while ($languages = tep_db_fetch_array($languages_query)) {

$languages_array[] = array('id' => $languages['languages_id'],

'name' => $languages['name'],

'code' => $languages['code'],

'image' => $languages['image'],

'directory' => $languages['directory']);

}

for ($i=0; $i<sizeof($languages_array); $i++) {

$this_language_id = $languages_array[$i]['id'];

$this_language_name = $languages_array[$i]['name'];

$this_language_code = $languages_array[$i]['code'];

$this_language_image = $languages_array[$i]['image'];

$this_language_directory = $languages_array[$i]['directory'];

echo " <tr>\n";

 

 

 

$products_query = tep_db_query("select p.products_id, p.products_model ,pd.products_name, p.products_thumbnail, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and products_status = '1' order by pd.products_name");

 

 

$products_array = array();

while($products = tep_db_fetch_array($products_query))

{

$id = $products['products_id'];

if( !isset( $duplicates[ $id ] ) ) {

$duplicates[ $id ] = true;

$products_array[] = array('id'=> $products['products_id'],

'name' => $products['products_name'],

'image' => $products['products_thumbnail'],

'manufacturer' => $products['manufacturers_name'],

'price' => $products['products_price'],

'tax' => $products['products_tax_class_id'],

'special' => $products['specials_new_products_price']);

}

}

 

Hope this helps. BTW, the duplicates add relevance to your page & site. I just got spidered by Google & I got ranked as #1 for the products that I had duplicated on my allprods page. e.g.,

 

http://www.google.com/search?hl=en&lr=&ie=...G=Google+Search

 

But, I still put in the duplicates fix. I'd rather have a professional looking site.

Link to comment
Share on other sites

I've been messing around with the allproducts contribution, which I think is great.

But I haven't succeed in one very important thing I need to fix before I can use this contribution...

I have two different languages in my site and everytime I hit one product in the all products result I go to the product info page in english, how can I fix that?

 

Two other changes I wanted to do but I've been unable to, due to my complete lack of php knowlege are:

 

1 - Change the odd and even rows so that I can make them look as in:

http://www.frozensystems.com/catalog/allprods.php (nice site by the way...)

 

2 - (This one I'm sure is not as easy as the others) I find it could be really useful to have the all products split into different pages, so that you could allow a maximum number of products the way oscommerce does with the products, so you could go to the next or previous pages without needing to scroll down to a never ending list of products.

How about that?

 

If someone can point me where to go or what to do to fix my problem with the languages, I'd be more than grateful though...

Thanks!

Link to comment
Share on other sites

  • 3 weeks later...

Great Cont.

I have installed it but seem to be having a problem. whenever I click the link to the allprod.php, i recieve the following error

 

The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

 

I have verified that the file is in the same directory and working. I have also tried the same file on another site with about 30 items and it worked. I have about 17,000 items. I am guessing that this is that problem.

 

Is there any way to fix this?

 

Thanks

Moneer

Link to comment
Share on other sites

Try taking out the 'and' after the 'where'

 

First of all, thank you Pixxi for the above. I was not able to click on any links in my categories box without getting and SQL syntax error. Thank you for your sharp eyes!

 

Secondly,

 

Thank you to every one who added to and made this contrib possible.

 

I can not tell you how impressed I am with the community support here and with the fast and intelligent responses.

 

From a non-coder to all of you amazing coder types, I thank you:-)

 

::wanders off to see what else she can break in oscMS2 <eg>::

 

Khim~

Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...