Can't get product images to display on main page
Hi,
I'm upgrading (finally!) from 1.3.9 to 1.5.4 and am having a heck of a time going about it. Currently my issue is the following:
On my main page, I have the New Products listed (they work fine) and, under them, the Upcoming Products in the center column. I want both boxes to be identical -- that is, the products will be displayed with their respective images, like they currently are on my old site.
But for whatever reason, the Upcoming Products all appear with the no_picture.gif image instead of the book cover of the product. The correct images are on my server, and when you click on the products to go to the product page, you see the right image. But I can't for the life of me figure out why they aren't appearing on the front page.
The code I'm using is this:
<?php
for($i=0, $row=0; $i < sizeof($expectedItems); $i++, $row++) {
$rowClass = (($row / 2) == floor($row / 2)) ? "rowEven" : "rowOdd";
echo ' <div class="centerBoxContentsUpdated centeredContent back">' . "\n";
echo ' <a href="' . zen_href_link(zen_get_info_page($expectedItems[$i]['products_id']), 'cPath=' . $productsInCategory[$expectedItems[$i]['products_id']] . '&products_id=' . $expectedItems[$i]['products_id']) . '"> ' . zen_image(DIR_WS_IMAGES . $expectedItems[$i]['products_image'], $expectedItems[$i]['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br clear=all /><strong><a href="' . zen_href_link(zen_get_info_page($expectedItems[$i]['products_id']), 'cPath=' . $productsInCategory[$expectedItems[$i]['products_id']] . '&products_id=' . $expectedItems[$i]['products_id']) . '">' . $expectedItems[$i]['products_name'] . '</a></strong><br clear=all />' . zen_get_products_manufacturers_name($expectedItems[$i]['products_id']) . '<br clear=all />' . "\n";
echo ' ' . zen_date_short($expectedItems[$i]['date_expected']) . '<br clear=all /><br clear=all /></div>' . "\n";
}
?>
Also, as a side note, the Upcoming Products won't list in descending order by release date, but I can figure that out (I hope). This is a more pressing issue.
If anyone can help, I would much appreciate it.
Re: Can't get product images to display on main page
Quote:
The code I'm using is this:
From or into what file?
Re: Can't get product images to display on main page
It's from a file called tpl_modules_products_coming_soon.php
Re: Can't get product images to display on main page
What is the purpose of the edit?
Did you also edit the new products file?
What happens if you remove your edited template files for the server(these are copies in your template - right?)
Supplied code does not call out images but they are displayed in stock form
Code:
<?php
for($i=0, $row=0; $i < sizeof($expectedItems); $i++, $row++) {
$rowClass = (($row / 2) == floor($row / 2)) ? "rowEven" : "rowOdd";
echo ' <tr class="' . $rowClass . '">' . "\n";
echo ' <td ><a href="' . zen_href_link(zen_get_info_page($expectedItems[$i]['products_id']), 'cPath=' . $productsInCategory[$expectedItems[$i]['products_id']] . '&products_id=' . $expectedItems[$i]['products_id']) . '">' . $expectedItems[$i]['products_name'] . '</a></td>' . "\n";
echo ' <td align="right" >' . zen_date_short($expectedItems[$i]['date_expected']) . '</td>' . "\n";
echo ' </tr>' . "\n";
}
?>
Re: Can't get product images to display on main page
When I remove the file from the server, the default is that the products display in a list with the title and release date. That isn't what I want -- I want the cover images displayed.
The purpose of the edit is to display the covers, and not just a list of upcoming titles.
Re: Can't get product images to display on main page
in the future, use the code tags (code with square brackets around it; and /code to end; again with square brackets). it makes easier to read! (it also would help to do some indents!)
Code:
<?php
for($i=0, $row=0; $i < sizeof($expectedItems); $i++, $row++) {
$rowClass = (($row / 2) == floor($row / 2)) ? "rowEven" : "rowOdd";
echo ' <div class="centerBoxContentsUpdated centeredContent back">' . "\n";
echo ' <a href="' . zen_href_link(zen_get_info_page($expectedItems[$i]['products_id']), 'cPath=' . $productsInCategory[$expectedItems[$i]['products_id']] . '&products_id=' . $expectedItems[$i]['products_id']) . '"> ' . zen_image(DIR_WS_IMAGES . $expectedItems[$i]['products_image'], $expectedItems[$i]['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br clear=all /><strong><a href="' . zen_href_link(zen_get_info_page($expectedItems[$i]['products_id']), 'cPath=' . $productsInCategory[$expectedItems[$i]['products_id']] . '&products_id=' . $expectedItems[$i]['products_id']) . '">' . $expectedItems[$i]['products_name'] . '</a></strong><br clear=all />' . zen_get_products_manufacturers_name($expectedItems[$i]['products_id']) . '<br clear=all />' . "\n";
echo ' ' . zen_date_short($expectedItems[$i]['date_expected']) . '<br clear=all /><br clear=all /></div>' . "\n";
}
?>
can you post the html output by your code? ideally one (or a couple) copies of the <div class="centerBoxContentsUpdated centeredContent back">' would be helpful.
actually, i'm pretty sure your problem is probably where the $expectedItems object is created. if you track down where that SQL statement is constructed, i'm pretty sure the field: products_image is not in that SQL statement. if you add it there, it should work fine.
good luck!
Re: Can't get product images to display on main page
yeah, that's it...
look in modules/upcoming_products.php
there are 2 querys there have begin with
$expected_query
after p.master_categories_id, add p.products_image and i'm pretty sure you should be all good to go.
in addition, you can change your sort order in both of those queries. add an:
order by products_date_available
and you can solve that problem as well.
good luck!