The retailer blames the rise of online shopping for its decision, which risks hundreds of jobs.