Announcement

Collapse
No announcement yet.

Edit Attributes on Basket

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • fastees - I do not there there would be an issue adding this to the Levels ReadyTheme.
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • I'm trying to implement this on the Suivant ReadyTheme but no modal pops up. Any help would be greatly appreciated

      Comment


      • I have not tried this, so I can not say for sure - but a quick review shows this code is from 2015. There have been many changes to Miva in the last 3-4 years, so I suspect it is simply old code. You will likely need to work thru it and update where needed.
        William Gilligan - Orange Marmalade, Inc.
        www.OrangeMarmaladeinc.com

        Comment


        • I actually stumbled across this thread https://www.miva.com/forums/forum/on...at-basket-page

          Looks like its definitely old code here. There is a link in there for a how to pdf and a link to a live working version of this functionality. Pretty slick.

          Just thought this might be helpful for anyone who comes to this thread first.

          Comment


          • Note: that coding does have a couple of things to watch out for. If you have a text, textarea, or checkbox option the Edit process will break. This is because Miva doesn't track a 'non-selection'. Meaning that, if you have a [ ] Supersize me option, that is not checked, nothing is recorded in the basket database for that attribute which breaks the pseudo array you create to reload the attributes.

            There are workarounds. Make use radio buttons for checkbox options. For example, Supersize Me: o Yes o No. This has the benefit of recording the actual state in the basket for the user (e.g., it clearly shows they didn't select 'supersize'. You can also use a bit of jQuery to make the "radio" option appear as a checkbox. As for text and textarea options, you can use jQuery to insert "none" or some other text to populate that options data set. Again, this has the benefit of clearly stating use intention. For example, inserting "none" in a text area for 'gift message'.

            Here's the jQuery to populate a textarea on submit if its empty:

            Code:
            <script>
            jQuery(document).ready(function()
            {
            jQuery('.showselval').on('click',function()
            {
            var boxId='attr-'+jQuery(this).attr('data-attribute');
            jQuery('#'+boxId).html(jQuery(this).attr('data-attribute-name'));
            });
            jQuery("#addToCart").on('click',function()
            {
            var giftMessage = jQuery("#l-gc-message").val();
            if (!giftMessage) {
            jQuery("#l-gc-message").val("(none).");
            }
            });    });
            </script>
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment

            Working...
            X

            This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

            This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

            Accept