rseigel Posted September 26, 2013 Share Posted September 26, 2013 I've tried to figure this out (found a few kinda sorta threads that didn't quite get me there) for a while now. What I need to do is, using php, get the URL of the main picture for a given product. I'm using 1.5.3.1. Does anyone have the snippet that would get that? This is for a custom script that I use to create product feeds for different marketplace sites. TIA Ron Link to comment Share on other sites More sharing options...
vekia Posted September 26, 2013 Share Posted September 26, 2013 example of code: $product = new Product(2); $img=$product->getCover(2); $img_url=$link->getImageLink($product->link_rewrite,$img['id_image'],'home_default'); Link to comment Share on other sites More sharing options...
rseigel Posted September 26, 2013 Author Share Posted September 26, 2013 (edited) Wicked. Thanks for that. Now, I'm a bit confused. How do I use that on the fly in a loop (the loop part I have - no issues there). Basically, I want to get the URL for each product as I loop through them. I can simply add it to my CSV file after the SELECT has grabbed everything else and written the CSV file. So, I'm looking to look each main image URL up by SKU (or ID or whatever). Does that make sense? Edited September 26, 2013 by rseigel (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now