We'll be traveling to Madrid and Barcelona on Dec 26th - Jan 1st. Will a lot of shops be closed, should we consider rescheduling?
I don't know what's your source of information and what kind of shop are you talking about. The fact is that 27th, 28th, 29th, 30th and 31th are normal labour days, not bank holidays. Only 1st of January is a bank holiday in Spain. 26th is bank holiday only in Catalonia (Barcelona).
In my experience, you won't have any problem that days.
There are some businesses that routinely close and furlough during the week between Christmas and New Year's, but these are places like child care centres, nurseries, mom and pop small businesses in the suburbs, consultancies, and law offices. These businesses are not reliant upon the tourist trade and will not affect your access to shops and tourist venues.
Additionally, the week between Christmas and New Year's is often targeted for train maintenance such as track repairs and signal installation. However, the affected lines are generally infrastructural or used by commuters. So in this case you would expect a light 'holiday schedule' for public transport running INSIDE Madrid and Barcelona accompanied by significantly reduced service between these cities and their suburbs/dormitory communities. These maintenance schedules have minimal impact on the tourist trade. The high-speed train between Madrid and Barcelona for example will operate on a normal schedule.
Having said all of that, take note that areas in and around Barcelona (such as Sitges and Tarragona) are a beloved holiday zone for Northern Europeans and you may need to make dinner and clubbing reservations well in advance.
Indicative photo of tourists night wilding in Salou (south of Tarragona)...