To maybe address the last first, generally it takes more than a single file to incorporate ajax related code at least to maintain the structure generally expected. There's the javascript/jquery to "collect" the information, then there's a file that is accessed based on the ajax call which then digs into the php side with the result provided back to the javascript/jquery to be processed.
There is always some amount of security items to be considered or concerned about; however, by starting in your admin area there is a little bit less concern because the file(s) are not directly accessible from outside the admin folder.
As to other examples that perhaps are less involved, there's Dynamic Price Updater (
https://www.zen-cart.com/downloads.php?do=file&id=1301) that uses ajax style calls (haven't received authoritative feedback of the quality of its use), and there is a little more convoluted/involved is product attribute image replaces main product image:
https://www.zen-cart.com/downloads.php?do=file&id=699.
As to the overall concept, if understand correctly you want to be able to click on the quantity, modify it and then when you move away from it you want that to be the value seen by customers. For what it's worth I think there is already a plugin that does that or similar I think called quick status update, though I think it still uses/expects a "save" button to be pressed to cause the update action. My concern with such a "quick" update by moving away from the text block is that the number could be accidentally saved with whatever was entered which could be grossly large or small. Too large and someone could overpurchase, too small (0?) and a product will appear as out-of-stock. Having a sort of "save" button at least forces some level of thought in the modification. The other part of all that is how the system responds just at the verge of the session ending...
Bookmarks