Magento2: Sample Files for Unsalable Products Redirect Instead of Download

Created on 9 Jul 2019  路  16Comments  路  Source: magento/magento2

Preconditions (*)

  1. 2.4-develop
  2. Set Stores->Catalog->Inventory->Stock Options->Display Out of Stock Products=Yes

Steps to reproduce (*)

  1. Login to admin
  2. Go to Catalog-->Products
  3. Select 'Downloadable product' from 'Add product' button dropdown
  4. Fill all required inputs
  5. Set product status to 'Out to stock'
  6. Go to 'Downloadable information' tab
  7. Press 'Add link' button under a Samples
  8. Add any test file
  9. Save a product
  10. Go to the product page on the frontend
  11. Press on link under 'Samples'

Expected result (*)

  1. By default, the sample file should be downloaded. Products that are not currently for sale should still allow customers to download samples.

Actual result (*)

  1. New tab is opened. No download is started and no explanation is given.
Downloadable Fixed in 2.4.x Clear Description Confirmed Format is valid Ready for Work P3 Reproduced on 2.4.x S3

Most helpful comment

Hello @ihor-sviziev
Manual testing scenario:

  1. Login to admin
  2. Go to Catalog-->Products
  3. Select 'Downloadable product' from 'Add product' button dropdown
  4. Fill all required inputs
  5. Set product status to 'Out to stock'
  6. Go to 'Downloadable information' tab
  7. Press 'Add link' button under a Samples
  8. Add any test file
  9. Save a product
  10. Go to the product page on the frontend
  11. Press on link under 'Samples'

Expected result:
By default, the sample file should be downloaded. Products that are not currently for sale should still allow customers to download samples.

Actual result:
New tab is opened. No download is started and no explanation is given.

All 16 comments

Hi @samuel-reinhardt. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@samuel-reinhardt do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

@magento give me 2.3-develop instance

Hi @samuel-reinhardt. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @samuel-reinhardt, here is your Magento instance.
Admin access: https://i-23638-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

This issue is not present on 2.2-develop or 2.3-develop. 2.2 and 2.3 releases do contain the issue however. It is due to this commit in which a salable check is added to the sample downloads logic.
https://github.com/magento/magento2/commit/9498c975b45999b4aba69568f6be1457116d702f#diff-3ce343f8897fe36416d4a848dab0a7da

:white_check_mark: Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-17998, MC-17999 were created

Issue Available: @engcom-Charlie, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Hi @geet07. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


Hi @samuel-reinhardt and @engcom-Charlie,

Following commit https://github.com/magento/magento2/commit/484c8530afe0a2003d9f52517f64131ae04ac722 added check that product is salable, while following MFTF test https://github.com/magento/magento2/blob/e93feb02398f158f79fefb14de95cf93e3ec0786/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml#L15 describes that it should check that product is enabled.

Actually for product we have 4 params that could affect product visibility on frontend:

  1. Status
  2. Visibility
  3. Association with website
  4. Stock status (on some websites we could enable showing out of stock products)

Maybe there even more.

Could you clarify what exact steps to reproduce this issue?

Thank you

Hello @ihor-sviziev
Manual testing scenario:

  1. Login to admin
  2. Go to Catalog-->Products
  3. Select 'Downloadable product' from 'Add product' button dropdown
  4. Fill all required inputs
  5. Set product status to 'Out to stock'
  6. Go to 'Downloadable information' tab
  7. Press 'Add link' button under a Samples
  8. Add any test file
  9. Save a product
  10. Go to the product page on the frontend
  11. Press on link under 'Samples'

Expected result:
By default, the sample file should be downloaded. Products that are not currently for sale should still allow customers to download samples.

Actual result:
New tab is opened. No download is started and no explanation is given.

Hi @engcom-Charlie,
Maybe we're missing something, but looks like expected result is conflicting with following MFTF test:
https://github.com/magento/magento2/blob/e93feb02398f158f79fefb14de95cf93e3ec0786/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml

If it's not conflicting - could you give us more info from MC-15845 and MC-14824 to understand whole picture?

@engcom-Charlie,
Looks I found the diff. Sample file should not be available when product Status "Enabled". So now everything is clear.
Sorry for misunderstanding

Hi @engcom-Delta. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

:white_check_mark: Confirmed by @engcom-Delta
Thank you for verifying the issue. Based on the provided information internal tickets MC-35455 were created

Issue Available: @engcom-Delta, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Hi @engcom-Charlie. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

Hi @samuel-reinhardt. Thank you for your report.
The issue has been fixed in magento/magento2#28898 by @engcom-Charlie in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.1 release.

Was this page helpful?
0 / 5 - 0 ratings