Jump to content

Search the Community

Showing results for tags 'sessionstorage'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News and Announcements
  • osCommerce Online Merchant v2.x
    • General Support
    • osCommerce Online Merchant Community Bootstrap Edition
    • Add-Ons
  • Development
  • General
    • General Discussions
    • Live Shop Reviews
    • Security
    • Developer Feedback
  • Club osC's Announcements
  • PayPal's Announcements
  • Sage Pay's Announcements
  • Solomono - new level osCommerce templates's Announcements
  • German Community's OSCOM v2.x
  • German Community's Allgemein

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Real Name


Location


Interests


Website

Found 1 result

  1. hi, I need some help to solve an interesting code logic puzzle with an addon for header scrolling on the product_info.php page. This one: https://apps.oscommerce.com/eZbEr&headerscroll-for-oscv2-3-4-bs-edge This is a module for the product_info.php page where a customer can check the HeaderScroll checkbox and each time they load a product page, that page will load scrolled past the header. This spotlights the product offering with each product view and the customer has full control to enable or disable this feature for their session. ~~~~ What I have not been able to solve is how to set the HeaderScroll checkbox to be enabled (checked) by default when the customer’s session starts. The user’s checkbox input is stored in sessionStorage. I tried the most obvious… setting the checkbox $checked value to true,.. and I tried the same using jQuery on document ready, but with both of these tactics the checkbox only flashes checked for a split second and then applies the unchecked status from sessionStorage. The challenge is to possibly set sessionStorage to have the checkbox enabled, but only on the very first instance (product page visit). Otherwise it will always revert to being checked on each new product page load regardless of the customer’s preferred selection. Here is the jQuery for the sessionStorage part of this feature: // HeadScroll save checkbox state to session $(function(){ $('#scroll').each(function() { var $el = $(this); $el.prop('checked', sessionStorage[$el.prop('id')] === 'true'); }); $('#scroll').on('change', function() { var $el = $(this); sessionStorage[$el.prop('id')] = $el.is(':checked'); }); }); Any help would be greatly appreciated. PS: Please note that this is not a support thread for this addon. I’m just trying to get some assistance to improve it for the osC community.
×