Skip to content

[7.x] Fix download URL not generated for digital line items / product variants#1251

Closed
morhi wants to merge 3 commits intoduncanmcclean:7.xfrom
morhi:patch-1
Closed

[7.x] Fix download URL not generated for digital line items / product variants#1251
morhi wants to merge 3 commits intoduncanmcclean:7.xfrom
morhi:patch-1

Conversation

@morhi
Copy link
Copy Markdown

@morhi morhi commented Nov 24, 2025

I noticed that when I mark a single variant as digital, the download URLs are not generated because the handler only looks for the digital flag on the product itself. This change means that the handler also recognises variants that are marked as digital, even if the product itself is physical.

@morhi morhi changed the title Fix download URL not generated for digital line items / product variants [7.x] Fix download URL not generated for digital line items / product variants Nov 24, 2025
@morhi
Copy link
Copy Markdown
Author

morhi commented Nov 24, 2025

@duncanmcclean Hey duncan, do you think it's possible to merge this change? Are the failing tests actually because of my change?

@duncanmcclean
Copy link
Copy Markdown
Owner

Some tests are passing - so I'm not sure. Just triggered a re-run.

I'll aim to take a look today/tomorrow - it's on my to-do list. If you need to use this fix before then, you could potentially look at using a composer patch.

@morhi
Copy link
Copy Markdown
Author

morhi commented Nov 24, 2025

That's totally fine. I don't need it today :) Thank you!

@duncanmcclean
Copy link
Copy Markdown
Owner

Actually, it looks like the is_digital_product toggle is left over from when digital products were handled by a separate addon.

Simple Commerce 6 replaced it with a product_type field on the "root" product instead (the actual downloads are variant-specific, just not whether the product is physical/digital).

An update script should have run during the upgrade process to update existing content.

I can't remember the reasoning behind the change, but I imagine it was so you didn't need to toggle "Is Digital Product" for each variant - which would be tedious if you have lots of variants.

If you have a physical product w/ downloads, you'd need to select "Product Type: Physical" and only select downloads for the digital variant. It shouldn't generate download links for variants without downloads.

@morhi
Copy link
Copy Markdown
Author

morhi commented Nov 24, 2025

Gotcha, that makes sense. I believe my blueprint's visibility for that field isn't correct, that's why I didn't figure out that it should work like you describe. Thanks for the hint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants