Jump to content

Archived

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

burt

EAN / GTIN

Recommended Posts

@@burt thank you Gary... Yes that is what I've done and its working. Just wondered if there was a way to somehow to use a hook (which to be clear I still don't understand) with out all the core changes.

Share this post


Link to post
Share on other sites

EAN / GTIN is now Core.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

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

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

@@14steve14

 

Should be fine, but for large shops could probably do with an index in the SQL table.

https://www.howtoforge.com/when-to-use-indexes-in-mysql-databases


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

@@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?
 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


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

 

 

 

Share this post


Link to post
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);

 


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


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

Share this post


Link to post
Share on other sites

×