Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EAN / GTIN


burt

Recommended Posts

  • 1 month later...

Gary

 

Something you may want to consider. I needed the search system to also search the ean number, so I hope the following change is correct, but it does work.

 

In advanced_search_result.php

 

find

          $where_str .= "pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
          if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
          $where_str .= ')';
          break;

and replace it with

          $where_str .= "pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or p.products_gtin like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
          if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
          $where_str .= ')';
          break;

Searches will now find the gitn/ean number which will help some customers.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

  • 7 months later...

@@burt

 

I believe the GTIN is good for SEO, no doubt. One thing I'm noticing is that a lot of companies are appending some form of the GTIN or item number to the product's url.

 

I'm sure it's for internal tracking and analytics. But I wonder what affect it has on seo and pagerank. 

 

Could that be a new thing for OSC going forward?
 

Link to comment
Share on other sites

if you have gtin google will understand you are selling these products

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

@@bruyndoncx

 

You're correct. I realize Google knows that you're selling products if you're using a GTIN. When using Google's structured data tool, it will flag the gtin if not marked properly. Also when uploading products to Google Shopping they will exclude products from the shopping index if the gtin is not properly tagged.

 

Another way to look at, is shoppers don't look at urls as a part of the user experience. It's there for search engine bots to determine that page is selling a product as you said. From an SEO viewpoint, the bots first access a page through a url. So it's a very wise move for a shopowner to do that if they can. One can assume that gtin has enough weight for Google to not overlook it. As discussed previously in these forums, structured data is the way to go for ecommerce sites. 

 

Thanks for weighing in.

Link to comment
Share on other sites

  • 5 months later...
Quote
On 2/27/2016 at 1:38 PM, burt said:

Introduce GTIN

 

If you wish to test on an existing shop, make the changes as shown here:

https://github.com/gburton/Responsive-osCommerce/commit/fd9ccf9fe5bce79e57b50e50f5946e826f0b2ab2

 

 

In there:

$sql_data_array['products_gtin'] = str_pad(tep_db_prepare_input($HTTP_POST_VARS['products_gtin']), 14, '0', STR_PAD_LEFT);

This adds 000000000000 gtin for empty value. I made it like this:

    if (isset($HTTP_POST_VARS['products_gtin']) && $HTTP_POST_VARS['products_gtin']) {
      $sql_data_array['products_gtin'] = str_pad(tep_db_prepare_input((int)$HTTP_POST_VARS['products_gtin']), 14, '0', STR_PAD_LEFT);
    } else {
    $sql_data_array['products_gtin'] = 'null';
    }

Allows to have product without gtin. (custom products, oem etc. )

 

 

 

Link to comment
Share on other sites

Try

if (tep_not_null($_POST['products_gtin'])) $sql_data_array['products_gtin'] = str_pad(tep_db_prepare_input((int)$_POST['products_gtin']), 14, '0', STR_PAD_LEFT);

 

Link to comment
Share on other sites

  • 3 weeks later...
On 6/7/2017 at 2:52 PM, burt said:

Try


if (tep_not_null($_POST['products_gtin'])) $sql_data_array['products_gtin'] = str_pad(tep_db_prepare_input((int)$_POST['products_gtin']), 14, '0', STR_PAD_LEFT);

 

This does not allow emptying the value (aka set it to null). Thus explicit null is needed.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...