I am wanting to use the Detailed Shopping Cart view found at /OrderRetrievev2.aspx to display instead of the Shopping Cart Summary {tag_shoppingcartsummary}.
The idea is that as a user shops they can see a full list of what is in their shopping cart and remove items or go straight to checkout, effectively bypassing a whole page.
I have read that you can do it using jQuery .load() or through Ajax. Does anyone have further information on how I can implement something like this on my site?
Cheers in advance!
I maybe need to make myself clearer.
On all the shop pages I have a content holder that I would like to display the entire content of the Shopping Cart (as seen on /OrderRetrieveV2.aspx) This way I don't need to use the shopping cart summary tag as the detailed view is already there. So instead of the user clicking "View Cart" (as that is what appears on the summary tag) then being directed to the detailed view, they can "Checkout" (as the detailed view is already being displayed)
Ended up doing it using iFrames and the following code:
<script type="text/javascript">
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexO f("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
<iframe id="myframe" src="/OrderRetrievev2.aspx?CatalogueID=0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" vspace="0" hspace="0" style="width: 100%; overflow: visible; display: none;"></iframe>
Works great!
This is one of the things that Business Catalyst should have already. It makes me upset that this feature is unavailable and you need to write a ton of JavaScript just to emmulate a shopping cart that displays products on a template. This type of shopping car or "quick cart" is popular with many eCommerce websites. Why not with BC?
During searching, how to implement showing the shopping Cart in some other pages, I found this threat...
Do you have some more Informations, how to implement this in my page?
I am new to AJAX, so what do I have to write, instead of myframe1, myfram2 and so on.
Just want to show the full shopping cart.
How Can I display the shopping cart in some page?
Do I had to do something else?
Thanks a lot.
Yun, Jin-Ho
ok, I found two things I changed to make this working.
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexO f("Firefox")).split("/")[1]
Delete the Space beetween "indexO" and the "f" and add a space behind It.
For some reason, i dont know why, this Editor can not corretly display this.
In this Line :
<iframe id="myframe" src="/OrderRetrievev2.aspx?CatalogueID=0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" vspace="0" hspace="0" style="width: 100%; overflow: visible; display: none;"></iframe>
delete : display:none
Now it adjust the high and shows me the content of the cart.
North America
Europe, Middle East and Africa
Asia Pacific