latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Do shortcode conditionals interfere with form

Home Forums Community Forum Do shortcode conditionals interfere with form

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 3 years, 7 months ago.

Topic Author Topic
Posted: Friday May 24th, 2013 at 2:15 pm #50564
TJ
Username: wellwater

On very rare cases I have incidents where a user places a duplicate order for the same item, which I later have to void. What I decided to do was put a shortcode conditional check on the checkout pages that will determine if they’re currently logged in, have s2member level 1, and already have access to the custom capability. If they meet all three criteria I’ll print out a warning that they do not need to initiate an unnecessary duplicate order.

I went about it this way on the checkout page:

[s2If is_user_logged_in() AND current_user_is(s2member_level1) AND current_user_can(access_s2member_ccap_personalapp)]
  <p>PUT NOTICE HERE</p>
[/s2If]

[s2Member-Pro-AuthNet-Form ...]

It appears to work fine, but I’m just curious if this can cause any silent conflict with the s2member pro form shortcode? Could there be any interference or collision that could occur within the PHP code that might be problematic? Something that could cause checkouts to fail or render improperly?

Thanks.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Friday May 24th, 2013 at 11:29 pm #50605

I don’t know that it’d cause you any trouble.

And if you use a PHP conditional, you can show the warning or the pro-form using an [hilite mono]else[/hilite], instead of showing the warning above the pro-form. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals[/hilite]

[hilite pre_code]

NOTICE: you already have this ccap

[s2Member-Pro-AuthNet-Form ...]

[/hilite]
Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.