The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #11  
Old 10-04-2010, 06:27 PM
Qetzal's Avatar
Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default


Quote:
Originally Posted by zmcqueary View Post
Ok, so no matter which I use, '<?php the_permalink() ?>#ecwid:mode=cart' or '#ecwid:mode=cart', I get a null. When I display it, I get a blank box. The link in my source code gives the correct format and everything though. Does it have something to do with where the script is located on the page?
Hmm, try to create an iframe dynamically, using Javascript.
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #12  
Old 10-04-2010, 09:37 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

Ok, call me crazy, but I'm trying to utilize jQuery's .load function to not only pull the page, but do away with everything else after the div element is found, then push to the desired element, in this case, a div.shipcounter:

$('#shipcounter').load('<?php the_permalink() ?>#ecwid:mode=cart #ecwid-productBrowser-cart-totalAmount');

Any ideas?
Unfortunately, I'm not able to make this work, either!

UPDATE: I think I'm getting close though, instead of the 'test' text I put in the #shipcounter <div>, I'm now getting a blank <div>, though the source tells me that 'test' is there (??)

Last edited by zmcqueary; 10-04-2010 at 09:47 PM.
  #13  
Old 10-05-2010, 03:14 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by zmcqueary View Post
Ok, call me crazy, but I'm trying to utilize jQuery's .load function to not only pull the page, but do away with everything else after the div element is found, then push to the desired element, in this case, a div.shipcounter:

$('#shipcounter').load('<?php the_permalink() ?>#ecwid:mode=cart #ecwid-productBrowser-cart-totalAmount');

Any ideas?
Unfortunately, I'm not able to make this work, either!

UPDATE: I think I'm getting close though, instead of the 'test' text I put in the #shipcounter <div>, I'm now getting a blank <div>, though the source tells me that 'test' is there (??)
Try this code instead:

HTML Code:
<script>
     var tempIFrame=document.createElement('iframe');
     tempIFrame.setAttribute('id','special_iframe');
     tempIFrame.style.border='0px';
     tempIFrame.style.width='0px';
     tempIFrame.style.height='0px';
     IFrameObj = document.body.appendChild(tempIFrame);
     IFrameObj.src = "http://SOME_URL_HERE";
     alert(IFrameObj.innerHTML);
</script>
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #14  
Old 10-05-2010, 03:26 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

Its throwing me an error message on the iframe script:

uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLIFrameElement.src]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: http://www.zachmcqueary.com/clients/...ibutor-program :: <TOP_LEVEL> :: line 693" data: no]

My code:
var tempIFrame=document.createElement('iframe');
tempIFrame.setAttribute('id','special_iframe');
tempIFrame.style.border='0px';
tempIFrame.style.width='0px';
tempIFrame.style.height='0px';
IFrameObj = document.body.appendChild(tempIFrame);
IFrameObj.src = "<?php the_permalink() ?>#ecwid:mode=cart";
alert(IFrameObj.innerHTML);

Even tried taking out the PHP, same error.
  #15  
Old 10-05-2010, 03:34 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

It must be something to do with the url I'm providing. When I throw something like, http://www.google.com, the alert comes up. However, it comes up blank.

UPDATE: I think I may have it working, I had to set a parameter for the URL because the iframe is bring loaded from the same URL, i.e. http://www.mysite.com > iframe http://www.mysite.com#ecwid:mode=cart. So I added ';' :

IFrameObj.src = "<?php the_permalink() ?>;#ecwid:mode=cart";

Now it throws the alert, but still blank(?)

Last edited by zmcqueary; 10-05-2010 at 03:43 PM. Reason: UPDATE:
  #16  
Old 10-08-2010, 02:07 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

Any other ideas? I'm really trying to push this module in before going live. I'm still getting blank fields, even though my Firebug is telling me its getting on the GET a 200 OK, but it keeps saying 'document.getElementById("ecwid-productBrowser-cart-totalAmount") is null' (?)

Code:
$('#shipcounter').load('#ecwid:mode=cart #ecwid-productBrowser-cart-totalAmount');
document.getElementById('shipcounter').innerHTML = document.getElementById('ecwid-productBrowser-cart-totalAmount').innerHTML;

Do I have to define the _parent or _child document? If so, how?

UPDATE: Ok, so if I bypass the jQuery code and try just javascript, the iframe doesn't seem to work. I can't load the whole page again, otherwise I just get caught in a loop. So instead, I try what you suggested and just use:

<IFRAME id="thisframe" src="#ecwid:mode=cart"></IFRAME>

When its tested, though without 'display:none;', I get nothing. I am trying to pull the contents using this function:

<script type="text/javascript">
$('#shipcounter').load('health_products#ecwid:mode =cart #ecwid-productBrowser-cart-totalAmount');
document.getElementById('shipcounter').innerHTML = document.getElementById('ecwid-productBrowser-cart-totalAmount').innerHTML;
alert('Finish');
</script>

Also, I get this error:

[Exception... "Cannot convert WrappedNative to function" nsresult: "0x8057000d (NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN)"

..and says the 'document.getElementById("ecwid-productBrowser-cart-totalAmount") is null'

Last edited by zmcqueary; 10-08-2010 at 06:02 PM.
  #17  
Old 10-08-2010, 06:49 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

Ok, totally forgot to practice what I preach

Apparently, I left out the parameter (';') in my URL since I'm referncing the same domain as the parent.

NOW!...I'm able to dynamically create the iframe WITH the '#ecwid:mode=cart' Open Bag window, but how can I reference an element contained WITHIN the ecwid module? No matter what I do, I can't identify that 'ecwid-productBrowser-cart-totalAmount' <div> because its not actually ON the source page....make sense?
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:24 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.