Answer the question
In order to leave comments, you need to log in
How can I create a field in a catalog category that will store the number of active items?
Can you tell me how to create a field in an infoblock, in a category, that will store the number of active elements?
Answer the question
In order to leave comments, you need to log in
Create a custom field of the Number type (you can do it directly from the admin panel on the tab of the Additional fields section).
Then this field must be filled in somehow. Can be done using event handlers:
OnAfterIBlockElementAdd
OnAfterIBlockElementDelete
OnAfterIBlockElementUpdate
On them, count the number of elements in the section and write this value to the custom field
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question