Hide inventory_quantity from page source

rumgd
Shopify Partner
2 0 0

Customers are viewing page information in the source code and using that to determine how much inventory is available of certain products, and then posting that information online for others to be able to view. We want to be able to stop this, but it seems like the inventory_quantity naming is required for our PDP functionality and that makes it super easy to find with a simple search in the code.

 

How can this information be hidden without using third party apps? 

Replies 2 (2)

Developer-G
Shopify Partner
2967 584 832

  Rename the inventory attributes ( class/id/data-attributes) so the customer cant identify what is it for in the PDP page and also do the same in the JS call so it will not break.  

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me.
- Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
-Advance Search Filter
rumgd
Shopify Partner
2 0 0

Assuming we make this change, someone who is able to figure out inventory levels in our current code should also have the knowledge to just check outgoing requests and find the variant inventory_quantity that way though, correct?

 

Also, there are 1000+ stores in our catalog that will be impacted by this change, so changing the naming of something so critical to our core functionality is not easily done.