You are here:  » EAN Compare


EAN Compare

Submitted by McCloud on Thu, 2020-05-28 17:21 in

Hello David,

i have the module for extra field and this is Ean. Now my question is:
Does the program compair the products automaticly with the ean, or only with the product name?

regards, Peter

Submitted by support on Fri, 2020-05-29 06:42

Hi Peter,

Automatic Product Mapping by UID is an import time process that changes the name of all products with the same EAN to have the same name. This is because at the front-end, comparison is by name only as this gives the benefit of search engine friendly URLs e.g. /product/Product-Name.html without any clutter or unique IDs as part of the page address.

I saw when I checked your site when I was helping with your installation that the uidfix table had been created, so all that is left for you to complete the automatic mapping setup is to get /scripts/uidmap.php to run after your cronjob as per the second part of step 3 of the instructions.

However, if you are just getting started and have a couple of feeds set-up with EAN values being imported you can just run the script through the browser by going to /scripts/uidmap.php and you should see the products matched together once completed. You will also be able to see the output showing what has been matched...

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 12:52

Hello David,

must i run /scripts/uidmap.php only once, or every time i import new products?

Thank you very much, Peter

Submitted by support on Fri, 2020-05-29 13:38

Hello Peter,

It needs to run after every full import - so it should really be made part of your cronjob...

https://www.pricetapestry.com/node/6

...and then once you have your cronjob set-up, you can add uidmap.php to the command as described in step 3 of Automatic Product Mapping by UID

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 13:50

Hello David,

maybe im stupid, but where do i write what. Or is it possible to run the cron from the hosters cpanel?

Thank you for your patience, Peter

Submitted by support on Fri, 2020-05-29 13:58

Hi Peter,

Yes - it may well be part of your hosting control panel (e.g. cPanel).

Look for a section called "CRON" or "cronjobs" or maybe "Scheduled Tasks".

Normally, there is a form for you to enter the time of day to run, and a box for the command to run, which you can copy from the /admin/ area of your Price Tapestry site by going to Setup > CRON. If there is no Option 1 showing as available let me know and I will advise what to change to see if that can be made available as it is the best way to run cron with uidmap.php, otherwise you should see something like:

cd /home/username/public_html/scripts/;/usr/bin/php cron.php

...that's just for the normal cron.php which runs all your Automation Tool jobs and then imports all feeds. You can then add uidmap.php to that by adding on to the end after a semi-colon, so you have:

cd /home/username/public_html/scripts/;/usr/bin/php cron.php;/usr/bin/php uidmap.php

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 14:14

Hello David,

ok, now i put in the code at the end of /scripts/cron.php

{code saved}

Is this correct?

Regards, Peter

Submitted by support on Fri, 2020-05-29 14:14

Hi Peter,

There's no modification to the code required at all, it's the cronjob command line that you need to change.

From your Price Tapestry /admin/ area, can you go to Setup > CRON and then copy / paste what you see into a reply (I'll remove any host or usernames that show up in the command line) and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 14:18

Hi, David

thats the problem i cant put in somethin in Setup>CRON

I have only two examples, but not more.

Regards, Peter

Submitted by support on Fri, 2020-05-29 14:25

Hi Peter,

That's all you should be seeing in Setup > CRON (in the Price Tapestry installation) - can you copy the Option 1 example that you are seeing, then I can describe the next step over in your hosting control panel with your actual command line...

Thanks
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 14:31

Hi David,

the first Line is

cd /www/htdocs/w014f82d/example.com/scripts;/usr/bin/php cron.php

Thank you very much, Peter

Submitted by support on Fri, 2020-05-29 14:46

Hi Peter,

Perfect - i've just changed your site domain to example.com, so this makes your cronjob command line including uidmap.php as follows:

cd /www/htdocs/w014f82d/example.com/scripts;/usr/bin/php cron.php;/usr/bin/php uidmap.php

So now if you login to your hosting control panel (cPanel) and go to Advanced > Cron Jobs. There you should see an "Add new Cron Job" section. It looks like cPanel has a "Common Settings" box and you can select "Once per day". You should also see a box to enter the "Command" - and that is where you enter the above command line (don't forget to change example.com back to your domain name!)

(I don't use cPanel but I got the above from this page)

Hope this helps - let me know once you have it set-up and I'll add some more tips regarding automation...

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 14:58

Hello David,

at my cpanel i can put in the whole URL like https://example.com/scripts/uidmap.php

If this is ok, do i need to run more cronjobs for the script?

Thank you, Peter

Submitted by support on Fri, 2020-05-29 15:10

Hi Peter,

At your cpanel, in the command box put in:

cd /www/htdocs/w014f82d/example.com/scripts;/usr/bin/php cron.php;/usr/bin/php uidmap.php

(but change example.com to your domain)

Then you should be all set-up for automation...

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 15:17

Hello David,

sry, i have only the option to put in an URL and i wrote
https://example.com/scripts/uidmap.php

Its not possible to put in the code. Is this not ok?

regards, Peter

Submitted by support on Fri, 2020-05-29 15:25

Hi Peter,

Ah, in that case - yes almost that but instead, it's easy to make a cron.php that also runs uidmap.php. Also, your admin password is required in the URL.

1. Make a copy of scripts/uidmap.php and save as scripts/cron_uidmap.php

2. Edit scripts/cron_uidmap.php and look for the following code beginning at line 2:

  header("Content-Type: text/plain;charset=utf-8");
  print "Working...\n";
  set_time_limit(0);
  require("../includes/common.php");

...and DELETE those lines.

3. Edit scripts/cron.php and look for the following code at line 115:

  exit();

...and REPLACE with:

  require("cron_uidmap.php");
  exit();

Now you have a URL for cron.php that you can enter in your cPanel and will run the UID mapping process afterwards, but you also need to include your password so this is what you need to put in:

https://example.com/scripts/cron.php?password=YOUR_PASSWORD

(where YOUR_PASSWORD is your password for Price Tapestry /admin/ as configured in config.advanced.php)

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by McCloud on Fri, 2020-05-29 15:40

Hello David,

ok everything works, but...

why i need the password? It works without the password too.

Everything i changed is in the /script/ folder.

And do i need other cronjobs?

Thank you very much, Peter

Submitted by McCloud on Fri, 2020-05-29 15:44

Sry, my last post was wrong, i entered the wrong php

but do i need more cronejobs?

Thanks a lot

Submitted by support on Fri, 2020-05-29 15:49

Hi Peter,

No more cronjobs required - you're all set-up!

So now, the time that you set it to run (in cPanel), it will

1) Run all Automation Tool jobs to update your feeds
2) Import all feeds
3) Run the Automatic Product Mapping by UID process

If you have the option in cPanel to set the time of day that it runs, I would suggest early morning e.g. 6AM. That way, if your merchants update their feeds overnight you will get the latest prices...

Cheers,
David.
--
PriceTapestry.com