Affilite phone orders

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ThinkNoodle
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 33
Joined: Fri Oct 10, 2008 7:14 am
Location: UK

Affilite phone orders

Post by ThinkNoodle » Mon May 24, 2010 7:07 am

Hi
Does anyone know if there is a graceful way of attributing phone orders to an affiliate via the back end?

I don't want to have to go to the shop via an affilite link and put the order through as if I was the customer...

Thanks

Matt

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Affilite phone orders

Post by mazhar » Mon May 24, 2010 10:26 am

There isn't any thing out of the box right now for this. May be you can do some custom code to accomplish this some where in merchant side order placement procedure. Here is a suggested mod may be it workout your scenario. Edit Website/Admin/Orders/Create/CreateOrder4.aspx and locate following line

Code: Select all

<asp:ValidationSummary ID="PaymentValidationSummary" runat="server" EnableViewState="false" ValidationGroup="OPC" />

and replace it with

Code: Select all

<br />
                    <asp:Label ID="AffiliateLabel" runat="server" AssociatedControlID="Affiliate" Text="Referred By: "></asp:Label>
                    <asp:DropDownList ID="Affiliate" runat="server" AppendDataBoundItems="true" DataSourceID="AffiliateDS" DataTextField="Name" DataValueField="AffiliateId">
                        <asp:ListItem Selected="True" Value="0" Text="No Affliate"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:Label ID="ReferredDate" runat="server" Text=""></asp:Label>
                    <asp:ObjectDataSource ID="AffiliateDS" runat="server" SelectMethod="LoadForStore" TypeName="CommerceBuilder.Marketing.AffiliateDataSource" DataObjectTypeName="CommerceBuilder.Marketing.Affiliate">
                        <SelectParameters>
                            <asp:Parameter Name="sortExpression" DbType="String" DefaultValue="Name" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:ValidationSummary ID="PaymentValidationSummary" runat="server" EnableViewState="false" ValidationGroup="OPC" />
Then edit your Website/Admin/Orders/Create/CreateOrder4.aspx.cs and locate following line of code

Code: Select all

// REDIRECT TO THE FINAL ORDER
Response.Redirect("~/Admin/Orders/ViewOrder.aspx?OrderId=" + response.OrderId + "&OrderNumber=" + response.OrderNumber);
and replace it with

Code: Select all

int affiliateId = AlwaysConvert.ToInt(Affiliate.SelectedValue);
            if(affiliateId > 0)
            {
                Order order = OrderDataSource.Load(e.OrderId,false);
                order.AffiliateId = affiliateId;
                order.Save();
            }
            // REDIRECT TO THE FINAL ORDER
            Response.Redirect("~/Admin/Orders/ViewOrder.aspx?OrderId=" + response.OrderId + "&OrderNumber=" + response.OrderNumber);
Save the changes. Now try placing some order from merchant side. You will see on last screen option for affiliate selection will be available to you. If you choose some affiliate and then place order. Newly placed order will be associated to selected affiliate.

ThinkNoodle
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 33
Joined: Fri Oct 10, 2008 7:14 am
Location: UK

Re: Affilite phone orders

Post by ThinkNoodle » Thu May 27, 2010 5:56 am

Many thanks, that worked fine after one change, DbType to Type as below:

before <asp:Parameter Name="sortExpression" DbType="String" DefaultValue="Name" />

after <asp:Parameter Name="sortExpression" Type="String" DefaultValue="Name" />

Thanks again

Matt

Post Reply