To create a new product, click on “New product”, on “Products” page under “Catalog” menu. It will open add new product page, where you can create new products or edit existing ones. New in PrestaShop 1.7, the add new product page is organized in tabs like Basic settings, Quantities, Shipping, Pricing, SEO, Options.
![Availability Prestashop 1.7 Edit Text Availability Prestashop 1.7 Edit Text](http://build.prestashop.com/assets/images/2018/02/173_Low_Stock_Levels.png)
There are multiple ways to query availability group information, below are some of my favourite goto queries when I need to obtain information about Always on Availability groups for various tasks.
Show All availability groups visible to this server where this Server is the Primary replica
Show All availability groups visible to this server where this Server is a Secondary replica
Show All Databases in an availability group visible to this server where this Server is the primary replica
Show All Databases in an availability group visible to this server where this Server is a Secondary replica
Show All Databases Across all Availability groups within the Cluster (not specific to current server)
Show Availability groups visible to the Server and Replica information such as Which server is the Primary replica, Sync and Async modes , Readable Secondary and Failover Mode
The code below is originally from the AG Dashboard that can be found in SSMS,I have adapted the code to show some human friendly columns and alter the logic slightly to take a single Parameter @AGname , SET to NULL to see all AG’s or set to a specific AG for a filtered list , this is a condensed version of the AG Dashboard which contains a horde of information such as Redo queue sizes, rates Estimated Data Loss and LSN information.
Want to see more queries? check out 7 more ways to Query Always on Availability groups
Have fun querying and thanks for reading 🙂
In this flash tip we will see how to display an explanatory text for combinations which you have no stock for, but still want to allow the purchase of.
- PrestaShop Version used: 1.6.1.5
The background
Do you allow back ordering products? If so, you might have noticed PrestaShop tends to be confusing on combinations. In the default template, when a combination is available and has stock, it displays the classic X items in stock message. However, if you select a combination that has currently zero stock, even if available for order, it displays nothing. Forum users have reported customers being confused by this, so let’s see how to fix it, and give our customers more feedback!
The translatable string
Unless you run a single language shop, you will need the text we are going to display to be translatable. Therefore, we will take advantage of PrestaShop’s AddJsDefL method to add a javascript variable that can easily be translated from the back office. Open up your product.tpl file, located in the theme folder. At the very end of it, add the following:
What does it do? It takes any content between tags and assigns it to the variable with a given name. There is a manual method as well, but this is the one that better complies to PrestaShop standards. If you want to know more about this and other functions, you can refer to my Essential PrestaShop functions series.
Editing product.js
Now that we have a string to play with, we have to make it work as we want. Open up product.js, located in the theme folder /js/. Please notice yours might be different if you do not use the default template. Locate the following at around line 630:
The last part, in the else, is the one responsible for not displaying anything. We could simply comment it out, but if you try it, you will notice it says the product is available in other variants only. What to do then? Let’s modify it as follows:
We just added brackets to the else statement, then copied the label-warning part from above, and used our text variable instead. Save and refresh, then try reloading the page with the combination selected, as well as switching between that and others. You will notice the text behaves as expected now!