Developer forum

Forum » Ecommerce - Standard features » Newsletter subscription in order process

Newsletter subscription in order process

Thomas Schroll
Reply

Hi

I have tried to make a checkbox for newsletter subscription in step 3 of 5 of the order process, but the user is not created. When I use the forms module it is not necessary to have extranet module on the same page, but do I need it on the basket page? Can anybody see what I am doing wrong? The snippet is knicked from Mikkel Ricky's templates on github.

Regards Thomas

            @if (GetBoolean("Ecom:Cart.UseNewsletterSubscription"))
            {
                <fieldset>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <legend><h4>@Translate("Newsletter", "Nyhedsbrev")</h4></legend>
                            <input class="form-control" type="hidden" name="EcomOrderSubscribeToNewsletter" />
                            <div class="checkbox">
                                <label for="EcomOrderSubscribeToNewsletter">
                                    <input type="checkbox" name="EcomOrderSubscribeToNewsletter" id="EcomOrderSubscribeToNewsletter" checked='@GetBoolean("Ecom:Order.Customer.NewsletterSubscribe")' />
                                    @Translate("Subscribe_to_newsletter", "Tilmeld nyhedsbrev")
                                </label>
                            </div>
                        </div>
                    </div>
                </fieldset>
            }


Replies

 
Vladimir
Reply

Hi Thomas,

The snippet seems good.. newsletter should be sent...
What version of DW do you have - as I remember there was a related bug with subscription in < DW8.4.1v? 

And what checkouthandler do you use?

Best regards,

Vladimir

 
Thomas Schroll
Reply

Hi Vladimir

I have just upgraded from 8.5.1.4 to 8.6.1.7 but there is still no user created. Do the email field in the template need a specific name or id? Do I need to have a specific group in user management? How do dw know which fields should be used to create a new user?

The setup is standard dw Shopping Cart v2 (eCom). I use the steps: Show cart, Information, Confirm, Checkout, Receipt

The newsletter subscription is in the Information step.

Regards Thomas

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Thomas,

You have two controls called EcomOrderSubscribeToNewsletter (a hidden field and a checkbox). Maybe that confuses Dynamicweb as it sends an additional comma in the request? I think you only need the checkbox.

Cheers,

Imar

 

 
Vladimir
Reply

The required conditions:

  1. cart module settings: "Use email subscription" - checked
  2. cart module settings: "Categories" - select some categories
  3. order fields CustomerName and CustomerEmail are filled

The user is created after succesfull returning from payment (order is completed) 

 
Thomas Schroll
Reply

Thanks Imar, but that wasn't it. there is still no user created.

Thanks Vladimir, 1: is checked, 2: I do not have any categories in the cart module, only the checkbox, 3: In the template EcomOrderCustomerName and EcomOrderCustomerEmail is filled. Should that be CustomerName and CustomerEmail instead?

The shop does not use any payment provider. The 2 payments are invoicing and the setup in management center is 'Cart type: none'.

Regards Thomas

 
Vladimir
Reply

no no, the fields are right.

Problem is that there are no categories to subscribe....

 
Vladimir
Reply

ps: I'm not sure but maybe "Create user during checkout" functionality will be more suitable for you:

http://manual.dynamicweb-cms.com/Dynamicweb-eCommerce/Modules/Shopping-Cart-v2/Paragraph-settings.aspx

 
Thomas Schroll
Reply

Hi Vladimir

I neither have the categories button or the create user section. I will create a support case, and let them look at it.

Thanks.

Regards Thomas

 
Anders Ebdrup
Reply

Hi Thomas,

 

What was the result of this?

 

Best regards, Anders

 

You must be logged in to post in the forum