I am loving this new template editor and if it knows what your changes are, like I believe is how it is supposed to work, to avoid conflicts in future upgrades, it is totally awesome.
Anyway, this took me all of about 3 minutes to find and edit. It’s taking me longer to post it. LOL
EDIT THIS AND ALL OF YOUR FUTURE TEMPLATE EDITS VIA DEMO MODE IF POSSIBLE
Activate Demo mode and go to your store and select a product. Hover on the icon for the product box. You want to select views/products/components/buy_now.tpl and make the changes below in [COLOR=“Blue”]blue[/COLOR].
You can edit it how you like but you will also need to create language variables as well:
stock - need to create - I replace in stock
available - already in languages - Can substitute for Yes
unavailable - need to create - Can substitute for No
Customization mode works well for helping to find your way around the the templates and making changes. Unfortunately, those changes are made to the base TPL file which means that they will need to be reconciled when any future updates replace that TPL file.
The better approach would be to make changes using the ‘hooks’ feature which is vaguely documented at [url]http://docs.cs-cart.com/cscart-architecture[/url] (see the Template Hook section). tbirnseth does a better job of explaining it in this post:
This will tell the system to replace the content inside of the ‘hook’ template tag
with the content contained within the bottom.override.tpl file.[/QUOTE]
There is a hook starting at line 107 and ending at line 128 which deals with displaying the stock quantity:
If you make your changes using a hook, future upgrades won’t overwrite your mod which is in a local file.
The real problem, at this point, is that we have a real, working solution using tbirseth’s Local add-on but it has not been ‘blessed’ by the developers who seem to be doing there own thing with the “My changes” add-on. Any changes using tbirnseth’s add-on should be easily ported to the “My changes” add-on when it becomes available - well, at least in theory.
If you are not using options, you need to add your additional if statements and change the result to display to your image in /skins/YOURSKIN/customer/views/products/components/buy_now.tpl. You want the following block of code: