So I discovered how to individually call a <body onload""> function via the Zen Cart Wiki Article, and it works perfectly! However, I am now stuck with how to on_load_focus on a particular input box, whose name varies. Let me explain:
Our on-line Zen Cart store is our POS terminal at our bricks and mortar store. We are implementing bar code scanning to streamline the check-out process. First we have made each product model a corresponding number to the product bar codes, which are printed on our products. The idea is to make it so that when a new customer wants to check out, we click on "home" to get to our store's index page. The focus at that point should be on the search box. Upon "beeping" a product bar code, it automatically returns the data and ends up at the advanced search page.
From here, I want the focus to switch to the first search term's quantity box. (FWIW, theoretically there should only be one resulting search term, however, I have already had the experience of there being two search terms. No big deal there, as long as I can still get the focus to occur on the top most result's quantity box.) That way, all I have to do is enter a number instead of having to click on that box to activate it. As soon as I key in the quantity and press enter, I will be whisked away to my shopping cart, at which point we will focus on the search box so that we can continue to scan another product's bar code. This will keep going until we are ready to check out.
So, in the resulting advanced_search_results page code, the quantity box(es) are appropriately labeled by product ID as such: "products_id[XXX]" where XXX is the actual product ID. Given that each search makes the XXX something different for each given search result, I think that an on_load event would need to be looking for a name with wildcards in order to focus appropriately on that box.
The only two ways I can think to deal with this, is to either give the on_load command a name with valid wildcards in place of the product id or to establish a name for the quantity box which relates to its position in the list as opposed to its relationship to the search term.
Can anyone recommend a method, or help with the wildcard generation, if it is even possible to do? I am also having trouble with determining where the "name" of the search box is being generated -- if I could change it at the source, and it wouldn't screw something else up, it might be an easier way to change the way those terms are identified in the HTML on that page.
Thanks in advance.
Jason
http://www.tuxedoparkbrewers.com/
jason-at-tuxedoparkbrewers.com


Reply With Quote
