We first store the HTML of the Mini Best Seller layout from all products into an array.
Then later display 4 at random.
<!-- Here we fill a PHP array with snippets of HTML from all products -->
<actinic:block php="true">unset($allproducts);</actinic:block>
<actinic:block type="EntireSectionList">
<actinic:block type="ProductList" php="true">
if ( <actinic:variable name="ProductType" /> == 0 )
{
$allproducts[] = <<<ENDOFCODE
<actinic:variable name="BestSellerItem" value="Mini Best Seller Layout" encoding="perl" />
ENDOFCODE;
}
</actinic:block>
</actinic:block>
<!-- Here we output 4 random products -->
<actinic:block php="true">
for ( $i=1; $i<=4; $i++ )
{
echo '<br clear="all" />' . $allproducts[mt_rand(0, count($allproducts) - 1)];
}
</actinic:block>
You could put the first bit (or all of it) into a layout that's processed only once (like Brochure Home page). The second snippet could be on every page as the PHP array should be populated then.
Kindly provided by Norman Rouxel from Drillpine
Then later display 4 at random.
<!-- Here we fill a PHP array with snippets of HTML from all products -->
<actinic:block php="true">unset($allproducts);</actinic:block>
<actinic:block type="EntireSectionList">
<actinic:block type="ProductList" php="true">
if ( <actinic:variable name="ProductType" /> == 0 )
{
$allproducts[] = <<<ENDOFCODE
<actinic:variable name="BestSellerItem" value="Mini Best Seller Layout" encoding="perl" />
ENDOFCODE;
}
</actinic:block>
</actinic:block>
<!-- Here we output 4 random products -->
<actinic:block php="true">
for ( $i=1; $i<=4; $i++ )
{
echo '<br clear="all" />' . $allproducts[mt_rand(0, count($allproducts) - 1)];
}
</actinic:block>
You could put the first bit (or all of it) into a layout that's processed only once (like Brochure Home page). The second snippet could be on every page as the PHP array should be populated then.
Kindly provided by Norman Rouxel from Drillpine
Comment