Announcement

Collapse
No announcement yet.

Mini-basket on static pages

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

  • Mini-basket on static pages

    Store owner wants to be able to display the dynamic mini-basket on HTML and PHP pages. Current the Global Header consists of a couple div tags and coding to pull in a text file with all the Global Header content. This same file is pulled into the static HTML pages and the PHP pages that are part of this site. Could this be done using an iframe?
    Leslie Kirk (aka Leslie Nord leslienord)
    Miva Merchant Certified Developer
    Miva Merchant Specialist since 1998
    Previously of Webs Your Way

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter Twitter Twitter Twitter | Facebook | FourSquare | Pinterest | Flickr

  • Yes, you should be able to put an iframe on a non-Miva page that will pull in some content from a merchant.mvc URL. Then you create a custom page on the store, which will deliver the mini-basket content in the format that you want. You may need to include the session ID in the iframe URL, or this might get handled automatically by the cookies in the customer's browser; I'm not sure about that part.

    HTH --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


    • There is a potential problem with an iframe: you may have too many products in the basket and you'll have some products hidden or you'll have to enable scrolling (which doesn't look good).
      Alternative option is to create a custom page which returns required content in a json format and output the data on the client's front-end.

      Comment


      • Originally posted by AHerb View Post
        There is a potential problem with an iframe: you may have too many products in the basket and you'll have some products hidden or you'll have to enable scrolling (which doesn't look good).
        Alternative option is to create a custom page which returns required content in a json format and output the data on the client's front-end.
        Of course, that is the down side to using an iframe. In the case of this store, the only thing from the being passed on is the quantity in the basket.

        How would the custom page be displayed in an HTML page?
        Leslie Kirk (aka Leslie Nord leslienord)
        Miva Merchant Certified Developer
        Miva Merchant Specialist since 1998
        Previously of Webs Your Way

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter Twitter Twitter Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment


        • Originally posted by lesliekirk View Post

          Of course, that is the down side to using an iframe. In the case of this store, the only thing from the being passed on is the quantity in the basket.

          How would the custom page be displayed in an HTML page?
          It's up to you: to display the entire custom page content or use the content as some variables to fulfill the current page.

          Create a new custom page TEST2 with the content like...
          Code:
          $23.00
          Create another test page TEST:

          Code:
          <button id="get-custom-content">Get the custom content</button>
          <div id="custom-page-content"></div> 
           <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript">
              $("#get-custom-content").click(function(){
                  $.ajax({url: "/mm5/merchant.mvc?Screen=TEST2", success: function(result){
                      $("#custom-page-content").html(result);
                  }});
              });    
          </script>
          Make sure the url: "/mm5/merchant.mvc?Screen=TEST2" points directly to your TEST2 screen
          Now open your TEST Screen and you should see the button, which will download the content of the TEST2 when you click on it without re-loading the page.

          Comment

          Working...
          X