home | contact us
» Posts tagged "ean"

Items Tagged: ean


So now that everyone uses Google Shopping, Google are making life difficult for the merchants and they all have to jump through hoops.

The current push from Google is enforcing some things that are very difficult for small companies to conform with :-

* EAN Numbers – This is the BIG one, Google are making EAN Numbers required – for some retailers, they just don’t exist, and for a lot of older or cheaper shopping cart systems, they don’t have anywhere to enter them.
* Google Category – This is a fairly obvious one, they are attempting to enable shoppers to browse products and find a motherboard for instance with a 1156 socket rather than a CPU that fits an 1156 socket. The answer is to add an extra field to a site’s category system to map site categories to Google categories, or to restructure your products into google’s categorisations.
* Product Images – Google are making this mandatory as well, which most people are getting round by using stock or illustration-only images.
* Availability – This one actually helps retailers, putting orderable products that are out of stock in front of customers, and is a small change to most scripts exporting to Google

The above changes are being phased in now but should your feed suddenly stop working, how big is the impact on your business? Whilst some of the changes are little tweaks, such as the availability flag, others require fairly substantial changes in the back-end of many cart systems. We are getting many aggrieved businesses contacting us asking for fast turnaround on their Google products feed as they are loosing money all the time that Google are rejecting their products.

What normally (given past changes) has been little tweaks for feeds to be compatible has lately become hours and hours of work both on developers and store-owners. Are you ready to jump through the latest burning hoop Google is holding out for you?


 

Check out this little query for checking for obviously invalid EANs.

Note this is not checking the check digit for validity, it is purely looking for data that is in no way possibly an EAN number.

update products set ean = '' where ean != '' and ean not regexp '^[0-9]{13}$'

assuming you have a column called ean, this will empty the value for the EAN for any product that has dodgy data in there.

MySQL regex is actually very powerful and fast.


 

Just found this MySQL snippet for validating EAN numbers.

http://snipplr.com/view.php?codeview&id=17928

I have modified it a bit to suit my requirements (namely totally corrupted EAN data).

SELECT ean
FROM products
WHERE
(LENGTH(ean) != 13)
||
(SUBSTRING((10 - ((((
SUBSTRING(ean FROM 2 FOR 1) +
SUBSTRING(ean FROM 4 FOR 1) +
SUBSTRING(ean FROM 6 FOR 1) +
SUBSTRING(ean FROM 8 FOR 1) +
SUBSTRING(ean FROM 10 FOR 1) +
SUBSTRING(ean FROM 12 FOR 1)  
)*3) + (
SUBSTRING(ean FROM 1 FOR 1) +
SUBSTRING(ean FROM 3 FOR 1) +
SUBSTRING(ean FROM 5 FOR 1) +
SUBSTRING(ean FROM 7 FOR 1) +
SUBSTRING(ean FROM 9 FOR 1) +
SUBSTRING(ean FROM 11 FOR 1)
)) MOD 10)) FROM -1 FOR 1) != SUBSTRING(ean FROM 13 FOR 1))

 
rss icon