Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Jssor Slider


Recommended Posts

I have noticed someting strange in the transitions loop (in the 3rd case) :
1. If you check no transition (in admin), "default" transition (slide right to left) loops at each slide -> OK
2. If you check just one transition, the chosen transition loops at each slide -> OK
3. If you check at least two transistions, the slide loop is interspersed with "default" transition at each new transition -> !?!

For example, in fact it shows :

1.bounce_down -> 0."default" -> 2.clip_and_chess_in -> 0."default" -> 1.bounce_down -> 0."default" -> 2.clip_and_chess_in -> 0."default" -> and so on

Is there a way to have the true sequence - 1 -> 2 -> 1 -> 2 - without the default transition between ?

NB: This is the puzzle of this end of the year, enjoy ! :D

 

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Link to comment
Share on other sites

Sorry, the right sequence is :
1.bounce_down -> 0."default" -> 2.clip_and_chess_in -> 1.bounce_down -> 0."default" -> 2.clip_and_chess_in -> 1.bounce_down -> 0."default" -> and so on

And for 3 transitions checked :
1 -> 0 -> 2 -> 0 -> 3 -> 1 -> 0 -> 2 -> 3 -> 1 -> and so on


 

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Link to comment
Share on other sites

4 hours ago, milerwan said:

Is there a way to have the true sequence - 1 -> 2 -> 1 -> 2 - without the default transition between ?

I don't know the answer to that and would have to spend time figuring it out, which means it probably won't be done anytime soon. I suggest asking on stackoverflow or checking the examples at jssor.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Ok, the issue comes from double comma generated by script instead one :

[
{$Duration:1000,y:1,$Easing:$Jease$.$InBounce,$Opacity:2}
,, <!-- comma too much -->
{$Duration:1200,y:-1,$Cols:10,$Rows:5,$Clip:15,$During:{$Top:[0.5,0.5],$Clip:[0,0.5]},$Formation:$JssorSlideshowFormations$.$FormationStraight,$ChessMode:{$Column:12},$Opacity:2,$ScaleClip:0.5}
, <!-- comma too much -->
]

I will fix this later.
Need to go now.  ;)

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Link to comment
Share on other sites

It's ok, I found where the creation of the unwanted comma is.

In "includes/modules/content/index/templates/tpl_cm_i_jssor.php" (same for "/header/templates/tpl_cm_header_jssor.php"), find :

function GetTransitions() {
    $picked = explode(';', MODULE_CONTENT_INDEX_JSSOR_TANSITIONS);
 
    $xsisitons = array();
    $xit = parse_ini_file(DIR_FS_CATALOG . '/ext/jssor/transitions.ini');
    foreach ($xit as $key => $data) { 
        if (in_array($key, $picked)) {
            $xsisitons[] = $data  .','; 
        }
    } 
    
    return '[' . join(',', $xsisitons) . ']';
}

and change like this :

function GetTransitions() {
    $picked = explode(';', MODULE_CONTENT_INDEX_JSSOR_TANSITIONS);
 
    $xsisitons = array();
    $xit = parse_ini_file(DIR_FS_CATALOG . '/ext/jssor/transitions.ini');
    foreach ($xit as $key => $data) { 
        if (in_array($key, $picked)) {
//            $xsisitons[] = $data  .',';
            $xsisitons[] = $data; 
        }
    } 
    
    return '[' . join(',', $xsisitons) . ']';
}

No more "default" transition parasite during the slider loop now. :)

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Link to comment
Share on other sites

  • 2 weeks later...

The code uses the link function in oscommerce to build the link so that the session ID is not lost. To have it use an external link, make these changes in the jssor template file for the module you are using (header or index):

Find

$banner_query = tep_db_query("select banners_id, 

and change to

$banner_query = tep_db_query("select banners_id, banners_title,

Then find

           $urlArray[] = tep_href_link($banner['banners_url']);

and replace with

           if (strpos($banner['banners_url'], 'https') === FALSE) {
              $urlArray[] = tep_href_link($banner['banners_url']);
           } else {
              $urlArray[] = '<a href="' . $banner['banners_url'] . '">' . $banner['banners_title'] . '</a>';
           }  

I haven't tested it but it should work.  If the external site doesn't use http then you will need to change the above to test for that or, better, test for both.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...
On 12/21/2018 at 9:36 PM, osComMarket said:

Start use: http://kenwheeler.github.io/slick/
All the rest becomes not-necessary, and is easy to code upon-on.

Hi Henry, I did not understand what it is. Can you explain a little more so mortals understand?

Best regards

Valqui

:heart: Community Oscommerce fan :heart: You'll find the latest osC community version here.

 

Link to comment
Share on other sites

  • 1 month later...

@Jack_mcs   I installed this yesterday on the latest Frozen (Github) release and it works beautifully.  I wondered if it's possible for the slider to appear on all the store pages?  Let me explain why I ask that:  I know that some shopping cart software is meant to integrate into your existing web design (Stiva, for instance) and others are more or less stand-a-lone.  Because of this, I am doing my best to slowly customize the osCommerce storefront to look as similar to the overall site design as possible.  (I paid a lot of money for Stiva and hate it, compared to osCommerce, so you don't always get what you pay for.)

I notice that the breadcrumbs and the search feature remain on every page.  (I may eventually want to lose those, if my navigation project goes well.)  But can the banner slider also travel with each page or is it bound only to the front index?  Thanks.  😋

Link to comment
Share on other sites

The addon has two modules. One for the header and one for the home (index) page. Both are coded to only work on the index oage. You can change the one for the header to display on every page. To do that,  edit the includes/modules/content/header/cm_header_jssor.php file and change this

       if((basename($PHP_SELF) != 'index.php') || tep_not_null($cPath)){
      $this->enabled = false;
      }else{
      return $this->enabled;

to this

       if((basename($PHP_SELF) != 'index.php') || tep_not_null($cPath)){
      return $this->enabled;
      }else{
      return $this->enabled;

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 months later...

Hi @Jack_mcs really wanted something like this but when I try and install this on my local test store, 2.3.4.1 CE Frozen, I don't see any images at all. The styles, css are all there and if I go into my browser inspector and turn off the visibility:hidden style on the 'slider1 container' then the images appear but no transitions are taking place. I've checked to see if the images and files are in the correct locations, they are.

Any ideas on why the images are not showing? Cheers.

Ah, the world wide web. What a wonderful place.

Link to comment
Share on other sites

@freakystreakWhich module are you using - header or index? Does it fail if you try the other (only one can be enabled)? Does the banner group in the module settings match the banner group in the Banner Manager?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs Thanks for the reply. I've tried both versions. Neither show. Yep checked the banner group and they do match, not changed it in the app and made sure the new banners were named the same ' slider'. As I said, if I look chrome inspector, I can see the images there. I just get a blank space where the slider images should be as well as where the icons should be.

 

Ah, the world wide web. What a wonderful place.

Link to comment
Share on other sites

@freakystreakThe next version (not released yet) has a change for the images. That might fix it though it. In the modules, find

$banner_query = tep_db_query("select banners_id, banners_url, banners_image, banners_html_text from banners  where
                       banners_group = '" . MODULE_CONTENT_INDEX_JSSOR_SLIDER_GROUP . "' and status = 1");
                
if (($cnt = tep_db_num_rows($banner_query)) > 0) {
    while ($banner = tep_db_fetch_array($banner_query)) {
        if (tep_not_null($banner['banners_html_text'])) {
            $imgArray[] = $banner['banners_html_text'];     
        } else  { 
        $imgArray[] = tep_image('images/' . $banner['banners_image'], $banner['banners_html_text'], '','','u="image"');
        }
        if (tep_not_null($banner['banners_url'])) {
        $urlArray[] = tep_href_link($banner['banners_url']);
        } else {
            $urlArray[] = '#';
        } 
    }
} 

and replace it with

$txtArray = array();
$banner_query = tep_db_query("select banners_id, banners_url, banners_image, banners_html_text from banners  where
                       banners_group = '" . MODULE_CONTENT_INDEX_JSSOR_SLIDER_GROUP . "' and status = 1");
                
if (($cnt = tep_db_num_rows($banner_query)) > 0) {
    while ($banner = tep_db_fetch_array($banner_query)) {
        if (tep_not_null($banner['banners_image'])) {
            $imgArray[] = tep_image('images/' . $banner['banners_image'], $banner['banners_html_text'], '','','u="image"');
            $txtArray[] = $banner['banners_html_text'];
        } else  { 
            $imgArray[] = $banner['banners_html_text'];     
        }
        if (tep_not_null($banner['banners_url'])) {
        $urlArray[] = tep_href_link($banner['banners_url']);
        } else {
            $urlArray[] = '#';
        } 
    }
} 

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks mate for the suggestion but replaced the code in the two modules and sadly still doesn't show. I think will try the app on a fresh install just in case it's one of the modules I have installed, although I haven't got much on there. If think of anything then please let me know. Thanks.

Ah, the world wide web. What a wonderful place.

Link to comment
Share on other sites

@freakystreakThe only other thing I can think of is that the javascript file wasn't uploaded in the ext directory. I don't use Chrome but it should show that the file wasn't loaded in the developer tools section if that is the case. Does the module settings in admin show the various effects? It loads them from a file in ext so if they are there, the javascript file probably is to but it would be worth checking.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I can't think of anything else that might cause it. I've installed it into a number of shops and never had any issues so I can only assume it is something in your shop. Doing an install into a fresh shop as you mentioned is the best thing to try.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs just to let you know mate that I tried your add-on in a fresh install and it's working fine. I will now have to go through my add-ons and find the culprit. Thanks for you help. Excellent add-on may I add.

Ah, the world wide web. What a wonderful place.

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