Hi!
This is the example of test script that will be helpful for you. It will work only when there are some products in your cart.
PHP Code:
<?php
require_once 'top.inc.php';
$itemCount = 0;
$cart = \XLite\Controller\Customer\Cart::getInstance()->getCart();
foreach ($cart->getItems() as $item) {
if ($item->getProduct()) {
foreach ($item->getProduct()->getImages() as $image) {
echo $image->getFrontURL() . '<br />';
}
$itemCount += 1;
}
}
if ($itemCount == 0) {
echo 'No products in the cart';
}
You should put this code into any script (test.php for example) in the root folder of your X-Cart 5 installation and it will work. Hopefully, it will give you an idea of how to get info about product images.