Jump to content



Latest News: (loading..)

- - - - -

Open discussion on SEO

seo optimization

  • Please log in to reply
128 replies to this topic

#121 ONLINE   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 14 June 2013 - 10:20 AM

View PostWebSource 5, on 13 June 2013 - 11:17 PM, said:

My thoughts exactly, ~ just reversed :)

HOw does this grab you, can you optimise?

function osc_split_mini_description($products_precis) {
	$content = strip_tags($products_precis, '<br>');
	if (strlen($content) > 155) {
	  $shorten = strpos($content, ' ', 150);
	  return substr($content, 0, $shorten) . '...';
	}
	else {
	  return $content;
	}
  }

  function osc_get_mini_description($products_id) {
	global $languages_id;

	$product_query = tep_db_query(" select coalesce(products_mini_description, products_seo_description, LEFT(products_description, 300)) as products_precis from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "' and language_id = '" . (int)$languages_id . "'");
	$product = tep_db_fetch_array($product_query);

	return osc_split_mini_description($product['products_precis']);
  }

Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#122   WebSource 5

WebSource 5

    ıllıllı < /> ıllıllı

  • Community Sponsor
  • 499 posts
  • Real Name:G.L.Walker
  • Gender:Male
  • Location:Republic of Texas

Posted 15 June 2013 - 03:24 AM

View Postburt, on 14 June 2013 - 10:20 AM, said:

HOw does this grab you, can you optimise?

Awesome, I like how coalesce does all the work without the need to create a mile long function.

I set this up on a test site, and got it to work as needed, but had to add NULLIF or it would not retrieve further than the first requested column. I double checked to make sure my columns were NULL as default, as from what I found on coalesce shows it is made to work on columns set to null, not empty. They were, but anyhow, check this out:
  function osc_split_mini_description($products_precis) {
	$content= strip_tags($products_precis);   
	  if (strlen($content) > 156 ) {
		$content = substr($content, 0, strpos($content, ' ', 156));
	  }
	  return $content;
  }
  
  function osc_get_mini_description($products_id) {
	global $languages_id;
	$product_query = tep_db_query(" select coalesce(NULLIF(products_mini_description,'') , NULLIF(products_seo_text,'') , NULLIF(LEFT(products_description, 300),'') ,'". TAG_LINE ."') as products_precis from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "' and language_id = '" . (int)$languages_id . "'");
	$product = tep_db_fetch_array($product_query);
	$products_precis = $product['products_precis'];
	return osc_split_mini_description($products_precis);
  }

I added TAG_LINE to be the default throw back. If it is set in the stores configurations options then it can be used in the rare case that none of the 3 exist.

I noticed earlier in this thread you had microformats in mind. I have been studying these a while now, and I feel that this exact function should also be used for microformating the description itemscope. It would keep the description consistant anywhere that the product id presented, IE: a product infoBox or the product listing or product info page. The character length is just fine and there would be no chance for one product display presenting different content than the same product being presented elsewhere.

Another good thing, this function could be duplicated, osc_get_meta_description and just switch the first 2 column lookups around for a failsafe meta description output.

#123   WebSource 5

WebSource 5

    ıllıllı < /> ıllıllı

  • Community Sponsor
  • 499 posts
  • Real Name:G.L.Walker
  • Gender:Male
  • Location:Republic of Texas

Posted 15 June 2013 - 04:14 AM

Query should have read "products_seo_description" above, I had different field names already existing

#124 ONLINE   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 15 June 2013 - 07:23 AM

Yep, I am also working on microformatting some bits, I know you've done this on some areas, so if you can advise (or link me to yours) I'm all ears :D

If the columns are set to be null (or have content), we shouldn't need the nullif...
Do we really need a default throwback?  I don't want to take all the work away from the shop owner ;)
Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#125   WebSource 5

WebSource 5

    ıllıllı < /> ıllıllı

  • Community Sponsor
  • 499 posts
  • Real Name:G.L.Walker
  • Gender:Male
  • Location:Republic of Texas

Posted 15 June 2013 - 02:00 PM

View Postburt, on 15 June 2013 - 07:23 AM, said:

If the columns are set to be null (or have content), we shouldn't need the nullif...

That was my understanding of it as well, but no matter how I tried without NULLIF it would only load if I had a mini description set, otherwise it just died. My columns are set to null, so my only conclusion was it must b the over all server set up?

No real need for a throw bak, oter than its nice to be able to do it. If the query runs that far and does not find content, theres really no point anyhow.

I can help set up some microformats, I'm currently wrapping some up on a test 2.3 site. They are everywhere, my code had changed a lot, but the general idea is there. I'll update when I get wrappedup, I have some ideas for writing a few new functions now :)

#126 ONLINE   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 17 June 2013 - 10:01 PM

Just a couple of microdata bits to code up in the first round of changes :

http://forums.oscommerce.com/topic/392853-open-discussion-on-seo/page__st__100#entry1673255

Edited by burt, 17 June 2013 - 10:01 PM.

Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#127 ONLINE   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted Yesterday, 12:12 PM

Been doing a load of research on meta keywords, including an experiment on a live site.

I've come to the conclusion that meta keywords are unused by most search engines.  

The only one I can find definitely ARE used on is:

Baidu

Do I leave the module in, or rip the module right out?  

--

Instead of completely nuking it, how about have the keywords admin as a "tagging" system for products.  
And make the advanced_search_result page also search these tags to return products that match the search.
So, you could have common mis-spellings of your product, EG:  "creme egg" (and in the tagging system have "cream egg")

Edited by burt, Yesterday, 12:19 PM.

Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#128   kymation

kymation

    Believers

  • Community Sponsor
  • 6,759 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted Yesterday, 04:25 PM

Leave the module in, or you'll get tons of complaints from people who insist they need it. Been there, done that.

I like the idea of making the search engine use it for alternate terms. That would be useful.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#129   MrPhil

MrPhil
  • Members
  • 4,194 posts
  • Real Name:Phil
  • Gender:Male

Posted Yesterday, 08:06 PM

There's no harm in leaving in the <meta> keywords system, at least so long as you aren't doing anything that Search Engines might penalize as black hat SEO (keyword stuffing, keyword hijacking, etc.). Worst case, they ignore it; best case, it might help a little. Let implementers turn it off/not install it by their choice, if they really think it might be harming them.