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?
Announcement
Collapse
No announcement yet.
Mini-basket on static pages
Collapse
X
-
Mini-basket on static pages
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Tags: None
-
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
-
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 PostThere 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.
How would the custom page be displayed in an HTML page?Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: 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?
Create a new custom page TEST2 with the content like...
Code:$23.00
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>
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
Comment