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:
47 sites
103 downloads
8 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.

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

显示评论
  • Plugins bot
    2024年10月12日 星期六 22:10
    Approval issue created: CONTRIB-9715
  • Tetrafact Team
    2025年01月20日 星期一 07:06
    guest checkout doesn't work even if "Allow guests to add and remove courses from cart" was selected
  • MohammadReza PourMohammad
    2025年01月21日 星期二 03:37
    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
    2025年01月27日 星期一 09:10
    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
    2025年02月3日 星期一 15:10
    The transactions section is separate from the cart section, but the shopping cart report plugin will be released soon.
  • Nyasha Mukura
    2025年03月5日 星期三 06:27
    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
    2025年04月24日 星期四 13:28
    What Moodle version are you using?
Please login to post comments