Jump to content
Sign in to follow this  
Farrukh

[Contribution Update] All Prods v2.4

Recommended Posts

hi,

 

Does anyone know what should be put into this piece of code to replace 'arabianbazaar' in allprods.php around line 144?

 

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

 

thanks

 

korsh

Share this post


Link to post
Share on other sites

Great mod! I just have one problem...broken links.

 

Clicky

 

Not all of them are broken. For example, check the first link. Any ideas? Thanks.


Drive it like you stole it.

Share this post


Link to post
Share on other sites
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?

 

im using french and english also and each time i click on a product in the french part , it shows me the english product !

 

any idea .?


MS2

Share this post


Link to post
Share on other sites

yip..due to a really stupid beginner's code error...haha..2 loops (for) using the same variable $i. Just find the second "for" in allprods.php (line 113) and change i>j..use $j instead of $i for all lines in the for-loop. Now you should have your list of products for each language and with the correct link. This my code :

...

for ($j = 0; $j < $num_prods; $j++) // Traverse Rows // DDB - 031116 - change i-> j

{

// Rotate Row Colors

if ($j % 2) // Odd Row

{

$row_col = 'class="productListing-odd"';

}

else // Guess...

{

$row_col = 'class="productListing-even"';

}

 

 

$this_id = $products_array[$j]['id'];

$this_name = $products_array[$j]['name'];

$this_model = $products_array[$j]['model'];

$this_manufacturer = $products_array[$j]['manufacturer'];

$this_price = $products_array[$j]['price'];

$this_special = $products_array[$j]['special'];

$this_tax = $products_array[$j]['tax'];

$this_url = tep_href_link(FILENAME_PRODUCT_INFO, 'name=' . urlencode($this_name). '&products_id=' . $this_id . '&language=' . $this_language_code, 'NONSSL', false); // DDB - 031115 - dropped use of DEFAULT_LANGUAGE

 

echo "<tr $row_col>";

echo "<td class='productListing-data' align='left'><a href='$this_url'>$this_name</a></td>";

echo "<td class='productListing-data' align='left'><a href='$this_url'>$this_model</a></td>";

echo "<td class='productListing-data' align='center'><a href='$this_url'>$this_manufacturer</a></td>";

if (tep_not_null($this_special))

{

echo "<td class='productListing-data' align='right'><a href='$this_url'><span class='productSpecialPrice'>".$currencies->display_price($this_special, tep_get_tax_rate($this_tax))."</span></a></td>";

}

else

{

echo "<td class='productListing-data' align='right'><a href='$this_url'>".$currencies->display_price($this_price, tep_get_tax_rate($this_tax))."</a></td>";

}

echo "</tr>\n";

}

 

This should work !

 

Didier.

Share this post


Link to post
Share on other sites

Attention ! The special prices are NOT displayed. Something is missing in the database query to retrieve the specials.special_new_products_price. This is the db query to use (allprods.php, line 97) :

 

...

m.manufacturers_name, s.specials_new_products_price from " .

...

 

Some other errors with this contrib in case you want to know :

- records are not unique if products used in different categories (use patch described in this thread)

- only english is displayed. Apply patch described in post just above to have all products listed for each language

- header of table is not language specific. Patch is available.

 

Hope this helps you...now just curious to see what Google is gonna do with it...

 

Didier.

Share this post


Link to post
Share on other sites

Spaceboy - daniel

 

ur tweak seems to work with version 2.4 but not with version 2.61 ?!

 

could we release a proper new version 2.62

 

with :

 

 

1.records are not unique if products used in different categories (use patch described in this thread)

2. only english is displayed. Apply patch described in post just above to have all products listed for each language

3. header of table is not language specific. Patch is available.

 

4.and also make only one file with the use of configuration in the php file like:

 

show model = true/false

show manufacturer = true/false

 

5. does someone can tell me what do i have to add to the query so product with price = 0 are not shown


MS2

Share this post


Link to post
Share on other sites

Just a tip for those of you that may have special characters in your product titles or names. This contrib does not deal at all gracefully with some of them. I have several product titles that contain single quotes and slashes. The links rendered are broken.

 

To fix this you can add something similar to the following hack around line 145:

 

$foo = str_replace("'","_",$this_name);   //replace single quotes
$tmp_name = str_replace("/","_",$foo);  //replace slash

 

Then change the var this_name in the $this_url = statment to the tmp_name variable mentioned above. You can repeat the above as many times as needed. The URL will contain underscores where necessary, but the actual description seen by a surfer should they see the page will look normal.

 

Hope this helps someone.


-MichaelC

Share this post


Link to post
Share on other sites

I'm using v2.61 and the Spacecowboy's patch for multiple languages did not work for me: I have 3 languages configured, and the patch displays 3 times each product, but all with same language.

 

Solution is in the allprods.php, line 107, $products_query: replace $languages_id by $this_language_id.

 

Now it works...

Share this post


Link to post
Share on other sites

If you want to display only one language at a time, then forget the modification of the precedent post and just put the line 91: for ($i=0; $i<sizeof($languages_array); $i++) as comment. Like that only the current language will be processed, no more loop. You can also get rid of some more lines if you don't want the loop, but let's keep it simple for now.

Share this post


Link to post
Share on other sites

Sorry I wrote too fast the previous post. To get the product list only in the selected language, see the following code, it starts at line 84 for me:

- WHERE clause added in $languages_query

- for loop as comment.

- $i=0 added to point to the only row of $languages_array

 

    $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " WHERE languages_id=".(int)$languages_id." 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']); 
         } 
   // Next line commented to get a product list according to selected language.
  //                 for ($i=0; $i<sizeof($languages_array); $i++) 
                   { 
	 $i=0;           
           $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";

Share this post


Link to post
Share on other sites

Seems that I like to post today...

 

One detail, maybe somebody pointed it out already but I didnt see:

 

allprods.php line 20, NAVBAR_TITLE must be used instead of HEADING_TITLE for the $breadcrumb.

Share this post


Link to post
Share on other sites

Hmmm ... is it a good idea to split the pages ... wouldn't that stop the spiders getting to page 2... 3... etc and indexing all of the products?

 

Just a thought ...

 

:rolleyes:

Share this post


Link to post
Share on other sites

Any chance I can get a Play by Play of changes made in the ReadMe?

 

6). Replace or compare the files included in catalog/includes/boxes

 

This is not helping me any, as I have numerous modifications already and have no idea how to do a file compare that would give me the accurate changes.


Scooterboy

Share this post


Link to post
Share on other sites

How did you make it work with A-z listing? I am looking at doing this with the all products enhanced mod so im guessing it will be similar.


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites

Cheers for that, although I cant seem to get it working properly :(


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites
Spiders will follow links.

I would like to do it to add functionality for customers.

Yes, spiders will follow links, but if you split the listing into pages will you not have '<<previous -- next>>' buttons at the bottom of the page that have to be clicked before the next page is generated and displayed?

 

Can spiders click those 'next page' buttons ...?

 

If not, it seems an either/or situation: page it for use by the customers, or don't page it and get the spiders indexing all your stock.

 

Just a thought ... anyone know for sure...?

 

 

 

:rolleyes:

Share this post


Link to post
Share on other sites
All Products for osCommerce 2.2 Milestone 1 & 2

version 3.0 by Ingo Malchow, info@gamephisto.de

 

released under the GNU General Public License

for the community of osCommerce

 

Ok.. I am tring to install the above version of all products. Can someone explain to me what this means:

 

2. add the lines in:

 

  /catalog/includes/filenames.php

  /catalog/includes/languages/english.php

  /catalog/includes/languages/german.php

 

  into your files with the same path and name.

  Attention! Don't replace!!! Add only lines beginning with "define".

 

Im a little lost. Add What line to these files?

 

Can someone send me or post a set of clear instructions? Please.

 

Thanks

Tammy

Share this post


Link to post
Share on other sites
All Products for osCommerce 2.2 Milestone 1 & 2

version 3.0 by Ingo Malchow, info@gamephisto.de

 

released under the GNU General Public License

for the community of osCommerce

 

Ok.. I am tring to install the above version of all products. Can someone explain to me what this means:

 

2. add the lines in:

 

  /catalog/includes/filenames.php

  /catalog/includes/languages/english.php

  /catalog/includes/languages/german.php

 

  into your files with the same path and name.

  Attention! Don't replace!!! Add only lines beginning with "define".

 

Im a little lost. Add What line to these files?

 

Can someone send me or post a set of clear instructions? Please.

 

Thanks

Tammy

If you take a look in each of those files you will find the line of code that needs to be added to the existing file of that name inside your catalog folder. For example, in filenames.php (in the mod) you will find:

 

<?php

/*
 add the following line in your catalog/includes/filenames.php
*/

define('FILENAME_ALL_PRODUCTS', 'all_products.php');   // all products and used categories

?>

 

 

So you find /catalog/includes/filenames.php on your PC or server and add the line in the mod to the line(s) already in that file on your PC/server.

 

eg. in the above example you would add the line:

 

define('FILENAME_ALL_PRODUCTS', 'all_products.php');   // all products and used categories

 

 

:rolleyes:

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  

×