Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreCreate Articles dynamically from custom moduleCreate Articles dynamically from custom module
Previous
 
Next
New Post
1/21/2013 4:16 PM
 

Hello,
i'd like to following ...

I developed my own dnn-modul. This modul allows to create a pdf from database-informations and user-inputs.
Bevore the use can get the pdf ... i must be payed.

I'd like to create an article from my module and put it in the store ... where the users can buy this pdf (its no problem when other users can buy same pdf also).

Does the store module support this ?
Or can i use a stored procedure to do this ?
When no ... is there another store-module where i can do this ?

Regards

Jürgen

 
New Post
1/22/2013 1:43 AM
 

Hi Jürgen,

You can do this with the Store module. I can't tell you exactly how for now because I have to go to my work, but I will prepare a step by step for tomorrow! It's never a good idea to call directly SP from your code. Because the Store module make use of the cache for performance, you product will be added to the db but not displayed! :-) Basicaly, you have to add two references in your module project and call a few methods.

In the meanwhile, you can download the last version of the Store module at Codeplex, follow the installation guide then in the Store Admin module set the 'Checkout Mode' setting as 'Registration Required' (your user need to have an account to get access to his downloads) and check the 'Allow Virtual Product' setting.

Gilles


We (team members) are Humans offering their knowledge, their work and their spare time FOR FREE to benefit the community. It would be so particularly appreciated that your messages begin with "Hello" and end with "Thank you" or any other form of politeness. Ask yourself what your reaction would be, if you were approached by me (a total stranger) on the street to ask you something without saying "Hello" nor "Thank you"? After several years of services dedicated to the community, I begin to be tired to read requests without any form of politeness.
 
New Post
2/9/2013 9:05 AM
 

Hi Jürgen,

Sorry for the delay, but I was sick for a week with the flu! :-(

To add a product in the catalog, you need a category. Because the product is linked to a category by his ID, you should select and store the category in your module settings, then get this category ID from settings and add your product from your module view.

Here a step by step to do it:

1) Add a reference to DotNetNuke.Modules.Store.Catalog.dll to your project
2) In your settings control:
    - Add a using directive to DotNetNuke.Modules.Store.catalog
    - Place a DropDownList and name it "ddlCategories"
    - In the LoadSettings() method, add the following code to fill the DropDownList:

        CategoryController categoryController = new CategoryController();
        ddlCategories.DataTextField = "Name";
        ddlCategories.DataValueField = "CategoryId";
        ddlCategories.DataSource = categoryController.GetCategories(PortalId, false, Null.NullInteger);
        ddlCategories.DataBind();

    - In the UpdateSettings() method, save the selected category:

        ModuleController objModules = new ModuleController();
        objModules.UpdateTabModuleSetting(TabModuleId, "CategoryID", ddlCategories.SeletedValue);

3) In your module view, add a using directive to DotNetNuke.Modules.Store.catalog and the following code to create a product inside this category:

        ProductController productController = new ProductController();
        ProductInfo product = new ProductInfo();
        product.PortalID = PortalId;
        product.CategoryID = Int32.Parse(Settings["CategoryID"]);
        product.ModelName = "My product";
        product.UnitCost = 10;
        productController.AddProduct(product);

Gilles


We (team members) are Humans offering their knowledge, their work and their spare time FOR FREE to benefit the community. It would be so particularly appreciated that your messages begin with "Hello" and end with "Thank you" or any other form of politeness. Ask yourself what your reaction would be, if you were approached by me (a total stranger) on the street to ask you something without saying "Hello" nor "Thank you"? After several years of services dedicated to the community, I begin to be tired to read requests without any form of politeness.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreCreate Articles dynamically from custom moduleCreate Articles dynamically from custom module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out