Refactored e-Commerce plugin and fixed a bug