• Resolved vah330

    (@vah330)


    I am using MyCred with Paid Membership Pro and the myCred Paid Membership Pro Addon.

    I recently upgraded to MyCred Version 2.4.5.4 with Addon Version 1.0.2 and PMP Version 2.8.3

    Ever since the upgrade the [mycred_show_if… shortcodes stopped working. The tags disappear from my WP pages but are not executed. For example I had:

    [mycred_show_if balance=”0″ types=”warnings”][mycred_total_balance types=”warning”] Warnings issued[/mycred_show_if]

    and on the resulting page I get BOLDED:

    [mycred_total_balance types=”warning”] Warnings issued

    The enclosed shortcode ‘mycred_total_balance’ isn’t executed either. If I have the [mycred_total_balance types=”warning”] shortcode on a separate line, it displays “1” (a correct result – without the quotes)

    It worked as expected previously. I don’t know what is responsible so I can look into it further.

    Help?

Viewing 15 replies - 1 through 15 (of 40 total)
  • A.Tariq

    (@arsalantariq)

    @vah330,

    Thank you for contacting us, In mycred_show_if shortcode, you cannot render a shortcode inside mycred_show_if. If you simply write text inside the shortcode it will be rendered.

    [mycred_show_if balance=0 types=”warnings”]Warnings issued[/mycred_show_if]

    It will work.

    Thread Starter vah330

    (@vah330)

    It used to work previously that way (I was using it!) but now even this simple code does NOT work.

    [mycred_show_if balance=0 types=”warnings”]0 Warnings issued[/mycred_show_if]

    [mycred_show_if balance=1 types=”warnings”]1 Warnings issued[/mycred_show_if]

    [mycred_show_if balance=2 types=”warnings”]2 Warnings issued[/mycred_show_if]

    I have 1 warnings on the account in use and the output of those tags is:

    0 Warnings issued 1 Warnings issued 2 Warnings issued

    One or the other shouldn’t be displaying on the page, right? But all still are. No nested tags being used.

    Dan O.

    • This reply was modified 2 years, 9 months ago by vah330.
    • This reply was modified 2 years, 9 months ago by vah330.
    • This reply was modified 2 years, 9 months ago by vah330.
    Thread Starter vah330

    (@vah330)

    I also have 3 Credits (the default). I added this page code:

    Credits = [mycred_total_balance types=”mycred_default”]

    [mycred_show_if balance=0 types=”mycred_default”]0 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=5 types=”mycred_default”]5 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=10 types=”mycred_default”]10 Credits remaining[/mycred_show_if]

    and the output is:

    Credits = 3

    0 Credits remaining
    5 Credits remaining
    10 Credits remaining

    Something is wrong.

    A.Tariq

    (@arsalantariq)

    @vah330,

    Please use the updated plugin attached below also do let us know how it works for you.

    Download Link: https://we.tl/t-r0OnHLZWeq

    Thread Starter vah330

    (@vah330)

    Thanks. I have download the files and will let you know the results.

    • This reply was modified 2 years, 9 months ago by vah330.
    Thread Starter vah330

    (@vah330)

    I have uploaded the new files and tested it. While the [mycred_show_if balance.. tags now appear to work for the default myCred type, it isn’t working for the secondary myCred type I’ve also set up.

    This is the code tested:

    Warnings = [mycred_total_balance types=”warning”]
    Credits = [mycred_total_balance types=”mycred_default”]

    [mycred_show_if balance=0 types=”mycred_default”]0 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=5 types=”mycred_default”]5 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=10 types=”mycred_default”]10 Credits remaining[/mycred_show_if]

    [mycred_show_if balance=”1″ types=”mycred_default”]Display this: [mycred_total_balance types=”mycred_default”] unused search credits.[/mycred_show_if]

    [mycred_show_if balance=0 types=”warning”]0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=1 types=”warning”]1 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=2 types=”warning”]2 Warnings issued[/mycred_show_if]

    This is the result:

    Warnings = 1
    Credits = 9

    0 Credits remaining

    5 Credits remaining

    Display this: 9 unused search credits.

    0 Warnings issued

    1 Warnings issued

    2 Warnings issued

    Additionally, should [mycred_show_if balance=0 types=”mycred_default”] tag have matched a mycred_default balance of 9?

    A.Tariq

    (@arsalantariq)

    @vah330,

    Please use the below-shared plugin and do let us know how it is working for you.

    Download Link: https://we.tl/t-M3DoUgfhyQ

    Thread Starter vah330

    (@vah330)

    Thanks but it’s still not working. This is the code on the page (still):

    
    
    Warnings = [mycred_total_balance types="warning"]
    Credits = [mycred_total_balance types="mycred_default"]
    
    [mycred_show_if balance=-1 types=”mycred_default”]0 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=5 types=”mycred_default”]5 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=10 types=”mycred_default”]10 Credits remaining[/mycred_show_if]
    
    [mycred_show_if balance=1 types="mycred_default"]Display this: [mycred_total_balance types="mycred_default"] unused search credits.[/mycred_show_if]
    
    [mycred_show_if balance=-1 types=”warning”]-0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=0 types=”warning”]0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=1 types=”warning”]1 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=2 types=”warning”]2 Warnings issued[/mycred_show_if]
    
    

    This is the resulting page:

    Warnings = 1
    Credits = 9

    5 Credits remaining

    Display this: 9 unused search credits.

    0 Warnings issued

    1 Warnings issued

    2 Warnings issued

    • This reply was modified 2 years, 9 months ago by vah330.
    A.Tariq

    (@arsalantariq)

    @vah330,

    You are passing the wrong attributes in the mycred_show_if short code. See the below example.

    Warnings = [mycred_total_balance types="warning"]
    Credits = [mycred_total_balance types="mycred_default"]
    
    [mycred_show_if balance=-1 ctype="mycred_default"]0 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=5 ctype="mycred_default"]5 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=10 ctype="mycred_default"]10 Credits remaining[/mycred_show_if]
    
    [mycred_show_if balance=1 ctype="mycred_default"]Display this: [mycred_total_balance types="mycred_default"] unused search credits.[/mycred_show_if]
    
    [mycred_show_if balance=-1 ctype="warning"]-0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=0 ctype="warning"]0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=1 ctype="warning"]1 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=2 ctype="warning"]2 Warnings issued[/mycred_show_if]
    Thread Starter vah330

    (@vah330)

    I tried ctype= because that is what is in your online documentation. I tried types= because that is what is used in other shortcodes myCred uses and I tried type= in case it might used the singular pronoun. NONE work.

    This is the code now:

    
    Warnings = [mycred_total_balance types="warning"]
    Credits = [mycred_total_balance types="mycred_default"]
    
    [mycred_show_if balance=-1 ctype=”mycred_default”]0 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=5 ctype=”mycred_default”]5 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=10 ctype=”mycred_default”]10 Credits remaining[/mycred_show_if]
    
    [mycred_show_if balance=1 ctype="mycred_default"]Display this: [mycred_total_balance types="mycred_default"] unused search credits.[/mycred_show_if]
    
    [mycred_show_if balance=-1 ctype=”warning”]-0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=0 ctype=”warning”]0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=1 ctype=”warning”]1 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=2 ctype=”warning”]2 Warnings issued[/mycred_show_if]
    

    This is the result:

    Warnings = 1
    Credits = 9

    5 Credits remaining

    Display this: 9 unused search credits.

    0 Warnings issued

    1 Warnings issued

    2 Warnings issued

    ctypes= does not function either. It only works for the default credit type, not secondary credit types.

    • This reply was modified 2 years, 9 months ago by vah330.
    A.Tariq

    (@arsalantariq)

    @vah330,

    Please use the updated plugin attached below and let us know how it is working.

    Download Link: https://we.tl/t-F7upWKIj2S

    Thread Starter vah330

    (@vah330)

    It is worse. The same code used:

    
    
    Warnings = [mycred_total_balance types="warning"]
    Credits = [mycred_total_balance types="mycred_default"]
    
    [mycred_show_if balance=-1 ctype=”mycred_default”]0 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=5 ctype=”mycred_default”]5 Credits remaining[/mycred_show_if]
    [mycred_show_if balance=10 ctype=”mycred_default”]10 Credits remaining[/mycred_show_if]
    
    [mycred_show_if balance=1 ctype="mycred_default"]Display this: [mycred_total_balance types="mycred_default"] unused search credits.[/mycred_show_if]
    
    [mycred_show_if balance=-1 ctype=”warning”]-0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=0 ctype=”warning”]0 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=1 ctype=”warning”]1 Warnings issued[/mycred_show_if]
    [mycred_show_if balance=2 ctype=”warning”]2 Warnings issued[/mycred_show_if]
    
    

    The resulting output now:

    Warnings = 1
    Credits = 0

    Nothing more at all.

    Thread Starter vah330

    (@vah330)

    I added some base credits and get this a s a result now:

    Warnings = 1
    Credits = 10

    Display this: 10 unused search credits.

    JFYI

    A.Tariq

    (@arsalantariq)

    @vah330,

    Thanks for informing. We have tested the plugin on our environment with mycred_show_if shortcode before giving it to you. It should work fine on your website. If you are still facing any issues. Please feel free to contact us.

    Thread Starter vah330

    (@vah330)

    NO it is still not functioning as I illustrated in my last reply.

    The mycred_show_if shortcode works for the base credit/point type but not for additional point types.

    Did you test your code with additional point types? (myCred does allow multiple additional point types to be set up via the Add New Type in Settings)

    The shortcode works for the base credit type (mycred_default) as shown previously but not for the additional point type (warning) I have instigated.

    Please help.

    • This reply was modified 2 years, 9 months ago by vah330.
Viewing 15 replies - 1 through 15 (of 40 total)
  • The topic ‘mycred_show_if stopped working’ is closed to new replies.