How Can We Help?
How to enable or disable the show price in product view and search bar results?
Introduction
This post will guide you to show the price in the product view and search bar results.
How to enable or disable the show price in product view and search bar results?
For the requirement:
- The main root cause of the performance issue when changing categories and show product lists are:
- Code always runs in the UI thread.
- Query ALL information even we don’t need it.
- To solve the performance issues quickly, we have to provide a setting to enable/disable Show Price in the Product list and Search bar list.
- If “Show Price” is disable,
- We don’t need to call product variants, price books, etc. In the screenshot “Issue_1”, the query was run in for loop and UI thread, this will cause a big performance impact on user experience.
- We will get product variant, price book, etc. information when the user clicks on the product and shows UI.
- If the information has already been queried from DB before, then we need to store it in the product object cache, so no need to re-query again.
- For the waiter app, we can have a setting to Enable / Disable Show Price, so that waiters do not need to query extra information that they don’t need when displaying the product list.
- When Fresh Install or Upgrade and run the migration, we need to check the device memory. If the device memory is <= 2GB RAM, we will set the default “Show Price” setting to disable.
To show the price in the product:
- Go to the setting in Product and then go to the general look for the Show price in Product.
- The show price in the product is default toggle on.


3. For the show price in the product is the toggle off:


4. For the default in-app in different devices:
- By default, if the device RAM is more than 2GB, app will display the product price in both product list and search bar result
- But if the device RAM is equal to 2GB or less, the app will hide the product price in both the product list and search bar results by default.