You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
How can we randomise and auto scroll the splash page featured product listing like the code changing provided for CCP8 at https://forum.kryptronic.com/viewtopic.php?id=30457?
Last edited by sdn (04-26-2017 02:03:31)
Offline
In the file {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php, in the prodlist() function, look for:
// +-- // | Piece together our SQL statement and execute it. // +-- if (empty($count)) {$count = 10;} if (!(empty($where))) {$sql .= ' WHERE ' . $where;} if (!(empty($limitresult))) { $result = $this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'ecom_prod', 'order' => array($sortfield => $sorttype, 'id' => 'ASC'), 'count' => $limitresult, 'offset' => 0));
Change to:
// +-- // | Piece together our SQL statement and execute it. // +-- if (empty($count)) {$count = 10;} if (!(empty($where))) {$sql .= ' WHERE ' . $where;} if ((!(empty($limitresult))) && (preg_match('/^FEAT/',$callerref))) { $result = $this->CORE_DB->sql_do_raw($sql . ' ORDER BY RAND() LIMIT 0,25'); } elseif (!(empty($limitresult))) { $result = $this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'ecom_prod', 'order' => array($sortfield => $sorttype, 'id' => 'ASC'), 'count' => $limitresult, 'offset' => 0));
Offline
Thanks for the code. To autoscroll in CCP8 you said we could do the following but that line is not present in K9 so is there a way to add that feature?
At the bottom of the file {private}/apps/ecom/ECOM/includes/prodlist.php, find:
Code:Code:
$js_windowload = 'jQuery(\'#' . $wrapid . '\').jshowoff({cssClass: \'' . $class . '\', effect: \'fade\', links: false, autoPlay: false});';And change the 'false' to 'true' for the autoPlay array key.
Last edited by sdn (04-28-2017 02:55:33)
Offline
Missed the auto-scroll part. Are you presenting these in a slider display and you automatically want it to advance the slider spot at an interval? If so, it might be as easy as something like:
setInterval(function () {jQuery('.kslidecontr').click();},3000);
The above simulates a click on the righthand slider arrow every 3 seconds.
Offline