Announcement

Collapse
No announcement yet.

Mini-basket on static pages

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

  • AHerb
    replied
    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.

    Leave a comment:


  • lesliekirk
    replied
    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?

    Leave a comment:


  • AHerb
    replied
    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.

    Leave a comment:


  • Kent Multer
    replied
    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 --

    Leave a comment:


  • lesliekirk
    started a topic Mini-basket on static pages

    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?
Working...
X