<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Moodle Plugins directory: Shopping Cart: Comments</title>
    <link>https://moodle.org</link>
    <description>This plugin adds a complete shopping cart system to Moodle by introducing a new &quot;Cart&quot; enrolment method. Users can add courses to their cart and proceed to payment using any of the supported Moodle payment gateways.</description>
    <generator>Moodle</generator>
    <language>en</language>
    <copyright>(c) 2026 Moodle - Open-source learning platform | Moodle.org</copyright>
    <image>
      <url>https://moodle.org/theme/image.php/moodleorg/core/1777401252/i/rsssitelogo</url>
      <title>moodle</title>
      <link>https://moodle.org</link>
      <width>140</width>
      <height>35</height>
    </image>
    <item>
      <title>Thursday, 4 December 2025, 7:14 PM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89055</link>
      <pubDate>Thu, 04 Dec 2025 11:14:41 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;You’ve likely gone through the payment step once. When you reach the payment and checkout stage, the currency is saved for the cart, and if the payment fails, you still won’t be able to change it afterward.&lt;br&gt;
&lt;br&gt;
If you’re still having problem, you can open an issue on GitHub and attach a screenshot so I can check and follow up.&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89055</guid>
    </item>
    <item>
      <title>Thursday, 4 December 2025, 4:00 PM - aman yadav</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89052</link>
      <pubDate>Thu, 04 Dec 2025 08:00:34 GMT</pubDate>
      <description>by aman yadav. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;i have it selected at INR But it still shows in USD i am using remui theme with 5.1 moodle&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89052</guid>
    </item>
    <item>
      <title>Wednesday, 3 December 2025, 1:21 PM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89048</link>
      <pubDate>Wed, 03 Dec 2025 05:21:43 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;You must change cart currency  by navigating to: Site Administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Cart.&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89048</guid>
    </item>
    <item>
      <title>Wednesday, 3 December 2025, 5:22 AM - aman yadav</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89047</link>
      <pubDate>Tue, 02 Dec 2025 21:22:04 GMT</pubDate>
      <description>by aman yadav. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;with razorpay it shows in dollar $ by default is there any fix for that?  if you can take a look it would be big help &lt;img class=&quot;icon emoticon&quot; alt=&quot;smile&quot; title=&quot;smile&quot; src=&quot;https://moodle.org/theme/image.php/moodleorg/core/1777401252/s/smiley&quot;&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89047</guid>
    </item>
    <item>
      <title>Tuesday, 2 December 2025, 2:24 PM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89033</link>
      <pubDate>Tue, 02 Dec 2025 06:24:30 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;Thanks for the follow-up and clarification. Glad to hear the Cart plugin works fine.&lt;br&gt;
&lt;br&gt;
The cart plugin doesn’t support different currencies for each enrolment instance. The reason is that checkout becomes impossible if a single cart contains courses priced in different currencies.&lt;br&gt;
For this reason, the currency is defined globally. When the global currency changes, previous orders keep the currency they were paid with, while all new purchases must use the newly configured currency.&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89033</guid>
    </item>
    <item>
      <title>Tuesday, 2 December 2025, 5:55 AM - aman yadav</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89032</link>
      <pubDate>Mon, 01 Dec 2025 21:55:51 GMT</pubDate>
      <description>by aman yadav. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;Fix Currency Display Bug in Enrolment Page&lt;br&gt;
fix the issue where the course price is displayed with the wrong currency symbol (e.g., $) instead of the selected currency (e.g., INR) on the course enrolment page.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
This change will force ALL enrolment instances to use the globally configured payment currency from the plugin settings, ignoring any currency value stored in the database for individual instances. This assumes that the site uses a single currency for all courses.&lt;br&gt;
&lt;br&gt;
Proposed Changes&lt;br&gt;
enrol_cart Plugin&lt;br&gt;
[MODIFY] &lt;br&gt;
cart_enrollment_instance.php&lt;br&gt;
Update &lt;br&gt;
after_find&lt;br&gt;
 method to unconditionally set $this-&amp;gt;currency to the configured payment_currency.&lt;br&gt;
This ensures that &lt;br&gt;
get_price_formatted&lt;br&gt;
 and &lt;br&gt;
get_payable_formatted&lt;br&gt;
 always use the correct currency symbol.&lt;br&gt;
public function after_find() {&lt;br&gt;
        // Force currency to be the configured payment currency&lt;br&gt;
        $this-&amp;gt;currency = (string)cart_helper::get_config('payment_currency');&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89032</guid>
    </item>
    <item>
      <title>Tuesday, 2 December 2025, 5:41 AM - aman yadav</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89030</link>
      <pubDate>Mon, 01 Dec 2025 21:41:10 GMT</pubDate>
      <description>by aman yadav. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;I wanted to follow up and apologise for my earlier messages about the Cart plugin. I’m quite new to the Moodle ecosystem, and in the beginning it really looked like the problem was in the Cart plugin because:&lt;br&gt;
&lt;br&gt;
Razorpay worked fine with direct “enrolment on payment”, but&lt;br&gt;
&lt;br&gt;
Razorpay consistently failed only when going through the Cart flow.&lt;br&gt;
&lt;br&gt;
So naturally we assumed “Cart must be the problem”.&lt;br&gt;
&lt;br&gt;
Over the last few days we dug much deeper (checking webservice calls, JSON responses, DB queries, etc.), and we eventually found that the issue was not caused by the Cart plugin at all.&lt;br&gt;
&lt;br&gt;
What was actually happening (technical summary):&lt;br&gt;
&lt;br&gt;
The Cart plugin was correctly calling Moodle’s payment API with:&lt;br&gt;
&lt;br&gt;
component = 'enrol_cart'&lt;br&gt;
&lt;br&gt;
paymentarea = 'cart'&lt;br&gt;
&lt;br&gt;
itemid = cart ID&lt;br&gt;
&lt;br&gt;
In our setup, the Razorpay payment gateway (paygw_razorpay) webservice implementation (get_config_for_js) assumed that itemid is always an enrol instance ID and did:&lt;br&gt;
&lt;br&gt;
$courseid = $DB-&amp;gt;get_field('enrol', 'courseid', ['id' =&amp;gt; $itemid]);&lt;br&gt;
$course   = get_course($courseid);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
This works for direct enrolment (where itemid really is enrol.id), but for enrol_cart the itemid is actually the cart ID, so the lookup fails and throws the “Can’t find data record in database table course” error.&lt;br&gt;
&lt;br&gt;
On top of that, in our environment we had some old / stale cart data from a previous install, which initially confused the diagnosis because some cart items pointed to non-existent enrol instances. We cleaned that up by uninstalling the cart plugin properly and dropping the old cart tables.&lt;br&gt;
&lt;br&gt;
The actual fix ended up being in the Razorpay gateway, not in Cart:&lt;br&gt;
&lt;br&gt;
When component = 'enrol_cart' and paymentarea = 'cart', we resolve the course via&lt;br&gt;
{enrol_cart_items} → {enrol} → courseid using the cart_id (itemid),&lt;br&gt;
and only then call the Razorpay helper.&lt;br&gt;
&lt;br&gt;
We also made sure the webservice response always includes a currency field to match the external function definition.&lt;br&gt;
&lt;br&gt;
Once we did that, your Cart plugin worked perfectly without any modifications.&lt;br&gt;
&lt;br&gt;
So, to be clear:&lt;br&gt;
There is no bug in the Cart plugin.&lt;br&gt;
The problem was a combination of:&lt;br&gt;
&lt;br&gt;
Our own environment (stale data from older installs), and&lt;br&gt;
&lt;br&gt;
The way the Razorpay gateway’s get_config_for_js handled the enrol_cart case.&lt;br&gt;
&lt;br&gt;
I’m really sorry for pointing the finger at your plugin earlier. It was a misunderstanding on our side while we were still learning how Moodle’s payment and enrolment APIs fit together.&lt;br&gt;
&lt;br&gt;
Thank you for your work on the Cart plugin, and again, apologies for the noise.&lt;br&gt;
&lt;br&gt;
Best regards,&lt;br&gt;
This error took 72 dedicated hour of mine &lt;img class=&quot;icon emoticon&quot; alt=&quot;smile&quot; title=&quot;smile&quot; src=&quot;https://moodle.org/theme/image.php/moodleorg/core/1777401252/s/smiley&quot;&gt;  reminder that IT is unforgiving &lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89030</guid>
    </item>
    <item>
      <title>Tuesday, 2 December 2025, 4:06 AM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89029</link>
      <pubDate>Mon, 01 Dec 2025 20:06:57 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;Hi aman yadav,&lt;br&gt;
&lt;br&gt;
I tested the integration using the Razorpay sandbox keys and everything worked correctly.&lt;br&gt;
&lt;br&gt;
Since the issue only happens with production keys, please switch your site to developer/debug mode and check the browser console as well as the network tab.&lt;br&gt;
send me the results of the requests made to service.php during the checkout/payment attempt so I can check further.&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89029</guid>
    </item>
    <item>
      <title>Sunday, 30 November 2025, 9:36 PM - aman yadav</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89019</link>
      <pubDate>Sun, 30 Nov 2025 13:36:01 GMT</pubDate>
      <description>by aman yadav. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;further testing revels it only works with razorpay test keys the moment you put production key it wont work, surprisingly the enrolment on payment is working , with production keys so problem lies in cart plugin &lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89019</guid>
    </item>
    <item>
      <title>Sunday, 30 November 2025, 6:14 PM - aman yadav</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-89018</link>
      <pubDate>Sun, 30 Nov 2025 10:14:39 GMT</pubDate>
      <description>by aman yadav. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;Hi,&lt;br&gt;
&lt;br&gt;
I’m having an issue with the cart + Razorpay payment gateway integration.&lt;br&gt;
&lt;br&gt;
Environment:&lt;br&gt;
&lt;br&gt;
Moodle version: 5.1&lt;br&gt;
&lt;br&gt;
Cart plugin: latest version&lt;br&gt;
&lt;br&gt;
Razorpay payment gateway plugin: latest version&lt;br&gt;
&lt;br&gt;
Problem description:&lt;br&gt;
&lt;br&gt;
I can add items to the cart without any issue.&lt;br&gt;
&lt;br&gt;
I go to the cart page and click Proceed to checkout.&lt;br&gt;
&lt;br&gt;
On checkout.php, the Razorpay payment method appears as a radio button.&lt;br&gt;
&lt;br&gt;
When I select Razorpay and try to proceed with the payment, the Razorpay popup does not load.&lt;br&gt;
&lt;br&gt;
Instead, I get redirected back to the checkout page, and this loop continues (checkout → select Razorpay → redirect back to checkout).&lt;br&gt;
&lt;br&gt;
So the payment gateway never actually loads and the user cannot complete payment.&lt;br&gt;
&lt;br&gt;
Could you please help identify what might be breaking in the flow and what minimal changes or fixes are needed on the plugin side? If you need any specific logs or settings screenshots, I can provide them.&lt;br&gt;
&lt;br&gt;
Thanks!&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-89018</guid>
    </item>
    <item>
      <title>Thursday, 24 April 2025, 1:28 PM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-87095</link>
      <pubDate>Thu, 24 Apr 2025 05:28:36 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;What Moodle version are you using?&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-87095</guid>
    </item>
    <item>
      <title>Wednesday, 5 March 2025, 6:27 AM - Nyasha Mukura</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-86533</link>
      <pubDate>Tue, 04 Mar 2025 22:27:55 GMT</pubDate>
      <description>by Nyasha Mukura. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;I'm having this error message when I try to pay for cart items using PayPal: &quot;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&quot;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-86533</guid>
    </item>
    <item>
      <title>Monday, 3 February 2025, 3:10 PM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-86246</link>
      <pubDate>Mon, 03 Feb 2025 07:10:40 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;The transactions section is separate from the cart section, but the shopping cart report plugin will be released soon.&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-86246</guid>
    </item>
    <item>
      <title>Monday, 27 January 2025, 9:10 AM - Tetrafact Team</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-86171</link>
      <pubDate>Mon, 27 Jan 2025 01:10:51 GMT</pubDate>
      <description>by Tetrafact Team. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;is there any transactions spreadsheet? and in order to see description on my Paypal Transactions i had to change in payment.php $description = $CFG-&amp;gt;wwwroot . ' - ' . reset($cart-&amp;gt;items)-&amp;gt;course-&amp;gt;title;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-86171</guid>
    </item>
    <item>
      <title>Tuesday, 21 January 2025, 3:37 AM - MohammadReza PourMohammad</title>
      <link>https://moodle.org/plugins/enrol_cart#comment-86124</link>
      <pubDate>Mon, 20 Jan 2025 19:37:46 GMT</pubDate>
      <description>by MohammadReza PourMohammad. &amp;nbsp;&lt;p&gt;&lt;div class=&quot;no-overflow&quot;&gt;&lt;div class=&quot;text_to_html&quot;&gt;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.&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">https://moodle.org/plugins/enrol_cart#comment-86124</guid>
    </item>
  </channel>
</rss>