Using the aggregate function.
library(ggplot2)
coffee <- read.csv('CoffeeChain.csv')
agg <- aggregate(cbind(Profit, Sales) ~ Product+Market+Product.Type, data=coffee, FUN=sum)
ggplot(agg, aes(x=Product, weight=Sales, fill=Profit), stat="identity") +
geom_bar() +
scale_fill_gradientn(colours=c("#F37767", "#9FC08D", "#6BA862", "#2B893E", "#036227")) +
facet_grid(Market~Product.Type, scales="free_x", space="free") +
ylab("Sales") +
theme(axis.text.x=element_text(angle=90))