The incident happened around 9.20am on Monday in Calder Road, Sighthill.
A 38-year-old man was assaulted and taken to Edinburgh Royal Infirmary with serious injuries. An attempt was also made to steal his wallet.
Officers including dog units were scrambled to scene. Witnesses reported the MacKinnon Pharmacy cordoned off with police standing guard.
A 31-year-old man has been charged with attempted murder and assault with intent to rob. A 25-year-old man has been charged with assault.
Both men are scheduled to appear at Edinburgh Sheriff Court today.
Detective Sergeant Todd Rutherford said: “Operation Arable is underway in Edinburgh to combat violence and robbery of personal possessions and as such, we will actively be pursuing those involved in this type of crime.”
Join our Facebook group Our Edinburgh to share images and news from and around the Capital