Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contrib] Manufacturers Multilanguage


wheeloftime

Recommended Posts

  • Replies 70
  • Created
  • Last Reply

Top Posters In This Topic

Update to Manufacturers Multilanguage With Description v1.1

 

My bad, I totally overlooked that the advanced search option also uses the manufacturers table and you will find the needed changes with this update. Also a small bugfix for filling the manufacturers list in the advanced search.

 

This is a MUST update to avoid errors when customers use the advanced search option in your shop !!

Link to comment
Share on other sites

  • 4 weeks later...

First problems start to appear...

 

It seem it is necesary also to make some changes ir order to make it work with the "Shop by price" contribution.

 

 

I get this error when the shop by price contrib is going to show the results of the search:

 

Shop by Price  


1054 - Unknown column 'm.manufacturers_name' in 'field list'

select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_price < 100 order by p.products_price, pd.products_name limit 0, 20

[TEP STOP]

Link to comment
Share on other sites

Find the solution taking your 1.0_1 actualization as example..

 

is only needed to change the name of the table "TABLE_MANUFACTURERS" to "TABLE_MANUFACTURERS_INFO"

 

So, te archive shop_by_price.php , around line 85

 

find

  $listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p 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 = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and " . $price_ranges_sql[$HTTP_GET_VARS['range']] . " order by p.products_price, pd.products_name";

 

change for

  $listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS_INFO . " 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 = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and " . $price_ranges_sql[$HTTP_GET_VARS['range']] . " order by p.products_price, pd.products_name";

Link to comment
Share on other sites

Well is it not fix at all.... When instead of entering a serch marked in the infobox I try to enter directly to domain\shop_by_price.php I get this error...

 

any clue?

 

1064 - You have an error in your SQL syntax near '' at line 1

select count(p.products_id) as total from products p left join manufacturers_info m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '3' left join specials s on p.products_id = s.products_id where p.products_status = '1' and

[TEP STOP]

Link to comment
Share on other sites

Other problem:

 

when clicking over the featured products link in the header of the box (which goes to domain\featured_products.php)

 

It show the products for all the lenguages, repeating them as times as lenguages you hace installed. In the featured infobox in the index , it shows them correctly, only one article, but following the link, it gets crazy....

 

any help apreciated!! This is a great contrib!

Link to comment
Share on other sites

Other problem:

 

when clicking over the featured products link in the header of the box (which goes to domain\featured_products.php)

 

It show the products for all the lenguages, repeating them as times as lenguages you hace installed. In the featured infobox in the index , it shows them correctly, only one article, but following the link, it gets crazy....

 

any help apreciated!! This is a great contrib!

 

Mookie,

 

The problem is that this contrib is written for a plain installed osC. None of the contributions which uses manufacturers one way or another has been made with a multilanguage manufacturers table in mind.

So any contribution you use with a link to the manufacturers table will have the same problems.

Changing TABLE_MANUFACTURERS to TABLE_MANUFACTURERS_INFO is one thing but you als have to put a comparison for the language into the queries.

For the shop by price contribution it should be something like

$listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS_INFO . " m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = " . (int)$languages_id . " ) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and " . $price_ranges_sql[$HTTP_GET_VARS['range']] . " order by p.products_price, pd.products_name";

For featured products it will problaby be something similar but as I don't know or use both of them I'll have to look into those to be able to be more specific.

I'll come back to you later for this.

 

regards,

Howard

Link to comment
Share on other sites

Other problem:

 

when clicking over the featured products link in the header of the box (which goes to domain\featured_products.php)

 

It show the products for all the lenguages, repeating them as times as lenguages you hace installed. In the featured infobox in the index , it shows them correctly, only one article, but following the link, it gets crazy....

 

any help apreciated!! This is a great contrib!

 

Mookie,

 

Sorry for the delay but I had no time to look into this until today. I installed shop by price and featured products in a fresh osCommerce 2.2 and the change for shop by price is as I quoted above.

For featured products you will have to change the query in (catalog)/featured_products.php to

				$featured_products_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS_INFO . " m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = " . (int)$languages_id . " ) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added DESC, pd.products_name";

 

Maybe you figured this out already on the shop by price solution I gave you but otherwise here you go.

Link to comment
Share on other sites

Thanks for all your attention wheeloftime!

 

Featured products now work perfectly! (sorry, it was one of the first contribs I installed andgot the remember it was with me since the beginning..)

 

 

But shop_by_price.php stil not working fine.. Afeter making your changes, I get this error..

 

1064 - You have an error in your SQL syntax near '' at line 1

select count(p.products_id) as total from products p left join manufacturers_info m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = 3 ) left join products_description pd on p.products_id = pd.products_id and pd.language_id = '3' left join specials s on p.products_id = s.products_id where p.products_status = '1' and 

[TEP STOP]

 

 

Maybe it helps more people install this contribution, explaining posible uses. In my case, I decided it was more interesting sorting the products by ocasion instead of by manufacturer. So, it is a fantastic way to facilitate the buy to users qho don't know what they are looking for, but they have an special appointment (birthday, romance, kids, etc..) in order to assesorate customers.

 

Cheers!

Link to comment
Share on other sites

Thanks for all your attention wheeloftime!

 

Featured products now work perfectly! (sorry, it was one of the first contribs I installed andgot the remember it was with me since the beginning..)

But shop_by_price.php stil not working fine.. Afeter making your changes, I get this error..

 

1064 - You have an error in your SQL syntax near '' at line 1

select count(p.products_id) as total from products p left join manufacturers_info m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = 3 ) left join products_description pd on p.products_id = pd.products_id and pd.language_id = '3' left join specials s on p.products_id = s.products_id where p.products_status = '1' and 

[TEP STOP]

Maybe it helps more people install this contribution, explaining posible uses. In my case, I decided it was more interesting sorting the products by ocasion instead of by manufacturer. So, it is a fantastic way to facilitate the buy to users qho don't know what they are looking for, but they have an special appointment (birthday, romance, kids, etc..) in order to assesorate customers.

 

Cheers!

 

Mookie,

 

It must be related to something else as I don't get any error after the change for manufacturers. You sure you didn't make a type or copy/paster error when changing the query ?

 

Howard

Link to comment
Share on other sites

  • 3 weeks later...

Hi Mookie, have you tried this in catalog/shop_by_price.php on line 85...

 

$listing_sql = "select p.products_id, p.manufacturers_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS_INFO . " m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = " . (int)$languages_id . " ) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and " . $price_ranges_sql[$HTTP_GET_VARS['range']] . " order by p.products_price, pd.products_name";

 

I had a problem with Shop by price in that it wasn't giving a manufacturers id and adding (p.manufacturers_id) as above worked.

Link to comment
Share on other sites

Thnaks for your help, but I still getting this error

 

1064 - You have an error in your SQL syntax near '' at line 1

select count(p.products_id) as total from products p left join manufacturers_info m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = 1 ) left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' left join specials s on p.products_id = s.products_id where p.products_status = '1' and

[TEP STOP]

 

having this line in the code

  $listing_sql = "select p.products_id, p.manufacturers_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS_INFO . " m on (p.manufacturers_id = m.manufacturers_id AND m.languages_id = " . (int)$languages_id . " ) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and " . $price_ranges_sql[$HTTP_GET_VARS['range']] . " order by p.products_price, pd.products_name";

 

Anyway, it is only when trying to access to the shop_by_price.php when it shows the error. Clicking in the search prizes in the infobox bring me clear results, so I guess I can pass it on.. :P

Link to comment
Share on other sites

  • 5 weeks later...

A sample use for the manufacturer description field (on top of the product listing page):

 

In your (catalog)/index.php search for

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>

and replace with

			<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
<?php
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
?>
<tr>
<td colspan="3" class="manudescriptiondisplay">
<?php
		  $description = tep_db_query("select manufacturers_description from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' AND languages_id = '" . (int)$languages_id . "'");
		  $manu_description = tep_db_fetch_array($description);
		  $manufacturer_description = $manu_description['manufacturers_description'];
		  echo $manufacturer_description;
?>
</td>
</tr>
<?php
}
?>
	</table></td>

 

In your (catalog)/stylesheet.css add

.manudescriptiondisplay {
font-family: Verdana, Arial, sans-serif;
color: #000000;
background: #abcdef;
font-size: 14px;
font-weight: bold;
text-align: center;
font-variant: small-caps;
border: medium;
border-style: outset;
border-color: #fedcba;
}

and change the style tags to your own liking/layout

 

regards,

Howard

Link to comment
Share on other sites

Hi!

 

What does it make? :rolleyes:

 

Hi there Mookie !

 

Nothing spectaculair, it is just for showing the description you might have with your manufacturers. Someone using the multilanguage manufacturers for 'featured artists' wanted a sample use for the description field so that is what it is.

 

Cheers,

Howard

Link to comment
Share on other sites

Hi there Mookie !

 

Nothing spectaculair, it is just for showing the description you might have with your manufacturers. Someone using the multilanguage manufacturers for 'featured artists' wanted a sample use for the description field so that is what it is.

Not agree with you... I find it pretty interesting as it is something I where missing: there were no diferences with the general product list and the search result for a certain manufacturer. ;) :thumbsup:

 

I had it installed, but get mess and didn't find where it was shown :P Now I found it!

temp9mu.jpg

 

Only one thing.. can you make it to appear also ehen listing a categoria and chosing from "Show" in the top od the list? ;)

Link to comment
Share on other sites

Not agree with you... I find it pretty interesting as it is something I where missing: there were no diferences with the general product list and the search result for a certain manufacturer. ;) :thumbsup:

 

I had it installed, but get mess and didn't find where it was shown :P Now I found it!

temp9mu.jpg

 

Only one thing.. can you make it to appear also ehen listing a categoria and chosing from "Show" in the top od the list? ;)

 

Fair enough. I made the distinction between a general product list and a manufacturer search list another way but the manufacturers description field is a good way for this also.

I'll take a look at the "Show" listbox and will put the code for this here.

Link to comment
Share on other sites

Not agree with you... I find it pretty interesting as it is something I where missing: there were no diferences with the general product list and the search result for a certain manufacturer. ;) :thumbsup:

 

I had it installed, but get mess and didn't find where it was shown :P Now I found it!

temp9mu.jpg

 

Only one thing.. can you make it to appear also ehen listing a categoria and chosing from "Show" in the top od the list? ;)

 

Just took a peek for this but it already does this as it is now ?! The text you entered for the manufacturers description just stays visible whether you use the manufacturers infobox listbox or the 'show' listbox.

Aren't you more thinking of the category description option/contrib ?! That stands seperate from this.

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...
  • 4 weeks later...

Hello i have an error when i want to add a manufacturer, is this:

 

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\AppServ\www\argenshop\admin\manufacturers.php on line 26

Warning: reset() [function.reset]: Passed variable is not an array or object in C:\AppServ\www\argenshop\admin\includes\functions\database.php on line 55

Warning: Variable passed to each() is not an array or object in C:\AppServ\www\argenshop\admin\includes\functions\database.php on line 58

Warning: reset() [function.reset]: Passed variable is not an array or object in C:\AppServ\www\argenshop\admin\includes\functions\database.php on line 62

Warning: Variable passed to each() is not an array or object in C:\AppServ\www\argenshop\admin\includes\functions\database.php on line 63
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 ') values)' at line 1

insert into manufacturers) values)

[TEP STOP]

Link to comment
Share on other sites

  • 2 months later...

I have installed the Manufacturers Multilanguage contrib. (Excellent, thanks)

 

I have about the same problem as Mookie but I did not install any other contributions. (Like search by price)

 

When I do search in my catalogue for a product it gives the result in the 2 languages I have. So everything (all products) twice. Same with advanced search.

Link to comment
Share on other sites

I have installed the Manufacturers Multilanguage contrib. (Excellent, thanks)

 

I have about the same problem as Mookie but I did not install any other contributions. (Like search by price)

 

When I do search in my catalogue for a product it gives the result in the 2 languages I have. So everything (all products) twice. Same with advanced search.

Check the changes needed for the Manu Multi again and especially look at the last part from the install instructions telling:

In your (catalog)/advanced_search_result.php search for

$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

And replace this with

$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' AND m.languages_id = '" . (int)$languages_id . "'";

When you get a result for every language in your shop you can be sure there is somewhere missing the part where the languages_id is compared with the active language of the shop.

Link to comment
Share on other sites

  • 2 weeks later...

hi there

 

many thanks for the contribution.

 

i have come across one bug. if a manufacturer image has been previously defined and i go into edit manufacturer and save changes, it loses the manufacturer image link from the database field.

 

any fixes would be greatly appreciated :)

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...