Shopping Cart

Enrolment ::: enrol_cart
Maintained by MohammadReza PourMohammad
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.
Latest release:
56 sites
113 downloads
9 fans
Current versions available: 1

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 the enrol_cart\local\object\coupon_interface class and setting the coupon_class in the cart enrolment settings.

 

🙌 Support This Project

If you find this plugin useful, consider supporting its development:

☕ Donate via Ko-fi

☕ Donate via PayPal 

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8

Contributors

MohammadReza PourMohammad (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    Sat, 12 Oct 2024, 10:10 PM
    Approval issue created: CONTRIB-9715
  • Tetrafact Team
    Mon, 20 Jan 2025, 7:06 AM
    guest checkout doesn't work even if "Allow guests to add and remove courses from cart" was selected
  • MohammadReza PourMohammad
    Tue, 21 Jan 2025, 3:37 AM
    Guest users can only add or remove courses from the cart. To proceed with checkout and complete the purchase, they need to log in to the site.
  • Tetrafact Team
    Mon, 27 Jan 2025, 9:10 AM
    is there any transactions spreadsheet? and in order to see description on my Paypal Transactions i had to change in payment.php $description = $CFG->wwwroot . ' - ' . reset($cart->items)->course->title;
  • MohammadReza PourMohammad
    Mon, 3 Feb 2025, 3:10 PM
    The transactions section is separate from the cart section, but the shopping cart report plugin will be released soon.
  • Nyasha Mukura
    Wed, 5 Mar 2025, 6:27 AM
    I'm having this error message when I try to pay for cart items using PayPal: "Exception - enrol_cart\local\helper\payment_helper::is_payment_gateway_valid(): Argument #1 ($gatewayname) must be of type string, null given, called in [dirroot]/enrol/cart/payment.php on line 88"
  • MohammadReza PourMohammad
    Thu, 24 Apr 2025, 1:28 PM
    What Moodle version are you using?
Please login to post comments