Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magento 2 bug: when you purchase a downloadable product from within a grouped product it does not appear in my downloadable products #7413

Closed
ghost opened this issue Nov 13, 2016 · 17 comments
Assignees
Labels
bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@ghost
Copy link

ghost commented Nov 13, 2016

Hi,

I have three types of products set up. Simple products (book), downloadable products (ebooks) and grouped products (books and ebook) containing both simple and downloadable products.

  1. When I purchase a downloadable product that product order does not appear in the my downloadable products section after completed purchase via worldpay module or using a purchase order invoice.

Preconditions

  1. magento 2.1.2 CE
  2. php 7
  3. migrated data from magento 1

Steps to reproduce

  1. purchase downloadable product via worlpay credit card or invoice
  2. successfully pay in test mode via worldpay or complete invoice order in back end
  3. go to my downloadable products and new purchase is not there

Expected result

  1. new purchase should show up in my downloadable products

Actual result

  1. Product purchased down not show up in my downloadable products section

This happens on both my local mac and RHEL7 server.

@victor-v-rad
Copy link
Contributor

Hi @chrisincisive

Make sure you copied media folder from Magento 1 to Magento 2 with download files

@ghost
Copy link
Author

ghost commented Nov 16, 2016

Hi Victor,

Thanks for your message.

I copied the downloadable folder across now but it's still the same. Actually i should have specified we sell ebooks but we don't host the ebooks themselves. That is done by a third party and we have a link that they click on to retrieve the book - so the ebooks themselves aren't stored on our server.

What isn't happening is that when we buy an ebook (by worldpay or invoice) the link doesn't appear in the my downloadable products section. All the migrated data does. But any new purchase doesn't appear.

This person also seems to be having trouble with magento 2.1.2 and my downloadable products: http://magento.stackexchange.com/questions/142627/troubles-with-downloadable-in-grouped-in-2-1-2

@ghost
Copy link
Author

ghost commented Nov 17, 2016

ok so weirdly points 2 and 3 (no title appearing in sales -> orders -> view order and checking out both downloadable and simple products from same grouped product) are actually to do with issue #4921. I was getting the

"checkout rules.js:58 Uncaught TypeError: Cannot read property 'length' of undefined(…)"

So I changed the number of lines for customer address to 1 (instead of 2) and that seems to have fixed the checkout so can now checkout with 2 products of the same grouped product and title now appears in the sales -> order -> view order screen. No idea why...but there you go.

However, point 1 still occurs - the downloadable product link still doesn't appear in my downloadable products after successful purchase?

Update 1...

I just checked the downloadable_link_purchased and downloadable_link_purchased_item tables and there aren't any entries in there for the new products, hence they aren't showing up. But I'm not sure why they aren't getting inserted into these tables?

Update 2 ...

i just installed a vanilla magento 2.1.2 to test. I added a downloadable product and bought it by invoice, complete the order and it appeared in the my downloadable section.

However, when i created a simple product and a downloadable product to a new grouped product and bought by invoice and completed the order, it didn't appear in my downloadable products.

Also product title is blank in sales -> order -> view order under items ordered. I tried changing number of lines to 1 (which fixed it in our version) but didnt' work on this vanilla version.

So the problem is downloadable products within grouped products.

@ghost
Copy link
Author

ghost commented Nov 19, 2016

if anyone has a fix for this would be much appreciated as can't go live until it's working?

thanks

@ghost ghost changed the title downloadable product does not appear in my downloadable products after completed purchase and cannot complete checkout with both simple and downloadable product from same grouped product magento 2 bug: when you purchase a downloadable product from within a grouped product it does not appear in my downloadable products Nov 23, 2016
@ghost
Copy link
Author

ghost commented Nov 23, 2016

we also tested magento 2.0.1 and this bug exists in there too.

Any idea what file the problem might be in? Would it be in vendor/magento/module-downloadable/Observer/SaveDownloadableOrderItemObserver.php or similar?

@ghost
Copy link
Author

ghost commented Dec 6, 2016

Any update on this please?

@olysenko
Copy link

Hi, thank you for your report. I was able to reproduce issue with downloadable product inside grouped product on clear Installed Magento instance. Internal issue MAGETWO-62235 was created

@olysenko olysenko added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 2.1.x labels Dec 14, 2016
@ghost
Copy link
Author

ghost commented Dec 14, 2016

Hi Olysenko,

Thanks very much!

@ghost ghost closed this as completed Jan 12, 2017
@adplaga
Copy link

adplaga commented Mar 15, 2017

Hi Olysenko,

Are you able to provide update on the status of the issue MAGETWO-62235?

Thanks
Adam

@OnkelTem
Copy link

@olysenko
Would you please provide some information in which commit it was fixed? There are no any mentions in git history of this issue either.

@OnkelTem
Copy link

@magento-engcom-team bump. The same question, see above.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 26, 2017
@OnkelTem
Copy link

Guys, I don't get - what is G1 Passed means? What commit is fixing the issue? @olysenko

@JesKingDev
Copy link

Testing this with Magento 2.3.0, the problem is not resolved.

@nchalias
Copy link

Also testing this with Magento 2.3.0, the problem is not resolved.

@mzenner1
Copy link

mzenner1 commented Apr 9, 2019

Why was this issue closed? I'm still seeing the bug in 2.3.1

@lykciv
Copy link

lykciv commented Jul 23, 2019

This is still a problem in version 2.3.2.

The bug is in the observer SaveDownloadableOrderItemObserver. The following patch should fix the problem

--- a/vendor/magento/module-downloadable/Observer/SaveDownloadableOrderItemObserver.php	(date 1563881877000)
+++ a/vendor/magento/module-downloadable/Observer/SaveDownloadableOrderItemObserver.php	(date 1563881877000)
@@ -86,7 +86,7 @@
             //order not saved in the database
             return $this;
         }
-        if ($orderItem->getProductType() != \Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE) {
+        if ($orderItem->getRealProductType() != \Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE) {
             return $this;
         }
         $product = $orderItem->getProduct();

@homer14b
Copy link

homer14b commented Nov 10, 2019

A patch should rather check both types (product type and real product type), like in SetLinkStatusObserver and SetHasDownloadableProductsObserver:

if ($orderItem->getProductType() !== \Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE && $orderItem->getRealProductType() !== \Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE) { return $this; } $product = $orderItem->getProduct();

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

10 participants