Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

BS Slick Image Gallery Question - 2.3.4.1 CE Compatible Image Gallery Module for Product Info


Bobber

Recommended Posts

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!

Link to comment
Share on other sites

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 54

Warning: Illegal string offset '' in /home/public_html/includes/modules/content/product_info/cm_pi_slick.php on line 57

Warning: Illegal string offset '' in /home/public_html/includes/modules/content/product_info/cm_pi_slick.php on line 66

 

Link to comment
Share on other sites

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 🙂

Capture.JPG

Capture2.JPG

Capture3.JPG

Edited by Bobber
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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...

 

 

Link to comment
Share on other sites

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: [email protected]
*/

  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 🙂

Link to comment
Share on other sites

  • 8 months later...
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: [email protected]
*/

  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? 

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...
  • 10 months later...
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 by kgtee
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...