4 / 27
Feb 2009

I hope someone can help me.



I am using iWeb '09 and I can put an "add to cart" button on the page using the html snippet widget and it works great. But when I put the "View Cart" button on the page using the html widget it does't work. When I publish the page you can see the "View Cart" button but when I click on it, it goes blank and nothing happens.



Any ideas?

  • created

    Feb '09
  • last reply

    Nov '10
  • 26

    replies

  • 3.9k

    views

  • 8

    users

  • 13

    links

<div class="com-apple-iweb-widget-HTMLRegion" id="widget1" style="height: 23px; left: 577px; opacity: 1.00; position: absolute; top: 21px; width: 87px; z-index: 1; ">

<script type="text/javascript"><!--//--><![CDATA[//><!--

var widget1_htmlMarkupURL = ".//Welcome_files/widget1_markup.html";

//--><!]]></script>

<div id="widget1-htmlRegion" class="html_region_widget"></div>

</div>

<script type="text/javascript"><!--//--><![CDATA[//><!--

new Paste('widget1', 'Scripts/Widgets/HTMLRegion', 'Scripts/Widgets/SharedResources', '.', {"emptyLook": false});

//--><!]]></script>

</div>



After looking at the code as suggested in other postsfor iweb '08 I couldn't find any iframes. iWeb '09 seems to put your "view cart" button in in a separate file widget1_markup.html. Any thoughts? If I wanted to have it work like "add to cart" can I and how would I do that? I am not an html or java script programmer.

Hm, so iWeb09 may not be using iframes per-se anymore, but the effect is the same -- HTML code snippets are getting saved to a separate file rather than inserted directly into the raw page source of the main page itself. To help you work around this issue, the advice in this post should still be relevant:

http://www.e-junkie.com/bb/topic/2999#post8354

Tyson,



Thanks for getting back to me. I tried that solution in the post yesterday but the problem is that iWeb '09 puts your snippets in a separate file and then calls the file (see the code in previous post.) So in the page folder there is a widget2_markup.html file the contains your code for the "add to cart" button, it is called from within the page and works great. It also create a file widget1_markup.html with your "view cart" code and calls it from with in the page (see the code above) but it doesn't work like I stated before. There is no way to put the "XXXXXX" like you suggested because it is just placed in the widget1_markup.html file so the page can call file!



Help!?!

You would type the placeholder text XXXXX right there in the visible page in iWeb where you want the button to appear, not using snippets or widgets or anything, just however you would normally type regular text to appear in the main page body. If iWeb'09 doesn't allow you to enter any text in the main page directly and instead just puts everything you type into a page as some sort of external file, then you will need to find some other way of marking a placeholder which you can find in the raw source code later. Then after you save the page in iWeb, you would use a completely separate plaintext-editor program (like the free TextWrangler app) to open the page file as raw HTML code, find the placeholder, and replace that with our View Cart button codes. At least you only need one View Cart per page!



As another alternative, you can split your View Cart code into two parts like so:



<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&cl=49949&ejc=2" target="ejejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img src="http://www.e-junkie.com/ej/ejview_cart.gif" border="0" alt="View Cart"/></a>



<script language="javascript" type="text/javascript">

<!--

function EJEJC_lc(th) { return false; }

// -->

</script>

<script src='http://www.e-junkie.com/ecom/box.js' type='text/javascript'></script>



The first half of that (from <a href=... to </a>), you can insert as a snippet just like you did with the Add to Cart buttons. Then after you save your pages in iWeb, you will need to open each of your main pages in TextWrangler, and just after the part at the top that says <head>, you should paste in the second half of the code shown above (from the first <script... to the last </script>).

Tyson,



Thanks for the advise. I tried your last suggestion and it works great for what I need to do. It would be nice if there was a more elegant solution to the problem I hope you guy will get a copy of iWeb and try to figure it out. That being said your doing a good job.



Note: I put the view cart widget at the bottom of my side bar on my main template so I only had to make the code change once in my document. I then copy the template every time I make a new page.



Thanks again,



Miken

i split up the code as indicated above by Tyson- the add to cart and view cart buttons now work but open in a new window. How do I get them to pop up/overlay on the page? Using iWeb '09/Firefox on an Intel iMac.

First, make sure you are using your own View Cart code -- the example above referred to that specific Seller's cart.



Make sure you are using the standard JavaScript version of our button code -- i.e., make you you have NOT unchecked the box to remove JS from the code in your Get Button Codes screens.



Your browser must also have JS enabled for the overlay cart to work, otherwise it will fallback to work in popup mode for you, and the page must be "live" on the Web (it will not work in a local preview mode).



If this advice does not resolve the matter for you, please reply with the URL of your site, so we can have a look for ourselves to see what might be going on in your code.

I made the page in iWeb 09 and used some characters as placeholders where the buttons would go. I published the files to a folder and edited the html file for the page, replacing the characters with the button code from e-junkies. It seems to be working now. It would be great if there were an easier solution that would work through iWeb. I suppose this would require studying how iWeb '09 writes HTML which is way beyond my ability level. If you guys ever figure anything like this out, please let me know!

Hi Tyson,



I followed your suggestion for my iWeb '09 page of splitting my view cart code into two parts. Everything is working fine, except that the cart is not overlayed on my website. It is instead opening in a separate window. Java is enabled on both my web browser, as well as the code I'm getting from you guys.



My website isnt complete, as I am just uploading it to check how things work, but you can go to it at: www.wushusilks.com



If you click the picture on the home page and then click the top left picture on the second page...it will take you to the page where the 'add to cart' and 'view cart' buttons are.



If you have any suggestions, I'd really appreciate the help!



Thanks

Adam

Adam, I have found that the following works extremely well:



on your iWeb page, place a TEXT BOX with some text in it- a code word that you know appears nowhere in the page, such as VIEWCARTGOESHERE or something. Everywhere you want the View Cart button add this text box. Text box should be the size of the button. Do this for other e-junkie buttons you want, and just change the code name. you can use, forexample, ADDCARTBUTTON1 or whatever you like. Publish your pages to a folder.



Download a program called MassReplaceIt 1http://www.hexmonkeysoftware.com/1



Launch MassReplaceIt and configure as follows:



MASK TAB>ADD Extension is .html and select radio button for "all criteria"

OPTIONS TAB>Check Serach:Contents, Location:Entire File/filename, Options Case Sensitive, Search whole words only

OPTIONS TAB>OPEN PREFERENCES>GENERAL>check add items to the front search, add the folder, search the folder's name and contents, ignore invisible files, apply mask when searching begins.



Then go to the Find TAB and enter your code word that you used (VIEWCARTGOESHERE). Then under Replace copy the html code that e-junkie provides you. Repeat this process for all buttons on your iweb pages.



Then under the FILES tab, add the files from your published folder. Then click Replace.



Mass ReplaceIt will search all the files you add for the code words and replace the code words with the html code. You can save the query for using later. I currently have one query with all my buttons programmed in to find and replace. Every time I publish my site I just run MassReplaceIt and it puts all the right html code in for me. Since it saves the query including which files it looks at, it's pretty automated. If you have questions, just ask. Hope this helps.

monkeymanAdam, I have found that the following works extremely well:







Monkeyman,



Thank you so much for your help! It now works perfect. I really appreciate your thorough advice. Haha...I'm super excited it works!

Cool. Glad it worked. When I discovered that I was also very excited. It only takes seconds to process the whole site and fix the html. You can do the same thing to program rollovers or any other feature that iWeb won't play nice with when you try to put an html widget in.

BTW, this technique should really only be necessary with our View Cart code.



Last I was aware, iWeb's HTML Snippet widget should work fine with the Add to Cart code, unless something has changed with iWeb09 where it now puts all snippets into a separate file with an iframe instead of just doing that only to snippets that contain JavaScript (which was always the problem with our View Cart code in iWeb previously).

from my experience i have had to do it with all e-junkie html codes, not just view cart. iweb 09 puts everything in separate html files called widget01.html or something. it's not a bad deal to add the text placeholder and replace it later with MassReplaceIt actually. Better than having to learn html and javascript, IMO. :slight_smile:

2 months later

I like that i can fix this on my own using MassReplaceIt, but why am i paying for a service that does not suite the needs of my website... it is allot of extra steps just to put a cart button on the page... It is semi automated, but i still need to save/publish to file first, MRI the file, then republish on line... then go make sure it workeded... It really would be great if the the cart button just worked... is this being loooked into?

It is simply an inherent problem with the way that iWeb functions when you paste-in code snippets. The cart button does "just work", but only if you can paste the ready-made HTML code for your buttons directly into the raw HTML of your page source.



Most other Web design software provides some method to accomplish this, but Apple apparently thinks that their target iWeb users don't have any need to directly access the HTML code that iWeb is generating for them. It would certainly be nice if Apple provided a built-in way to directly edit the raw HTML of a page from within iWeb itself, but they haven't seen fit to add such a feature in several successive revisions of iWeb, and we have no control over how Apple chooses to design their iWeb program.

thanks for the explination. although, how is it the add to cart works, but the veiw cart does not... I read earlier that it could be how it is stored. They are in essence the same thing, i would think... I just don't understand that if one works why the other does not...

It's because the View Cart code contains some javascript, and that causes iWeb to store the snippet in a completely separate file (which would then get displayed in a tiny, button-sized iframe embedded in the page) rather than putting the code snippet directly in the main page itself.



Because the View Cart code must be pasted into the main page source directly to generate our nice cart overlay in front of your page content, putting the View Cart code in an separate iframe file means the Add to Cart code can't call those overlay functions to display the cart in that manner, so clicking Add to Cart works in fallback mode to open the cart in a new popup window. Clicking View Cart does display the overlay cart, but it's trapped inside that tiny, button-sized iframe where it winds up being totally useless (this is why the View Cart button seems to "disappear" when you click it -- it's actually a button-sized glimpse of the cart overlay covering up the button image inside the iframe :^).

1 year later

Hi E-junkieGuru (or any other tech guy),



I'm trying to use the "replace XXXX placeholder text with View Cart button code" as described above, but it doesn't seem to be working for me. The placeholder text does get replaced with the View Cart button, but the Add Cart buttons still generate the opening of a separate window, and the View Cart button, even though it does generate an overlay, always shows an empty cart, even if you've put stuff in the cart using the Add Cart buttons.



The test page I'm referring to is:



http://www.olliesoutbacknuggets.com.au/Ollies1Outback_Nuggets/test3.html



Are you able to take a look and see what might be going on? The workaround seems to have worked for others above, and I'm using iWeb '09 as they are. Any help would be much appreciated.