Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Customizing Payment Feature

Quote Reply
Customizing Payment Feature
I have a section of a website where we have a classifieds environment where users can list items for sale or wanted.

We currently offer a 'premium membership' payment method whereby users get certain advanced features throughout the site, this is a global payment option related to their main profile and not to any one section, so falls in a different area than the 'payments' ability.

Currently our premium subscribers get their listings featured in a separate div box above the main listings in the classifieds.

We are looking to implement an environment which is separate from our current premium members one. We aim to have it so that users can pay a once off price (per listing) when listing a product, and have their ad displayed in a manner in which we choose.

I have gone through the process of setting up the payments settings and getting to the point of seeing the 'paid' ad doing as it should, displaying at the top of the links table.

The thing is... We want to modify where/how these once off paid links are displayed. Instead of merely displaying them at the top of the list, we want to make them display at the top of the page in a separate div area. The problem I'm having is that I am unable to locate the fields that get flagged to create such an option.

I have looked through the link property fields and I can see that our 'premium members' have the paid_status field set. But cannot find a yes/no type field for the once off payment type options.

What I'd like to do is basically create if statements that check whether the user paid for that particular ad as a once off payment, and if they did - display their ad in a unique way.

Any help with this will be greatly appreciated.

Last edited by:

meso: Oct 9, 2012, 1:24 AM
Quote Reply
Re: [meso] Customizing Payment Feature In reply to
Hi,

If I'm understanding you correctly, you want the <%if isPaidLink%> ... <%endif%> tag.

Hope that helps

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Customizing Payment Feature In reply to
Thanks Andy, that appears as though it may be the one.

I must ask though, when viewing the link properties within the admin interface this field is not visible, and thus creates some problems in testing the functionality on a live site without having the payment functionality live. Ideally I'd want to flag a test ad as a "isPaidLink" after submission for testing, though cannot see how this can be done.

Is the "isPaidLink" field one that can only be set through automation when a link payment is made?

Thanks again.
Quote Reply
Re: [meso] Customizing Payment Feature In reply to
Hi,

If you want to check if its paid for in the admin, you can do a SQL query:

Code:
SELECT * FROM glinks_Links WHERE ExpiryDate < 2147483647;

When ExpiryDate = 2147483647 that means its a free link. Anything less, and its paid for.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Customizing Payment Feature In reply to
Thanks again for your reply.

The isPaidLink is the right field I think - though that's what I'm trying to test, we want to do the testing on the front end of our site.

Just something along the lines of doing an <%if isPaidLink%> statement, and then if it returns positive - to display positive (paid links) in a certain manner different to what normal links are.

The problem I'm having (and bear with me, my knowledge is limited) is that ideally to test how these paid links are going to be displayed, we need to have several links with the 'isPaidLink' field flagged as a positive. But I am unable to find how I am able to manually flag the ispaidlink field.

For example, when we want to perform an if statement on one of our premium subscribers, I am able to go to (in the back end) any particular link a user has submitted, view the listing and then flag the paid_status to 'paid' and then from there I am able to call on that link to display with a simple <%if paid_status%>.

What I am hoping to do is something similar, but with the isPaidLink. But I'm unable to find where I can set the isPaidLink manually to a positive for such testing.

Thanks once again and apologies for any ignorance in the text above.
Quote Reply
Re: [meso] Customizing Payment Feature In reply to
Hi,

To make it paid, simply set the "Expiry Date" in the GLinks admin panel (Database > Links > Modify). Set it to maybe a year ahead, and then they should show up as paid Angelic

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Customizing Payment Feature In reply to
I should add that I have been testing with an expiry date set, for a year in advance. But while the expiry date field is set, there is still no sign of the 'isPaid' or 'isPaidLink' fields being set. I've done a full dump at the bottom of the detailed page in the hopes of finding these fields there, but there is no sign of an isPaid or isPaidLink in any of the dumped fields. Furthermore, the listings with the expiry date set, which should take priority in the listing by default, displaying above the regular links, doesn't seem to be doing so.

There are paid_status and comm_status, but both refer to the premium membership as opposed the single 'payment' option on the link.

I can provide an example of what I have and how I am testing:

http://www.dropzone.com/cgi-bin/classifieds/page.cgi?g=Aircraft%2Findex.html;d=1

On the page above, I have submitted 3 different test ads. One is submitted with the premium membership fields flagged (test 2), while 'test ad' is submitted with the premium membership off, but with the expiry date set to a future date. Finally I have 'test 3' which is a normal link submission without any special fields set.

In theory, the 'test 2' link should be at the top, as it is correctly, as a premium member listing. While 'test ad' should be directly below that, but still taking priority over the other free listings as I have an expiry date set on it, so it should be seen as a 'paid' link. Yet it is being seen as a regular link with the regular 'test 3' submission listing being higher due to chronology.

It feels like I may be a bit in over my head here with the insanity this is causing me.

As I'm testing on a live site, payments remain turned off- though I did try turning it on for a few seconds of testing with no luck.

Crazy
Quote Reply
Re: [meso] Customizing Payment Feature In reply to
I think I've managed to get what I want from this. Andy, using your input on how 2147483647 is a free link and anything less is paid - I've just crafted an if statement to basically say
Code:
<%if ExpiryDate < '2147483647'%>Paid<%else%>Free<%endif%>

I suspect this should be enough to be able to use for what I was hoping. It seems to be pulling through the right values.

Thanks for your help!
Quote Reply
Re: [meso] Customizing Payment Feature In reply to
Hi,

Yup:

Code:
<%if ExpiryDate < 2147483647%>Paid<%else%>Free<%endif%>

would also work (notice I removed the ' though, as they are not needed)

The reason its not showing on your pages is most likely because payments are disabled when you are testing it (they need to be "Enabled" in "Payment Options" for the isPaidLink tag to be generated)

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Customizing Payment Feature In reply to
Now that we understand how the payment system works, I have a question of a different nature related to customizing the payment feature.

Our desire is to have users be able to submit 3 free links in our classifieds - where after upon reaching this limit they will be required to choose a payment method for future links.

This seems like no easy task given that the system is working off a basic yes/no flag and an expiry date.

Is this something that is easily possible or going to take excessive development? If it's possible at all with the current way the payment systems work.

Thanks.
Quote Reply
Re: [meso] Customizing Payment Feature In reply to
Hi,

That sounds like it would be quite a lot of work TBH Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!