Moodle Plugins directory: Shopping Cart | Moodle.org

Shopping Cart
Moodle Shopping Cart
This plugin adds a complete shopping cart system to Moodle by introducing a new "Cart" enrolment method. Users can add courses to their cart and proceed to payment using any of the supported Moodle payment gateways
Users can access their shopping cart from the cart icon in the top navigation bar and view their purchase history via the "My Purchases" option in the user menu. Courses can also be added to the cart before logging in — the cart data is stored in a cookie and automatically transferred to the database upon login, allowing users to proceed with payment seamlessly.
This plugin allows administrators to define a fixed discount amount or a percentage discount for each course. Additionally, it supports the use of coupon codes during checkout by implementing the enrol_cart\local\object\coupon_interface
interface and configuring the coupon_class
in the cart enrollment settings.
An example implementation (enrol_cart\local\object\coupon_example
class) is included in the plugin to demonstrate how to build your own coupon logic.
Key Features
-
Shopping Cart Enrolment Method:
Adds a "Cart" enrolment method to courses, enabling users to easily add one or more courses to their shopping cart and complete payment using Moodle's available payment gateways. -
User-Friendly Cart Management:
Users can access their shopping cart through the cart icon in the top navigation bar and review their purchase history via the "My Purchases" option in the user menu. -
Seamless Shopping Experience:
Users can add courses to their cart even before logging in. The cart information is stored in a cookie and automatically transferred to the database once the user logs in, allowing them to complete their purchase without losing any items. -
Discount Management:
Administrators can set discount amounts or percentages for individual courses. The plugin also supports discount coupons, which can be used during checkout by implementing theenrol_cart\local\object\coupon_interface
class and setting thecoupon_class
in the cart enrolment settings.
Comments