Disabling Purchase of Downloadable Products Unless Registered

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
I am running into the issue that people buy a downloadable product on the site and check out as a guest. In this case, they do not have a My Account > Downloadable Products page to go to when they need to download the product. We do need to allow people to checkout as a guest for other purchases. I am assuming there has to be something to deal with this, but I have not found it.  Is there a way to require login to purchase downloadable products?

Thanks!
Shanea
12 anni tempo fa
No, but download product URL is included in the order confirmation email (once it's paid).
12 anni tempo fa
This is not being sent in our emails.

I just glanced through some release notes.. is this a new feature in 2.4? We are on 2.3.

If that is not the case, please continue on.

I looked at the available tokens and I am either not finding the correct token or have a syntax error. When the email is sent, the token %Product.ProductURLForCustomer% is not resolved to the actual URL and just displays as text in the link.

Example (part of) email content:

If you have ordered a downloadable product please click <a href="https://www.prairiewinddecoys.com/customer/downloadableproducts">here</a> to download your products or click <a href="%Product.ProductURLForCustomer%">here</a> if you were not registered.


Do you see what my issue is?

Thanks!
Shanea
12 anni tempo fa
Right, it was added in version 2.40
12 anni tempo fa
I just upgraded to 2.4 this weekend, but I am still not getting a link in the emails.

The emails being received by the customer are as below and both have been customized in previous versions.

OrderPlaced.CustomerNotification
OrderCompleted.CustomerNotification

Am I missing an email or what else might not be correct?

Thanks!
Shanea
12 anni tempo fa
skolbrenash wrote:
...both have been customized in previous versions.

1. Open \Libraries\Nop.Services\Messages\MessageTokenProvider.cs file (version 2.40)
2. Find 'ProductListToHtmlTable' method
3. It has the following code
//add download link
                if (_downloadService.IsDownloadAllowed(opv))
                {
                    //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
                    string downloadUrl = string.Format("{0}download/getdownload?opvId={1}", _webHelper.GetStoreLocation(false), opv.OrderProductVariantGuid);
                    string downloadLink = string.Format("<a class=\"link\" href=\"{0}\">{1}</a>", downloadUrl, _localizationService.GetResource("Messages.Order.Product(s).Download", languageId));
                    sb.AppendLine("&nbsp;&nbsp;(");
                    sb.AppendLine(downloadLink);
                    sb.AppendLine(")");
                }

Do the same in your customized template.
P.S. Keep in mind that the download link is visible only when a download of a certain product is allowed (_downloadService.IsDownloadAllowed(opv)).
P.P.S. There was an issue with wrong locale resource in version 2.40. It was fixed in changeset 02a746ffe23d
12 anni tempo fa
Finally got this to work earlier this week after applying the changeset. Thanks!
11 anni tempo fa
Hi,
I have a query related to this but slightly different. We need to have guest checkout disabled if a free promotional product is added to the cart. That is, the customer needs to register if they want to receive the free promotional product. We still want guest checkout enabled though if the customer is ordering only paid for products.  Is this functionality already built in as a configurable option? Otherwise we will have to make a customization for this.

Thanks :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.