The process of wrapping purchases in paper and twine is called packaging, and the resultant wrapped item is called a package. (You will hear purchases sometimes referred to as packages in old books, TV shows and movies.) It was replaced by self-service shops and sturdy paper bags beginning in the '30s.
To begin with, paper was used as flexible packaging as early as the 2nd century BCE in China, and was introduced to America in 1690. The shopping bag was invented in St. Paul, MN by grocer Walter H. Deubner in 1912:
By careful observation, he noticed that his customers purchases were
limited by what they could conveniently carry. So he set about
devising a way to help them buy more purchases at one time. It took
him four years to develop the right solution: a prefabricated package,
inexpensive, easy to use-and strong enough to carry up to seventy-five
pounds worth of groceries.
The other component was the Great Depression, which coincided with the expiry of the self-service business model patent held by Piggly-Wiggly - customers could now select and package their own purchases, in freely provided shopping bags (who's patent was also up.) Cash-strapped customers shopped at self-service establishments, as the prices were lower than full service shops.
Before shopping bags and self-service, salesclerks would bring merchandise to the counter from shelves or a stockroom for customer inspection, and package the purchase in paper and twine to make it easier to carry and to protect the item on the journey home.
It took a while for the self-service model to completely take over retail and obsolete paper-and-twine... and some retailers and shops kept up the custom as a way to differentiate the level of service they provided, until shoppers simply didn't care, and preferred the convenience of a shopping bag.