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
Affilite phone orders
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 33
- Joined: Fri Oct 10, 2008 7:14 am
- Location: UK
Re: Affilite phone orders
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
and replace it with
Then edit your Website/Admin/Orders/Create/CreateOrder4.aspx.cs and locate following line of code
and replace it with
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.
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" />
Code: Select all
// REDIRECT TO THE FINAL ORDER
Response.Redirect("~/Admin/Orders/ViewOrder.aspx?OrderId=" + response.OrderId + "&OrderNumber=" + response.OrderNumber);
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);
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 33
- Joined: Fri Oct 10, 2008 7:14 am
- Location: UK
Re: Affilite phone orders
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
before <asp:Parameter Name="sortExpression" DbType="String" DefaultValue="Name" />
after <asp:Parameter Name="sortExpression" Type="String" DefaultValue="Name" />
Thanks again
Matt