<modification>
<id>Random Special Products</id>
<version>1.0.0</version>
<vqmver>1.0</vqmver>
<author>opencartforum</author>
<file name="catalog/controller/module/special.php">
<operation error="skip"><!-- v1.4.x -->
<search position="replace"><![CDATA[
$results = $this->model_catalog_product->getProductSpecials('pd.name', 'ASC', 0, $this->config->get('special_limit'));
]]></search>
<add><![CDATA[
$results = $this->model_catalog_product->getProductSpecials('pd.name', 'ASC', 0, 10 * (int)$this->config->get('special_limit'));
srand((float)microtime() * 1000000);
shuffle($results);
$results = array_slice($results, 0, $this->config->get('special_limit'));
]]></add>
</operation>
<operation error="skip"><!-- v1.5.x -->
<search position="replace"><![CDATA[
'limit' => $setting['limit']
]]></search>
<add><![CDATA[
'limit' => ($setting['limit'] * 10)
]]></add>
</operation>
<operation error="skip"><!-- v1.5.x -->
<search position="after"><![CDATA[
$results = $this->model_catalog_product->getProductSpecials($data);
]]></search>
<add><![CDATA[
srand((float)microtime() * 1000000);
shuffle($results);
$results = array_slice($results, 0, $setting['limit']);
]]></add>
</operation>
</file>
</modification>