Limitation to buy a sepcific course once

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345354

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.30
-- Browser(s) name and version -- : Firefox 105.0.1
-- Error-message(debug-mod must be tuned on) -- : No error message.

I try to limit my training courses so that each registered user can only buy a lesson once and cannot add multiple instances of the same course.

I have tried the category limitation set to training category and set to forever, and limited to 1, but then it does not allow the client to add any courses.

Then change the limit to a specific product, and to 1 also forever, but then I can add multiple instances of the same course.

How can I prevent a customer from adding a course they have previously purchased? Do I need to buy the business and use the Access level for the product as one?

I do not know how to resolve this, and the client keeps on buying the same course. Please advise.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 2 months ago #345359

Hi,

You need to configure a limit in the menu Products>Limit, one per product, with a quantity of 1 and a period of "forever".
If that doesn't work, could you provide a screenshot of your limit settings ?
Also, since it needs to take into account the orders already made by the users before, the order statuses selected in the limit, and the way you configured the order statuses in the System>Order statuses, and the payment methods you're using and how they are configured is important.
For example, if you configure the limit to use the order status "shipped" but that the previous orders of the user are either confirmed or created then the limit will ignore them. So please check all that and provide screenshots if you don't find issues so that we can check the situation.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345390

Hi Nicolas

This is the current setting.


I have tried with different statuses. All the purchases are manually approved to Confirmed, once payment is received on all the training category courses. Products like books have their own category and will be set to complete once the shipping was done.



When the client already has the product purchased about a year or two ago, it is still available on the workshop display menu. When I add the same course again they cannot add it a second time. So it allows them to buy the same course they already have. See the attachment below.



A second issue is that when I cancel the category selection and save the limit again, the category appears again. The only way to get rid of the category is to delete the Limit and re-add them.

I do not know if this might cause the issue.

Attachments:
Last edit: 2 years 2 months ago by Seahawk.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 2 months ago #345396

Hi,

I would recommend not using both the categories setting and the product setting at the same time.

So first, there are two things to consider for a limit:
- the quantity of the product in the cart of the user
- the quantity of the product in previous orders of the user
I checked your website and I do get an error message when I try to add more than 1 of a product in the cart.
But I can't say whether it comes from the limit itself or the quantity of the product or the max quantity per order of the product.

So first, disable the limit temporarily and check that you can add more than 1 in the cart. If you still can't, then it means the restriction comes from the quantity of the product or the max quantity per roder of the product, not the limit.
So make sure there is enough quantity and max quantity per order in the product to be able to add more than 1 in the cart.
Once that's one, enable the limit and check that the restriction is enforced. If it still isn't, then the issue is with the product / category selected in the limit.
Note that the selected category must be directly linked to the product in the "categories" setting of the product.

Also, could you provide a screenshot of the limit settings, the product settings, the details an order of a test user which is confirmed, the System>Order statuses menu, and the credentials for that test user account so that we can reproduce the issue ?

Regarding the issue with deleting a category from the category setting of a limit, I was able to reproduce the issue and added a patch for it. Download again the install package of the 4.6.2 and install it on your website and you'll get the patch.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345422

"I checked your website and I do get an error message when I try to add more than 1 of a product in the cart."

You must be a registered user. No guests are allowed since they have to register via Joomla because I have to collect information for the professional Bodies when the training is completed. Is there a way to pull through that information to the Hikashop Billing address?

I will check the rest of your answers later tonight. Have to run now.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 2 months ago #345424

Hi,

I don't understand what you mean. I don't have to be registered to test the add to cart. As I said, this works as it properly displays the error message when I try to add more than 1 of a product.

If you want to collect information from users, even for guest checkouts, that's possible. You need to create custom fields of the table "user" via the menu Display>Custom fields in HikaShop. These will appear on the registration form and on the guest form. And you can then find them when you edit a user via the customers menu in the HikaShop backend.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345466

nicolas wrote: Hi,

I don't understand what you mean. I don't have to be registered to test the add to cart. As I said, this works as it properly displays the error message when I try to add more than 1 of a product.


That is true. You cannot add more than one of the same product. That works. That is not the issue.

I use Hikashop in conjunction with Joomdle to sell my Moodle training. Now Moodle will not allow the student to enter the same course twice. This means students must first register for an account on the Joomla site with compulsory information and verification. Thereafter they can log in and purchase the course that they want to do through Hikashop.

If the student has purchased the course before, they can still add and pay them again in Hikashop, but that will not create another Moodle instance of the course. That means I have to manually intervene and change the course to something they have not done yet.

That is where the problem is. They might have done it two years ago, so I do not want them to be able to add it to their cart again.

See this dicussion on Joomdle: www.joomdle.com/support/forum/shop-e-com...buy-throgh-hikkashop
Maybe one can use a plugin that would be able to link with Joomdle and Moodle?

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 2 months ago #345467

Hi,

Yes, I understand that. And my message here ( www.hikashop.com/forum/2-general-talk-ab...rse-once.html#345396 ) was precisely to try to find the cause of the issue with the limit.

Regarding the possibility to limit the purchase based on the courses already taken in Joomdle/Moodle, since there is already a plugin made by Joomdle to link products in HikaShop and courses in Moodle, it should be that plugin which should be modified to offer the possibility to block the purchase of a product if the corresponding course has already been taken.
Thie can be done in the code of the plugin with the onAfterProductCheckQuantities(&$products, &$cart, $options) event of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345486

Thanks Nicolas

nicolas wrote: Hi,
Yes, I understand that. And my message here ( www.hikashop.com/forum/2-general-talk-ab...rse-once.html#345396 ) was precisely to try to find the cause of the issue with the limit.


Sorry, it is setup in the quantiyy of the product.

nicolas wrote: it should be that plugin which should be modified to offer the possibility to block the purchase of a product if the corresponding course has already been taken.


I will inform Antonio.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345490

Good day team
When I add retsictions on limitations, and I leave the dates empty of a setting of forever, and save, it seems to be fine.

When I enter a start date say 2017-12-13 and end date, it seems to be working too. when I delete (remove) the dates and save it autimatically enters the below date.



What should the forever setting dates be? Should it be empty or be just zero"s?

Thanks

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345491

It seems I have have figured out and have the setup sorted to prevent a student adding a course twice, or again later to buy it again. The limits seems to be working on the settings of the order statuses as above. Created, Confirmed, Shipped, and Pending.

Removing or clearing the dtaes is still an issue, since all other products exept the first 4 have have not entered the dates nor the category just each training course with the restriction per cart order = 1 in the product settings, and the forever = 1.

Thanks for all the inputs.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 2 months ago #345494

Hi,

Since you want the limitation to work regardless of when the user placed previous orders, you should leave these date settings empty in your limits.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 years 2 months ago #345499

nicolas wrote: Hi,

Since you want the limitation to work regardless of when the user placed previous orders, you should leave these date settings empty in your limits.


I know that now. When I try and remove or clear the date and save it, it does not change




Then when I save or save and close I get the following dispalyed:


Must I remove this in the database or is this a bug?

Attachments:
Last edit: 2 years 2 months ago by Seahawk.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 2 months ago #345502

Hi,

Thanks for the details. I wasn't able to reproduce it on Joomla 4 nor on several Joomla 3 websites, but I finally got to reproduce the issue on one test website, for some reason.
I've added a patch to avoid the problem. Download again the install package of the 4.6.2 and install it on yours and you should not have the problem when deleting a date.

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum