Skip to main content

Bookmarklets for Yahoo Store

I was introduced to "bookmarklets" by my friend, Rob Snell, many years ago at one of the Yahoo Store conferences and they are indispensable tools in my daily work on Yahoo stores.

What are "bookmarklets"?

As the name suggests, bookmarklets are kind of like bookmarks in your browser, except instead of leading to a web page, they execute a small piece of JavaScript code on the current page. This is made possible by the browser's support of the "javascript:" prefix. When you point your browser to a URL, the browser figures out what to do with it: bring up a web page if the address starts with http:// or https://, connect to an ftp site if the address starts with ftp://, or in the case of javascript:, interpret and execute the JavaScript code following the colon.

Typically, bookmarklets are saved either in your Favorites folder or if you use them on a daily basis like I do, in your browser's bookmarks toolbar. In essence, bookmarklets are sort of like browser extensions or browser add-ons, except they don't bloat your browser and take up memory. While extensions load with your browser when the browser starts, bookmarklets only run when you need them and disappear from memory when they are done.

How to create a bookmarklet

Normally, you create bookmarks by clicking the "Add to Favorites" or similar options in your bookmarks menu. This adds the current page to your favorites. However, you can also create a bookmark "manually", by right-clicking your bookmarks toolbar and selecting "Add page..." in Chrome, or "New Bookmark" in Firefox (Microsoft Edge is a bit quirkier in this department, more on that later.)


When you create a new bookmark, the browser will ask you for the name and a location. For name, you just enter whatever you want to call the bookmark. Just as an example, let's enter "Hello". The location field is where the magic happens: there you enter the word javascript: followed by the small piece of javascript code you want the bookmark to execute. Just as a test, enter the following:


javascript:alert("Hello there!")


(After the bookmark is created, you may have to actually drag it to the actual bookmarks toolbar.) Once done, you will see your new bookmarklet on your bookmarks toolbar. If you click it, the browser will bring up a prompt like this:


Ok, not too useful, but you get the idea! Now on to the real useful bookmarks I was talking about. I want to show you five bookmarklets that will make your life editing your Yahoo store easier - guaranteed!

Please note: the following bookmarklets all require you to be logged into your Yahoo store account. If you are not logged in, all these bookmarklets will simply take you to the Yahoo store login page.

Also, one disclaimer: these bookmarklets work by looking at the HTML code of the current page and trying to identify links to the cart page to figure out the store's Yahoo account ID. This works in the vast majority of cases, however, no two custom stores are the same, and yours might have a different way of linking to the shopping cart page. Unfortunately, in such cases, these bookmarklets will not work on your store. At least three out of the five won't. Edit this page and Go to this ID will still work.

1. Go to the Store Manager

When you are viewing any page of your store, clicking this bookmarklet will take you into the Store manager. I call it Y! Mgr just so it doesn't take up much space on the bookmarks bar. Here is the code:

javascript:var%20re%20=%20new%20RegExp('/cgi-bin/wg-order[?]([a-z0-9-]+)');var%20m%20=%20document.body.innerHTML.match(re);%20if%20(m)%20{document.location.href='http://edit.store.yahoo.com/RT/MGR.'%20+%20m[1];}

2. Go to this page in the Editor

This bookmarklet will take you to the same page you are looking at but in the store editor. So you can be browsing your live site, and if you quickly want to go to the editor for the page you are on, simply click this bookmarklet.

Note: for this bookmarklet to work, you have to have been in the editor at least once during your browsing session. Otherwise clicking this bookmarklet will take you into the Store Manager only. Here is the code:

javascript:var%20n%20=%20new%20RegExp(%22/([a-z0-9-]+.html)%22);%20var%20pg%20=%20location.href.match(n);%20if%20(pg)%20{%20target%20=%20'/'+pg[1]%20}else{target=''};%20var%20re%20=%20new%20RegExp('/cgi-bin/wg-order[?]([a-z0-9-]+)');var%20m%20=%20document.body.innerHTML.match(re);%20if%20(m)%20{document.location.href='http://'+m[1]+'.edit.store.yahoosmallbusiness.net/RT/NEWEDIT.'%20+%20m[1]%20+%20target;}

3. Go to this ID

When you are in the store editor, you may want to quickly jump to a page whose ID you know. There are of course a number of ways to do that, for example clicking "Controls" and then Search or Edit by ID, or using the "Find" button. However, with this bookmarklet all you have to do is click while you are on any page of your store. It will prompt you for the ID, and once you enter it, you will be taken to that page.

javascript:(function()%7Bvar%20target%20%3D%20prompt(%22Target%20ID%3A%22)%3Bif%20(target%20!%3D%20null)%20%7Blocation.href%20%3D%20document.URL.substr(0%2Cdocument.URL.lastIndexOf('%2F'))%20%2B%20%22%2F%22%20%2B%20target%20%2B%20%22.html%22%3B%7D%7D)()

4. Edit this ID

Same as "Go to this ID" but it also takes you directly to the Edit form of the target page. So this is a shortcut for going to a page with a given ID and then hitting the "Edit" button once on the page.

javascript:(function()%7Bvar%20target%20%3D%20prompt(%22Target%20ID%3A%22)%3Bif%20(target%20!%3D%20null)%20%7Blocation.href%20%3D%20document.URL.substr(0%2Cdocument.URL.lastIndexOf('%2F'))%20%2B%20%22%2F%22%20%2B%20target%20%2B%20%22.html?dired=1%22%3B%7D%7D)()

5. Show Publish Status

If your store is in the middle of publishing and you don't have the publish status screen in front of you, this bookmarklet will take you to that page from any page of your live store.

javascript:var%20re%20=%20new%20RegExp('/cgi-bin/wg-order[?]([a-z0-9-]+)');var%20m%20=%20document.body.innerHTML.match(re);%20if%20(m)%20{document.location.href='http://edit.store.yahoo.com/RT/MGR.'%20+%20m[1]%20+%20'/NEWEDIT_STATUS';}


Enjoy!

Comments

Popular posts from this blog

Adding custom Yahoo Store fields - Catalog Manager vs. Store Editor

In a non-legacy Yahoo Store, there are two ways to add custom fields: through Catalog Manager under "Manage my Tables" and through the Store Editor, under "Types" (the Store Editor's "Types" are essentially the same as Catalog Manager's "Tables".) Whether you add custom fields from Catalog Manager or from the Store Editor does make a difference as each has its advantages as well as disadvantages. Catalog Manager To me the main advantages of using Catalog Manager to add custom fields are: 1) You can add multiple fields quicker 2) You can later change the field's name and even type 3) You can delete the field if you no longer need it. 4) All the fields that are available in Catalog Manager are included in the data.csv file if you download your catalog. 5) All the fields that are available in Catalog Manager are also included in the catalog.xml datafeed file, which is used by the comparison shopping engines, for example. (See the Search ...

Multi-Add and Yahoo Floating Cart Blues

Although the Yahoo! Floating Cart is considered pretty much bug free by Yahoo (you can look at the official open issues list here http://help.yahoo.com/l/us/yahoo/smallbusiness/store/floatingcart/floatingcart-09.html ) , there are some pretty "interesting" issues still, so since I keep running into them, I decided to post them here along with the work-arounds. The following issues all occur with multi-add forms only. 1) If you have your quantity set up as anything other than a simple text box (for example a drop-down SELECT box), the floating cart will not take the quantity value. It will take vwquantity as a customer-selected option. The workaround: use a text box instead. Nothing else works currently. 2) If you have a script that checks if the shopper made a selection from a drop-down (basically, any kind of an "onsubmit" handler), the floating cart will still receive the item, even if you cancel the submit event. The workaround: put the event handler on the click...

Pre-Season Checkup

With the holiday shopping season fast approaching it's a good idea to do a general checkup on your store to be sure it's ready for prime time. Below are a few things you would want to check, along with a few add-ons that are not too major in scope, but which are often neglected and give you an edge over your competition. Can you Search and Order? Every time we do anything major in a store we test two things: whether searching and adding to cart/ordering works. You can have nice, flashy pictures, cool animation effects, a very quick loading site, anything, but if the store search is broken or you can't add to the cart or can't check out then an ecommerce site is worth nothing. Can you Order? Chances are if your checkout was completely broken you'd know about it by now, but it doesn't have to be totally broken in order to scare away potential customers. So go ahead, go to your site and first do a search and make sure it works. Then, add one or more products ...