ShareASale Affiliate Marketing include

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

ShareASale Affiliate Marketing include

Post by William_firefold » Wed Nov 05, 2008 1:02 pm

I have been racking my brain trying figure out how to do this in Able but have had no luck.
We have an affiliate marketer we want to use and they are going to have tracking access to our orders when they complete. The problem is that their tracker is an image with image src= a link with GET params in it. How can I output a 1x1 px image with a image src with variables from able in the url. Example below:

Code: Select all

public string MakeShareASaleString(){
	return("<IMG width=\"1\" height=\"1\" SRC='https://shareasale.com/sale.cfm?amount="+ Order.TotalCharges.ToString() +"&tracking="+_OrderId.ToString()+"&transtype=sale&merchantID=#####\'>");
	}
This is what they gave us. All it has to do is appear on the page.

Code: Select all

<img src="https://shareasale.com/sale.cfm?amount=AMOUNTOFSALE&tracking=TRACKINGNUMBER&transtype=TYPEOFTRANSACTION&merchantID=#####" width="1" height="1">

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

Re: ShareASale Affiliate Marketing include

Post by mazhar » Thu Nov 06, 2008 6:47 am

Give a try and create property into your page as below

Code: Select all

public string GetImage 
    {
        get 
        {
            string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + order.TotalCharges.ToString() + "&tracking=" + order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
            return image;
        }
    }
and then you can put the image into the page as below

Code: Select all

<% = GetImage %>

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: ShareASale Affiliate Marketing include

Post by William_firefold » Thu Nov 06, 2008 7:47 am

This worked. Thank you very much.

Note: I had to use _Order instead of order

Code: Select all

            string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + _Order.TotalCharges.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=####\" />";

kwanzz
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Mon Jul 14, 2008 7:09 pm

Re: ShareASale Affiliate Marketing include

Post by kwanzz » Fri Nov 14, 2008 7:16 pm

I have the same problem. Did you simply go to "Administration > Website > Content and Layout > Edit Scriptlet" in the Merchant admin and put both sets of code that mazhar provided into the content section of the receipt page?

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

Re: ShareASale Affiliate Marketing include

Post by mazhar » Sat Nov 15, 2008 5:06 am

I have the same problem. Did you simply go to "Administration > Website > Content and Layout > Edit Scriptlet" in the Merchant admin and put both sets of code that mazhar provided into the content section of the receipt page?
No this needs to be placed in ConLib/Recieptpage control. First edit the ConLib/Recieptpage.ascx.cs file and find following lines of code

Code: Select all

private int _OrderId;
private Order _Order;
then add the below code just under them

Code: Select all

public string GetImage
    {
        get
        {
            string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + _Order.TotalCharges.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
            return image;
        }
    }
Save the file and then edit the ConLib/RecieptPage.ascx file and place the image code where you want to show the image for example you can place it just under the following line of code

Code: Select all

<%@ Register Src="~/Checkout/AffiliateTracker.ascx" TagName="AffiliateTracker" TagPrefix="uc" %>
like

Code: Select all

<%@ Register Src="~/Checkout/AffiliateTracker.ascx" TagName="AffiliateTracker" TagPrefix="uc" %>
<% = GetImage %>

kwanzz
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Mon Jul 14, 2008 7:09 pm

Re: ShareASale Affiliate Marketing include

Post by kwanzz » Mon Nov 24, 2008 8:10 pm

I had managed to get it to work with a little trial and error but thanks for the reply!

User avatar
AlexG
Commander (CMDR)
Commander (CMDR)
Posts: 128
Joined: Mon Mar 03, 2008 9:51 pm
Location: StealDeals.com
Contact:

Re: ShareASale Affiliate Marketing include

Post by AlexG » Tue Feb 10, 2009 10:33 am


Opeyemi
Ensign (ENS)
Ensign (ENS)
Posts: 17
Joined: Fri Feb 22, 2008 12:07 pm
Location: Blue Bell, PA
Contact:

Re: ShareASale Affiliate Marketing include

Post by Opeyemi » Mon Mar 02, 2009 12:50 pm

Does "_Order.TotalCharges.ToString()" include shipping & sales tax? If it does, what is the variable without shipping & sales tax?

thanks

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

Re: ShareASale Affiliate Marketing include

Post by mazhar » Tue Mar 03, 2009 11:49 am

Opeyemi wrote:Does "_Order.TotalCharges.ToString()" include shipping & sales tax? If it does, what is the variable without shipping & sales tax?

thanks

Code: Select all

OrderItemType[] orderItemTypes = new OrderItemType[]{OrderItemType.Charge,OrderItemType.Coupon,OrderItemType.Credit,OrderItemType.Discount,OrderItemType.GiftCertificate,OrderItemType.GiftCertificatePayment,OrderItemType.GiftWrap,OrderItemType.Handling,OrderItemType.Product};
        LSDecimal totalExcludingShippingAndTaxes = order.Items.TotalPrice(orderItemTypes);

archeie
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Tue May 06, 2008 11:53 pm

Re: ShareASale Affiliate Marketing include

Post by archeie » Tue Jul 28, 2009 12:31 am

I modified the two pages mentioned above with your coding, but im stuck on modifying the code to not include sales tax or shipping in the total price calculation.

I put the following code inside page ConLib/Recieptpage.ascx.cs

Code: Select all

public string GetImage
    {
        get
        {
            string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + _Order.TotalCharges.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
            return image;
        }
    }


and the following code in ConLib/RecieptPage.ascx

Code: Select all

<% = GetImage %>

However can you explain exactly how we modify the coding to not include the shipping or sales tax figures in the total pricing calculation. where do we put the following code to not include sales tax or shipping

Code: Select all

OrderItemType[] orderItemTypes = new OrderItemType[]{OrderItemType.Charge,OrderItemType.Coupon,OrderItemType.Credit,OrderItemType.Discount,OrderItemType.GiftCertificate,OrderItemType.GiftCertificatePayment,OrderItemType.GiftWrap,OrderItemType.Handling,OrderItemType.Product};
        LSDecimal totalExcludingShippingAndTaxes = order.Items.TotalPrice(orderItemTypes);


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

Re: ShareASale Affiliate Marketing include

Post by mazhar » Tue Jul 28, 2009 3:50 am

Try following code

Code: Select all

public string GetImage
    {
        get
        {
OrderItemType[] orderItemTypes = new OrderItemType[]{OrderItemType.Charge,OrderItemType.Coupon,OrderItemType.Credit,OrderItemType.Discount,OrderItemType.GiftCertificate,OrderItemType.GiftCertificatePayment,OrderItemType.GiftWrap,OrderItemType.Handling,OrderItemType.Product};
        LSDecimal totalExcludingShippingAndTaxes = _Order.Items.TotalPrice(orderItemTypes);


            string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + totalExcludingShippingAndTaxes.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
            return image;
        }
    }


mpullmann
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Tue Feb 16, 2010 6:19 pm

Re: ShareASale Affiliate Marketing include

Post by mpullmann » Tue Feb 16, 2010 6:26 pm

I do not know where is the problem - I did all the step but the pixel is not outputted at "thank you" page. It looks like <% = GetImage %> doesn't call anything even I created function GetImage in ReceiptPage.aspx.cs file. Am I doing something wrong?

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

Re: ShareASale Affiliate Marketing include

Post by mazhar » Wed Feb 17, 2010 9:59 am

mpullmann wrote:I do not know where is the problem - I did all the step but the pixel is not outputted at "thank you" page. It looks like <% = GetImage %> doesn't call anything even I created function GetImage in ReceiptPage.aspx.cs file. Am I doing something wrong?
I have posted a widget for PostAffiliatePro here in this thread
viewtopic.php?f=42&t=13217&p=56881#p56881

mpullmann
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Tue Feb 16, 2010 6:19 pm

Re: ShareASale Affiliate Marketing include

Post by mpullmann » Wed Feb 17, 2010 4:49 pm

Thanks Mazhar, you're a king ;)

But, could you tell me why previous solution didn't work for me?

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

Re: ShareASale Affiliate Marketing include

Post by mazhar » Thu Feb 18, 2010 5:14 am

I don't know may be you have missed something if you were trying to copy/paste it. The information you updated above shows that ASP.NET was unable to parse the script and was considering it text.


Post Reply