Hello to everybody,
I've been developing an extension in order to print catalog items in PDF with a custom layout. I hooked printArticleAsPdf and wrote the code to get from Database all the information I needed.
I successfully managed to read single image fields from database and have them printed out in the PDF, using simply
What I can't get is how to print the first picture of a multiple-images-field. If I check the Multiple selection checkbox in catalog back-end I can upload more than one picture, but what I find in the DB is something quite odd to me. I seeCode:if(!is_null($resultEdizione->immagine) && $resultEdizione->immagine!='a:1:{i:0;N;}') { $strArticle = $strArticle.'<td style="width: 47%;">[img]'.$resultEdizione->immagine.'[/img]</td>'; }
if I don't have any pictureCode:a:1:{i:0;N;}
and the following if I have one:
This looks somehow like a JSON to me, but how can I get the image URL from there? Please consider that I can't extract the information via regexp (at least I don't think I can) since I could actually have more than one picture saved in that field.Code:a:2:{i:0;N;i:1;s:41:\"tl_files/catalog_cat_edizioni/piastre.JPG\";}
Thank you in advance
Bookmarks