Force Login for Product Type
Hi,
Is there any way to create a new product type that will require a user to be logged in to checkout but will not require me to upload a file as part of the product when I create it?
Thanks,
Steve
Hello Steve,
To request the user to login set permissions to the page where the checkout widget is placed (the default permissions are for Everyone to view set it to Authenticated and it will request authentication).
Requiring authentication from the user for only one product type on the other hand is a tough one since all products on the site get added to the shopping cart and when there are products of a type that should require authentication and for a product that should not require authentication must the authentication be requested or skipped?
To have a product not validate the file selector field remove the validation from the client component of the control that is the file selector.
Refer to the attached files. They contain a custom field control for selecting downloadable files in products.
1. Set the build action of the two javascript files as EmbeddedResource.2
2. register the embedded resource in AssemblyInfo.cs
[assembly: WebResource("SitefinityWebApp.CustomProductFileSelector.IRequiresDataItem.js", "application/x-javascript")]
[assembly: WebResource("SitefinityWebApp.CustomProductFileSelector.CustomControl.js", "application/x-javascript")]
SitefinityWebApp.CustomProductFileSelector.CustomControl, SitefinityWebApp
Thanks for this Stanislav, was effortless to get this to work.
Much appreciated,
Clinton