Bobber Posted July 31, 2018 Share Posted July 31, 2018 For all who are looking to change their gallery in 2.3.4.1 CE I would definitely suggest this add-on by @wHiTeHaT https://apps.oscommerce.com/6V87X&bs-slick-image-gallery The formatting is clean and orderly... very nicely done! I do have a question I hope someone can help with... How do I change this add-on so it Does Not display the "main image"... This way it would only display the "Large Images" as the standard gallery does by default in 2.3.4.1 CE? I know changes need to be made in: /includes/modules/content/product_info/cm_pi_slick.php I am just not having any luck with this change... Thank you in advance for your help! valquiria23 and oscMarket 1 1 Quote Link to comment Share on other sites More sharing options...
Bobber Posted August 1, 2018 Author Share Posted August 1, 2018 Do you have any ideas @oscoMMarket? Quote Link to comment Share on other sites More sharing options...
♥frankl Posted August 1, 2018 Share Posted August 1, 2018 1 hour ago, Bobber said: Do you have any ideas @oscoMMarket? Apparently this is the solution: Just replace: $slicks[] = array('image' => $product_info['products_image'], 'htmlcontent' => null ); with: $slicks[] = ''; on line 42 Bobber 1 Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
Bobber Posted August 2, 2018 Author Share Posted August 2, 2018 39 minutes ago, frankl said: Apparently this is the solution: Just replace: $slicks[] = array('image' => $product_info['products_image'], 'htmlcontent' => null ); with: $slicks[] = ''; on line 42 Thank you for the help @frankl! This results in: Quote Warning: Illegal string offset '' in /home/public_html/includes/modules/content/product_info/cm_pi_slick.php on line 54Warning: Illegal string offset '' in /home/public_html/includes/modules/content/product_info/cm_pi_slick.php on line 57Warning: Illegal string offset '' in /home/public_html/includes/modules/content/product_info/cm_pi_slick.php on line 66 Quote Link to comment Share on other sites More sharing options...
♥frankl Posted August 2, 2018 Share Posted August 2, 2018 In that case try this: Replace: $slicks[] = array('image' => $product_info['products_image'], 'htmlcontent' => null ); with: $slicks[] = array(); on line 42 oscMarket 1 Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
♥clustersolutions Posted August 2, 2018 Share Posted August 2, 2018 @Bobber , I hope no one minds me tell you this. @oscoMMarket had shared with me that his posts are being moderated from this point forward. So, I think be patience and if he had responded it may take a while for it to become available. Bobber and oscMarket 1 1 Quote Link to comment Share on other sites More sharing options...
Bobber Posted August 2, 2018 Author Share Posted August 2, 2018 (edited) 17 minutes ago, frankl said: In that case try this: Replace: $slicks[] = array('image' => $product_info['products_image'], 'htmlcontent' => null ); with: $slicks[] = array(); on line 42 Thank you for the help @frankl! This results in: Quote Parse error: syntax error, unexpected '$Qslick' (T_VARIABLE) in /home/public_html/includes/modules/content/product_info/cm_pi_slick.php on line 43 This add-on is a great update... displaying the "main image" really stinks 😕 Attached #1 is the default add-on... ( displays the "main image"... ). Attached #2 is based off your suggestion with: Quote $slicks[] = array('' => null ); Attached #3 is what I am working towards 🙂 Edited August 2, 2018 by Bobber Quote Link to comment Share on other sites More sharing options...
Bobber Posted August 2, 2018 Author Share Posted August 2, 2018 7 minutes ago, clustersolutions said: @Bobber , I hope no one minds me tell you this. @oscoMMarket had shared with me that his posts are being moderated from this point forward. So, I think be patience and if he had responded it may take a while for it to become available. Thank you @clustersolutions! I have sent him a message... Quote Link to comment Share on other sites More sharing options...
♥frankl Posted August 2, 2018 Share Posted August 2, 2018 I haven't played with this addon, I'm merely relaying a message. What happens if you comment out that line entirely? oscMarket 1 Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
♥clustersolutions Posted August 2, 2018 Share Posted August 2, 2018 Ah...hello...you can't have such associative array... 21 minutes ago, Bobber said: $slicks[] = array('' => null ); This is ok. $slicks = []; This append to the array.. $slicks[] = []; I would just comment out those lines and see what happens. Yeah, I took one look at the stock image gallery and went to bxslider and never looked back... Quote Link to comment Share on other sites More sharing options...
Bobber Posted August 2, 2018 Author Share Posted August 2, 2018 I want to Very Much Thank: @frankl @clustersolutions @oscoMMarket Below is the complete code solution... should anyone else ever need this solution in the future: <?php /* osCompose, E-Commerce Solutions https://oscompose.com Copyright (c) 2018 osCompose Contact: Henry Withoot Email: osc2nuke@gmail.com */ class cm_pi_slick { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_PI_SLICK_TITLE; $this->description = MODULE_CONTENT_PI_SLICK_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_PI_SLICK_STATUS') ) { $this->sort_order = MODULE_CONTENT_PI_SLICK_SORT_ORDER; $this->enabled = (MODULE_CONTENT_PI_SLICK_STATUS == 'True'); } } function execute() { global $oscTemplate, $product_info; $content_width = (int)MODULE_CONTENT_PI_SLICK_CONTENT_WIDTH; $slick_width = (int)MODULE_CONTENT_PI_SLICK_WIDTH; $output = null; if (tep_not_null($product_info['products_image'])) { $slicks = []; $Qslick = tep_db_query("select image, htmlcontent from products_images where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); while($Qresult = tep_db_fetch_array($Qslick)){ $slicks[] = $Qresult; } $output .= '<div class="col-sm-'.$slick_width.'">'; $output .= ' <section class="slider-for slider">'; //Main images and htmlcontent foreach($slicks as $slick){ if(tep_not_null($slick['htmlcontent'])){ $output .= ' <div class="item"><div class="embed-container"><iframe src="'.$slick['htmlcontent'].'" frameborder="0" allowfullscreen></iframe></div></div>'; }else{ $output .= ' <div class="item">'. tep_image('images/' . $slick['image'], htmlspecialchars($product_info['products_name']), '', '').'</div>'; } } $output .= ' </section>'; //thumbnails $output .= ' <div class="col-sm-10 col-sm-push-1">'; $output .= ' <section class="slider-nav slider">'; foreach($slicks as $slick){ $output .= ' <div class="thumbnail">'. tep_image('images/' . $slick['image'], htmlspecialchars($product_info['products_name']), '', '').'</div>'; } $output .= ' </section>'; $output .= ' </div>'; $output .= '</div>'; } ob_start(); include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__)); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_PI_SLICK_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Slick Gallery', 'MODULE_CONTENT_PI_SLICK_STATUS', 'True', 'Should this module be shown on the product info page?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_PI_SLICK_CONTENT_WIDTH', '4', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gallery Width', 'MODULE_CONTENT_PI_SLICK_WIDTH', '12', 'The width of the gallery itself?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_PI_SLICK_SORT_ORDER', '65', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_PI_SLICK_STATUS', 'MODULE_CONTENT_PI_SLICK_CONTENT_WIDTH', 'MODULE_CONTENT_PI_SLICK_WIDTH', 'MODULE_CONTENT_PI_SLICK_SORT_ORDER'); } } I have tested this on 2.3.4.1 CE and it worked perfectly for me 🙂 Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted April 3, 2019 Share Posted April 3, 2019 On 8/2/2018 at 4:04 AM, Bobber said: I want to Very Much Thank: @frankl @clustersolutions @oscoMMarket Below is the complete code solution... should anyone else ever need this solution in the future: <?php /* osCompose, E-Commerce Solutions https://oscompose.com Copyright (c) 2018 osCompose Contact: Henry Withoot Email: osc2nuke@gmail.com */ class cm_pi_slick { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_PI_SLICK_TITLE; $this->description = MODULE_CONTENT_PI_SLICK_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_PI_SLICK_STATUS') ) { $this->sort_order = MODULE_CONTENT_PI_SLICK_SORT_ORDER; $this->enabled = (MODULE_CONTENT_PI_SLICK_STATUS == 'True'); } } function execute() { global $oscTemplate, $product_info; $content_width = (int)MODULE_CONTENT_PI_SLICK_CONTENT_WIDTH; $slick_width = (int)MODULE_CONTENT_PI_SLICK_WIDTH; $output = null; if (tep_not_null($product_info['products_image'])) { $slicks = []; $Qslick = tep_db_query("select image, htmlcontent from products_images where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); while($Qresult = tep_db_fetch_array($Qslick)){ $slicks[] = $Qresult; } $output .= '<div class="col-sm-'.$slick_width.'">'; $output .= ' <section class="slider-for slider">'; //Main images and htmlcontent foreach($slicks as $slick){ if(tep_not_null($slick['htmlcontent'])){ $output .= ' <div class="item"><div class="embed-container"><iframe src="'.$slick['htmlcontent'].'" frameborder="0" allowfullscreen></iframe></div></div>'; }else{ $output .= ' <div class="item">'. tep_image('images/' . $slick['image'], htmlspecialchars($product_info['products_name']), '', '').'</div>'; } } $output .= ' </section>'; //thumbnails $output .= ' <div class="col-sm-10 col-sm-push-1">'; $output .= ' <section class="slider-nav slider">'; foreach($slicks as $slick){ $output .= ' <div class="thumbnail">'. tep_image('images/' . $slick['image'], htmlspecialchars($product_info['products_name']), '', '').'</div>'; } $output .= ' </section>'; $output .= ' </div>'; $output .= '</div>'; } ob_start(); include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__)); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_PI_SLICK_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Slick Gallery', 'MODULE_CONTENT_PI_SLICK_STATUS', 'True', 'Should this module be shown on the product info page?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_PI_SLICK_CONTENT_WIDTH', '4', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gallery Width', 'MODULE_CONTENT_PI_SLICK_WIDTH', '12', 'The width of the gallery itself?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_PI_SLICK_SORT_ORDER', '65', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_PI_SLICK_STATUS', 'MODULE_CONTENT_PI_SLICK_CONTENT_WIDTH', 'MODULE_CONTENT_PI_SLICK_WIDTH', 'MODULE_CONTENT_PI_SLICK_SORT_ORDER'); } } I have tested this on 2.3.4.1 CE and it worked perfectly for me 🙂 Does this require any thumbnailer plugin like kissitthumbnailer? Quote Link to comment Share on other sites More sharing options...
Bobber Posted April 27, 2019 Author Share Posted April 27, 2019 On 4/3/2019 at 4:37 AM, vampirehunter said: Does this require any thumbnailer plugin like kissitthumbnailer? No it does not... Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted August 2, 2019 Share Posted August 2, 2019 Has anyone managed to get the thumbnails to resize on this? Struggling to work out how to do it. Quote Link to comment Share on other sites More sharing options...
valquiria23 Posted June 5, 2020 Share Posted June 5, 2020 Has anyone managed to adapt this addon to work in Phoenix 1.0.6.0? Quote Community Oscommerce fan You'll find the latest osC community version here. Link to comment Share on other sites More sharing options...
kgtee Posted June 5, 2020 Share Posted June 5, 2020 (edited) 7 hours ago, valquiria23 said: Has anyone managed to adapt this addon to work in Phoenix 1.0.6.0? Hi Val, you may try this Slick_Image_Gallery.zip. It is a pi module The ext\slick directory is not included in the zip package. You can use the same one supplied in the original add-on. Edited June 5, 2020 by kgtee Bobber and valquiria23 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.