You are saying two different things here.
One you want the number of products sold that have a product code of 5228.
Two I want to find out how many quantity sold of each product code.
Okay, if I have this correctly what you want is the number of items sold by product code.
Here is a toy example,
## create a toy data set.
dat1 <- data.frame(xx = sample(letters[1:5], 100, replace = TRUE), yy = (sample(1:12, 100, replace = TRUE)))
## count the number of times the product code appears in the data
dat2 <- dat1 %>% group_by(xx) %>%
summarize( n = n())
dat2
In the second line of code you want to replace dat1 with the name of your data.frame or tibble. Then replace xx with the name of the column of product codes and you should be fine.
Best wishes