mitodl / mitxpro

BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

B2B/Bulk Coupons - Allow Pre-Population of Product via Querystring #1771

Closed odlbot closed 4 years ago

odlbot commented 4 years ago

As a bulk coupon redeemer, using the form at /ecommerce/bulk I don't want to have to find my product in the pulldown.

The URL should contain a product_id that selects the product from the pulldown so the user doesn't need to search. This looks like it's actually partially implemented as providing the product_id selects from the pulldown. But, the user isn't able to submit unless they select it manually.

Designs and Mockups

Acceptance Criteria:

Out of Scope

briangrossman commented 4 years ago

Past comments not sync'd from Trello:

@asadiqbal08 7/2/20 @ 6:32AM EST:

If I am not wrong, I believe, it is already implemented before. If I pass the product_id in URL http://xpro.odl.local:8053/ecommerce/bulk/?product_id=1 then product is selected as expected. and submitting via querystring. is there anything that I am missing here ?

@briangrossman 7/7/20 @ 9:43 EST

Sorry, I missed this comment earlier, @asadiqbal5

The note above states that the functionality appears to be in place to select the course / program from the pulldowns, but the learner is not able to submit the form unless they select it manually.

If you haven't already, it would be good to do some testing to see if you can definitely submit the form when the pulldowns are selected via the URL parameter.

Note that you should ideally create a B2B coupon in the admin /admin/b2b_ecommerce/b2bcoupon/ to test it.

@asadiqbal08 7/9/20 @ 5:45 AM EST

I tested the issue today over RC and seems working fine. I passed the following param /?product_id=1/ in URL parameter but did not select the product from the drop down and complete the purchase. I can see the Seed Systems Engineering over the receipt correctly.

BulkImage070920
briangrossman commented 4 years ago

@asadiqbal08 I plan to test this today on RC

briangrossman commented 4 years ago

@asadiqbal08 : This is a very sneaky bug. I created a video that shows the problem in the description where the user is not able to submit (Apply) the code unless you select the product manually.

https://www.dropbox.com/s/j0ce37ednegg8jt/B2BPurchaseAutopopulateIssue.mov?dl=0

My assumption is that the pulldowns are being set correctly, but the values need to be set somewhere else as well.

Let me know if you have any questions.

asadiqbal08 commented 4 years ago

Thanks @briangrossman for the video that was helpful to understand the issue clearly. URL-populated product is already being submitted with the form as I tested so it should not be in the acceptance criteria.

So, Let me rephrase the description of the issue.

User is not able to apply a coupon code when user pass the product_id as text_id e.g. ?product_id=program-v1:xPRO+SysEngx but works fine in case of integer pass ?product_id=1 in B2B/Bulk purchase.

briangrossman commented 4 years ago

That is interesting. Is it possible to get it to work with the text_id, too?

asadiqbal08 commented 4 years ago

Yes. PR is linked here.

briangrossman commented 4 years ago

After completing this issue, a logical next step would be: #1801