Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2.3.4 BS GOLD Sticky Add To Cart Content Module


Recommended Posts

@@greasemonkey - it's a really good idea...

Problems to think about;

1. products with options/attribs
Viewer might be way down the page, having not selected the options/attribs he wants to buy. If he presses buy button, default attribs are added to cart.
Possible Solution: enforce "please select" and "required" on the attribute dropdowns. I think that would be cool anyway for all shops.

2. quantity box
I'm guessing you have a mechanism in your site to pass through quantity to the add to cart functionality.
Core doesn't have it...

3. It doesn't seem to want to responsively resize
I cant' see why, I will do some more experimenting. Then again I don't suppose this really matters as users will not be resizing windows like we do to test things.

 

4.  When the module overlays the Footer, it goes weird.

Solution:  Add z-index: 100; to the css change..
 

Cool  :pray:

Link to comment
Share on other sites

I didn't test this  but it seems like it would work

<script>
$(function() {
    var $affixElement = $('div[data-spy="affix"]');
    $affixElement.width($affixElement.parent().width());
    
    var styles = {
      position : "fixed",
      bottom: "10px"
    };
    $( '.affix' ).css( styles );
});
</script>

Matt

Link to comment
Share on other sites

@@burt

 

 

3. It doesn't seem to want to responsively resize
I cant' see why, I will do some more experimenting. Then again I don't suppose this really matters as users will not be resizing windows like we do to test things.

 

I forgot to mention.... Apparently .affix does not size well to its parent div (because it's floating in and out of the div maybe???? Its a little beyond my pay grade.... lol.... I'm not sure I understand why).... so JS is the popular solution.

 

There is lots of info out there on the BS forums.

 

And yes, except when a viewport is changed (example... horizontal to vertical) it typically would not require resizing.

Link to comment
Share on other sites

@@mattjt83 @@burt ok I have changed to;

<script>
$(document).ready(function(){

    var styles = {
      position : "fixed",
      bottom: "10px"
    };
    $( '.myAffix' ).css( styles );

    var $affixElement = $('div[data-spy="affix"]');
    $affixElement.width($affixElement.parent().width());    
});
</script>

But it fires immediately.... not at 400 px set here;

<div class="myAffix" data-spy="affix" data-offset-top="400">

Also if I add the

 

z-index : "100", to the var styles it fails.....

 

Any help would be appreciated.....

Link to comment
Share on other sites

After having installed this I had someone check the site and they commented on it looking silly having this on a large screen as it shows before the add to cart has gone off the screen. So I changed

 

<div class="col-xs-12">

 

to

 

<div class="col-xs-12 hidden-lg">

 

Now on large screens it does not show, but does on all others. Hopefully this small changes will be of help to others.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...