Jump to content

Help pls for sync scrip / images prob.


baal81

Recommended Posts

hi @ all,

 

i´m get crazy slowly...

 

all of the sync script works fine... products are 100% perfekt in the db and all but the images makes trouble or mass ! ...

 

and in google is there no way how prestashop builds up the image paths and so .....

 

on the first look it should be the cat and article count... but it wasent.

 

i have 73000 products and pls not say me make a csv -.- ;) because then ur sure carzy between i become every hour new prices and and ... and u not think that ill sit there and make every hour a new csv file or ;)

 

also pls can anyone give me an idea how i can generate the images and folders in the linux shell..

 

thats the only point that stops the complete work on the shop, ill work there since 3 days.

 

big thx to all...

Link to comment
Share on other sites

Unfortunately it isn't just a case of naming the images correctly, but you also need to create records in the database which are linked to the product id....

 

If you take a look at the AdminImport.php in the admin "tabs" directory you'll see how they are handled.

 

Basically you pass the image and product id to a new Image object. Confusingly in AdminImport.php the images are stored as an array in a variable $product->images - searching for that should get you to the relevant code. You also need to be able to create multi-language fields for the legend which is an added complication.

 

Paul

  • Like 1
Link to comment
Share on other sites

THX ur Tip shows me a Way...

This:

Sample code to generate the folder Structure:

 

	$pro_nr=556754;
$group=30;
$mainpath='/var/customers/webs/multimedia/img/p/';
$pathway1 = $group.$pro_nr;
$filename1 = $group . $pro_nr . '.jpg';
$filename2 = $group . $pro_nr . '-home.jpg';
$filename3 = $group . $pro_nr . '-large.jpg';
$filename4 = $group . $pro_nr . '-medium.jpg';
$filename5 = $group . $pro_nr . '-small.jpg';
$filename6 = $group . $pro_nr . '-thickbox.jpg';

echo $mainpath.chunk_split($pathway1,1,"/").$filename2;

Output: /var/customers/webs/multimedia/img/p/3/0/5/5/6/7/5/4/30556754-home.jpg

 

The new folders can be make with mkdir and check with chdir. all works fine .... 370 products in a time from a cig ;) and that with a vserver(transfer from db to db and resize all images with watermark).

 

ill think when all i finished and the people need a cron script for ingram micro then ill upload it.

 

big thx to Paul C

 

ps: most is the simple way, that way that u forget ;)

 

Unfortunately it isn't just a case of naming the images correctly, but you also need to create records in the database which are linked to the product id....

 

If you take a look at the AdminImport.php in the admin "tabs" directory you'll see how they are handled.

 

Basically you pass the image and product id to a new Image object. Confusingly in AdminImport.php the images are stored as an array in a variable $product->images - searching for that should get you to the relevant code. You also need to be able to create multi-language fields for the legend which is an added complication.

 

Paul

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...