Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Manufacturer Description/Information


000---000

Recommended Posts

Hi, I want the manufacturer page to show a description as well as the manufacturer image and products.

 

In the "manufacturer_info" table in the data base I've created a "manufacturer_care_information" field (Type: TEXT; Chars: 500) but am a little unsure of how to:

A: Add a field/box to the admin>manufacturers.php info page

and

B: Create the text box/area on the index.php page to show the text when showing the manufacturer details.

 

I'm sure there's a contribution or similar for this. Can any one either advise of the contribution or advise what I need to add each of these files in order to get the text field to show. Once showing I am sure I can edit the look of the text etc.

 

Thanks in advance

oscommerce_community_forums.gif
Link to comment
Share on other sites

Hi, I want the manufacturer page to show a description as well as the manufacturer image and products.

 

In the "manufacturer_info" table in the data base I've created a "manufacturer_care_information" field (Type: TEXT; Chars: 500) but am a little unsure of how to:

A: Add a field/box to the admin>manufacturers.php info page

and

B: Create the text box/area on the index.php page to show the text when showing the manufacturer details.

 

I'm sure there's a contribution or similar for this. Can any one either advise of the contribution or advise what I need to add each of these files in order to get the text field to show. Once showing I am sure I can edit the look of the text etc.

 

Thanks in advance

 

 

Hi, that doesn't work for me. It just breaks the SEO URLs and I get left with html names of --p-27.html etc.

 

 

I need to know how to add in a description paragraph which can then be shown on the manufacturer page. This would need to be a field added to the data base, which I can manage/have done, and then a field on the manufacturer page in the admin and also the appropriate field on the manufacturer page displayed to end users. Can you help?

 

I have created a field called manufacturer_paragraph in manufacturers_info in the database.

 

I now need to add a field in manufacturers.php in the admin to be able to add values from the admin area rather than manually in the database... yes?

 

I can duplicate and change:

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);

to:

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_PARAGRAPH . $manufacturer_inputs_string);

 

But I'm lost as to how to make the $manufacturer_inputs_string relate to the manufacturer_paragraph field in the databasse. I'm not fussed about the TEXT_MANUFACTURERS_PARAGRAPH appearing in the admin - or should I be?

 

 

I suppose this is the first half. Once this is sorted it's then a case of getting the paragraph to appear in the manufacturer/index page.

 

 

 

 

 

 

 

Thanks

 

Matt

oscommerce_community_forums.gif
Link to comment
Share on other sites

Hi, that doesn't work for me. It just breaks the SEO URLs and I get left with html names of --p-27.html etc.

Then your version of the url rewriter is not working correctly and needs to be updated or you didn't run fill tags in Header Tags.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks, but back to my question. Ignoring sorting out the admin side, if I have created a field in the database called manufacturer_paragraph in database table manufacturer_info, how do I call that within the php for the manufacturer section within index.php?

 

I'm trying soemthing like:

 

<?php echo tep_db_query("select manufacturers_paragraph from " . TABLE_PRODUCTS . " c, " . TABLE_MANUFACTURERS_INFO); ?>

 

What I get back from this is:

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

select manufacturers_paragraph from products c, manufacturers_info

 

I think I need to add some text/php in above this so that the echo function already knows what data it's calling back. Is that correct?

I'll be creating a paragraph for all manufacturers, even if small, so no need to check if null etc.

 

Please advise.

 

Thanks

 

Matt

oscommerce_community_forums.gif
Link to comment
Share on other sites

Thanks, but back to my question.

 

I think that what Jack suggested is an answer to your question.

 

However, to what you posted: You can not echo the query it self. You need to make the query and then you can echo or use any result of it. There are many examples all over osCommerce files, study them and look how it is done.

 

But first the query needs to be correct. If your manufacturers_paragraph is in table manufacturer_info, then what do you need the table product_info for? However, if you use more than one tables, you need to specify from what table each field should be taken. You need also to make sure that the correct manufacturer info is taken

 

More info about here

Link to comment
Share on other sites

Jack:

 

Sorry, that didn't mean to come accross as rude, have just had too many problems with SEO URL add-on and don't want to change it as currently working. Also I don't see where the manufacturer paragraph or info is added under the SEO add-on that I have installed.

 

multimixer:

 

Thanks for the advice. Following on from your comments, I think I need something like the following at the top of the php:

 

$manufacturers_paragraph = tep_db_query("select manufacturers_id, manufacturers_paragraph from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = " ????? );

OR

 

$manufacturers_paragraph = tep_dp_query("select manufacturers_paragraph from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = "??????);

 

I think this may be similar to:

 

$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");

 

so I need something like:

 

$manufacturers_paragraph = tep_db_query("select manufacturers_id, manufacturers_paragraph from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int) $HTTP_GET_VARS['manufacturers_id'] . "'");

 

Am I getting close? I can't see how I am supposed to specify the correct row in the database table. I think the page should have the manufacturers_id as a stored variable, as this would be selected in arriving at the manufacturer page.

 

After this I still need to echo the query. I don't know from here if I'm barking up the wrong tree though. If the page isn't loading, I'm assuming there's something wrong and it's not the fact that I haven't used the echo command further down I hope.

 

Thanks in advance

 

Matt

oscommerce_community_forums.gif
Link to comment
Share on other sites

Sorry, that didn't mean to come accross as rude, have just had too many problems with SEO URL add-on and don't want to change it as currently working. Also I don't see where the manufacturer paragraph or info is added under the SEO add-on that I have installed.

No need to apologize. I didn't take offense. :) If you look in the index.php file that is included with Header Tags SEO, it has the code that you are trying to figure out. You will need to change the names since you don't want to load the Header Tags fields, but the rest should be the same, I think.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Header Tags SEO adds the necessary code to display a description for each manufacturer.

 

Hi Jack

I am using htc with sts and understand exactly what you are talking about. How can I change the style of the manufacturers description font shown on the front end in HTC. At present it always shows as H2 if you look at the page source. Even just default text font will be fine

Link to comment
Share on other sites

Hi Jack, thanks. I'm still struggling. I think I actually have the Ultimate SEO add-on installed, but downloaded the Header TAG SEO to see the index.php file. Can you install the Header TAG SEO add=on along side the Ultimate URL? I thought you could only do one.

 

Either way, I've had a look at the index.php. I think I understand what needs doing... I've just noticed though, there are 3 sections to the index page of which I thought the middle one was only for the manufacturer page, but it also displays the categories too. Hmmm.

 

I think I'm going into too much detail.

I've edited some of it as per the following:

 

 

<?php

if(isset($text['manufacturers_id'])){

$query2a = tep_db_query("select manufacturers_paragraph from " . TABLE_MANUFACTURERS_INFO . " where ". TABLE_MANUFACTURERS_INFO.".manufacturers_id=". $text['manufacturers_id']);

while($manufacturers_info_text = tep_db_fetch_array($query2a)){

if($manufacturers_info['manufacturers_paragraph']!=""){

echo ($manufactuers_info_text['manufacturers_paragraph']);

}

}

}

}?>

 

This doesn't work though. The site is only in English, so I took out what seemed to relate to the langauge filters out. Is that wrong?

 

 

I'm assuming manufacturers_id is a variable loaded when landing on the page.

Also, naming the query, query2a... does this make a difference?

 

What part of taking information from the database doesn't this do?

 

I'm not sure if fetch_array is correct?

 

And also, I don't see why it needs the if statement at the end if I'm planning on having something for all of the manufacturers?

 

Regards

 

Matt

oscommerce_community_forums.gif
Link to comment
Share on other sites

I think I actually have the Ultimate SEO add-on installed, but downloaded the Header TAG SEO to see the index.php file. Can you install the Header TAG SEO add=on along side the Ultimate URL? I thought you could only do one.

 

Matt, you are really struggling :) Thats ok, because it's the only way to learn

 

The query from index.php (from header tags addon) looks like this

    if (isset($HTTP_GET_VARS['manufacturers_id']))
     $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

 

The only thing you need to change here is the name of the field of the table you want to use

 

And of course you can have both, header tags and SEO url, I have both, like I think most of the people do

Link to comment
Share on other sites

Hi George,

You make it sound so easy. I think it is. I really do. I'm either being blonde or the grey matter is starting to let me down.

I think I understand what's going on, I just can't quite get it right.

 

Taking what you've said as simply as it sounds, I've come up with:

 

<?php if (isset($HTTP_GET_VARS['manufacturers_id']))

$db_query = tep_db_query("select manufacturer_paragraph as htc_title, manufacturers_url as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");?>

 

<?php echo $htc_title['manufacturer_paragraph']; ?>

 

If you would be as kind as to explain where I'm going wrong in my inderstanding from the following break down I would be eternally grateful.

 

<?php if (isset($HTTP_GET_VARS['manufacturers_id']))

This brings over the manufacturer_id from selecting the manufacturer and allows you to use this variable in selecting certain data from fields in the database.

 

$db_query = tep_db_query

$db_query is just a new variable being used to define the rest of this statement? Or is it a specific programming term?

 

("select manufacturer_paragraph as htc_title, manufacturers_url as htc_description from " . TABLE_MANUFACTURERS_INFO . "This selects manufacturer_paragraph entry from db and makes it equal variable htc_title? as similar with url, both bits of data coming from the manufacturer_info table.

 

where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");?>

Just makes sure it's the appropriate langauge source.

 

 

 

 

<?php echo $htc_title['manufacturer_paragraph']; ?>

This bit I thought was straight forward. But maybe not.

 

 

Should I change the htc_title term/variable as well?

 

I think I'm close. I think my understanding is correct... I just don't know why I'm getting nothing back on screen.

I have filled in the manufacturer_paragraph fields in the table for the manufacturer pages I'm requesting.

 

???? :'(

oscommerce_community_forums.gif
Link to comment
Share on other sites

Ok, lets take things from beginning

 

1) You have a field in your database and in table manufacturers_info called manufacturer_paragraph

2) You have at least one manufacturer defined via admin and this manufacturer has some products

3) There is something written in the database (for manufacturer_paragraph) like "this is the best manufacturer"

 

So, your query looks as follows

 

 
if (isset($HTTP_GET_VARS['manufacturers_id']))
     $matts_query = tep_db_query("select manufacturer_paragraph  from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

Then you need to say

$kuku = tep_db_fetch_array($matts_query);

Then you can say

<?php echo $kuku['manufacturer_paragraph']; ?> 

 

Of course thats just the half part, it's about taking the info from the database, you need to find a way to write this info into the database.

 

In the time struggling with this you would have header tags seo installed 3 times IMHO

Link to comment
Share on other sites

Yes, you're probably right. I probably could have installed the SEO option 3 times (being stubborn and determind does have its negatives), however, I would have learnt the grand sum of nothing. This way, I now understand a lot more, and can hopefully look at some of the other php and database stuff in a whole new light. The part which was getting me stuck was the "$kuku = tep_db_fetch_array($matts_query);" line. Now however, I think I have a much better understanding. I'm no genius certainly, but I cannot thank you enough for your help on this.

 

As for getting stuff into the database, that's not a problem, I can edit that directly. I've learnt a patchwork of skills which if I knew the bits inbetween would put me in a very good position. As for formatting and positioning of the code, that's much easier, I can do that with one hand behind my back.

 

Many many many thanks!!!

 

Matt

:thumbsup:

oscommerce_community_forums.gif
Link to comment
Share on other sites

hello, I'm trying something similar, I display the product descriptions while browsing the categories.

 

 

Any ideas.

Thank you.

 

I think you need to edit modules/product_listing.php

If I guess right, you want the product description text to show as well as the price and product name when browsing the categories.

oscommerce_community_forums.gif
Link to comment
Share on other sites

Hi Jack

I am using htc with sts and understand exactly what you are talking about. How can I change the style of the manufacturers description font shown on the front end in HTC. At present it always shows as H2 if you look at the page source. Even just default text font will be fine

Search the index.php file for h2 and change it to whatever class you want to use.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Ok, lets take things from beginning

 

1) You have a field in your database and in table manufacturers_info called manufacturer_paragraph

2) You have at least one manufacturer defined via admin and this manufacturer has some products

3) There is something written in the database (for manufacturer_paragraph) like "this is the best manufacturer"

 

So, your query looks as follows

 

 
if (isset($HTTP_GET_VARS['manufacturers_id']))
     $matts_query = tep_db_query("select manufacturer_paragraph  from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

Then you need to say

$kuku = tep_db_fetch_array($matts_query);

Then you can say

<?php echo $kuku['manufacturer_paragraph']; ?> 

 

Of course thats just the half part, it's about taking the info from the database, you need to find a way to write this info into the database.

 

In the time struggling with this you would have header tags seo installed 3 times IMHO

 

 

Hi George,

 

Ok, that worked, I now have the manufacturer paragraph text being pulled from the database and showing perfectly.

 

The only problem is that the categories page now shows an empty box where the manufacturer text appears on the manufacturer page (because I put the box around the manufacturer text....). I want to try and create a similar thing with the categories, and thought the following would work, but I get nothing coming up (better than errors i suppose??):

 

if (isset($HTTP_GET_VARS['categories_id']))

 

$matts_query2 = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'");

 

$kuku2 = tep_db_fetch_array($matts_query2);

 

 

AND further down/in box

 

 

<?php echo $kuku2['categories_name']; ?>

 

There is something about 'nested' categories, but surely, the info I'm trying to take from the table shouldn't be affected by this. Each category still has its own ID number yes? And this ID number is selected when you select the category from the infobox menu which uses the same categories_id variable...

I've also noticed that languages_id in the categories table is language_id, and I think I have this the right way round, and have tried swapping it... but no luck.

 

Can I use:

 

isset($HTTP_GET_VARS['categories_id'])

 

 

to get the category_id?

 

 

Yet again, I can't understand where this goes wrong.

oscommerce_community_forums.gif
Link to comment
Share on other sites

  • 4 months later...
  • 5 months later...

Did you figure this out? I want to add a description on the manufacturer's page as well, not the meta tags. Please advise :)

 

KISSMT will let you add description to the manufacturer pages, but it also does your meta tags automatically, I am not sure if you want that

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...