Skip Navigation

[Resolved] How do I do this?

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by chrisB-30 6 years, 7 months ago.

Author
Posts
#895879

Hi,

I am porting my site from Joomla/Sobipro over to WordPress/Toolset

I need to create a dynamic affiliate link that is created by looking at 2 different variables in the Post type called "Brides":

Agency - which is a taxonomy
ID# - which is a field

Each of the "Agencies" have a different linking structure for their affiliate links. So, I first need to look at which "Agency" the entry is associated with then, depending on the outcome, I need to create a custom url by inserting the "ID#" of the entry into the url of the affiliate link.

It is even more complicated because most of the URLs need to have the ID# dynamically inserted into the middle of the URL, like this:

hidden link

I am currently using Joomla/SobiPro to do this.

Here is a snippet of the code that Sobipro uses to generate the dynamic urls to give you a better idea of what I'm talking about - I do not want to use this code in Toolset - so please dont tell me that you don't debug 3rd party apps like the last support guy - this is just included as an example of what I did before.
--------------------------------------------
<xsl:choose>
<xsl:when test="entry/fields/field_agencies/data = 'Amolatina' ">
<xsl:attribute name="href">
<xsl:text>hidden link;

<xsl:value-of select="entry/fields/field_id/data"/>

<xsl:text>%26afid%3D20103%26subafid%3D{affiliate_id}%26transaction-id%3D{transaction_id}%26offer-id%3D{offer_id}</xsl:text>
</xsl:attribute>
</xsl:when>

<xsl:when test="entry/fields/field_agencies/data = 'Anastasia' ">
<xsl:attribute name="href">
<xsl:text>hidden link;

<xsl:value-of select="entry/fields/field_id/data"/>

<xsl:text>%26afid%3D20068%26subafid%3D{affiliate_id}%26transaction-id%3D{transaction_id}%26offer-id%3D{offer_id}%26RMC%3D{aff_sub}%26utm_source%3DHasOffers%26utm_medium%3DCPA%26utm_campaign%3DFirstOrder</xsl:text>
</xsl:attribute>
</xsl:when>

-------------------------------------------

I would like to output the finished URL as a shortcode so I can use it to add the link to an image in my main content template.

I have been trying to figure this out for 2 days now - could you take a look and see if you can lead me in the right direct. If you can just give me a basic overview of how you would achieve this I could probably figure out the particulars by myself.

Thanks!

internationallovescout.info/wp-admin
ChrisB
test99

#896808

Hi Chris,

I'm Mohammed, he Toolset support team leader.

I see your request and I see the other one that Minesh was working with you on.

We are sorry for any inconvenience. but after I we discussed the issue with Minesh, we found that we can work on it and possibly we can produce a solution.

Minesh is one of the best supporters so no worries to work with him.

So, please close this ticket and continue with Minesh in the previous one.

Thanks.

#900922

Minesh solved the problem in simple elegant way.
Thanks Alot!