Need help with Coupon feature in Membership Plugin

I’m moving this discussion to a new thread since part 2 of my note has been resolved. Thanks!

I am having issues with the Coupon feature. It says it has created the coupon, but the coupon never appears in the dashboard.

PC was kind enough to do a little research and suggested the following:

Just go to Membership >> Options >> Advanced >> Repair Membership Tables

I did this, and tried again, but still no luck. Advice?

Thanks,

Elaine

  • PC
    • WPMU DEV Initiate

    Wooohooo…

    I got this one free :wink:

    Hey @realsparx,

    This is PC again :slight_smile:

    So, after you did a Repair memberhip tables, did you see any thing in Red ? saying fixed or something ?

    Also, can you please help try and narrow down this issue but doing the below.

    1: Repair the tables once again. / Log out / Clear the cache / login again

    2: See if the issue is resolved.

    If not

    3: Disable other plugins apart from this one, and see if the issue goes away ?

    Please advise and by the time you respond, I am gonna go and try to replicate the issue on my lab site.

    Cheers

    PC

  • RealSparx
    • Flash Drive

    Well, no worky.

    I repaired the tables. When it’s done, I get the list of tables with a green “ok” beside it. Everything had the green “ok.”

    I logged out, cleared the cache, then logged back in and tried again. I’m still getting the “coupon added” confirmation in a yellow bar, but then it never appears in the list below.

    I also disabled all the other plugins except Membership, and tried one more time.

    Evidently we’re supposed to sell subscriptions for full price instead of offering coupon deals. :slight_smile:

  • PC
    • WPMU DEV Initiate

    Evidently we’re supposed to sell subscriptions for full price instead of offering coupon deals. :slight_smile:

    That is nice, however, if something is not working, it should be fixed :slight_smile:

    I am gonna try a couple of tests and would report as soon as I find something.. Till then, you may focus on the other parts of the site and leave the Coupon issues to me :slight_smile:

    Cheers

    PC

  • PC
    • WPMU DEV Initiate

    Hey @realsparx,

    Greetings !

    I tested and was unable to replicate it on the lab site. Are you still unable to create a coupon ? (Same behavior as before ?) and could you try disabling membership plugin, enable it again and repair the tables again ?

    I don’t have to have this up and running for launch, but was just hoping… :slight_smile:

    I understand that you might not need this functionality, so while you launch this site, can you please create a new test install and see if the same issue is there ?

    Cheers

    PC

  • RealSparx
    • Flash Drive

    I definitely need the coupon feature, but can get through the next few launch days without it. Now, I’m wondering if there’s a work-around using coupons on PayPal…

    I’m off to do the next experiment. I’ll report back here shortly! –e

  • RealSparx
    • Flash Drive

    Still no luck. I went in, disabled Membership, reactivated Membership, repaired tables, and tried again. The same thing is happening. It continues to say “coupon added” in the yellow bar when I save a new coupon, but the coupon never appears in the list below. I did a screen grab of the message if you’d like to see.

    So what do you think about using a PayPal discount code as a workaround? Is there a way that it can integrate with Membership?

    Or, what would you think about sending me the code for the coupon section of the plugin and letting me click “edit” and replace my code with what we know is working code?

    Thanks again! –Elaine

  • PC
    • WPMU DEV Initiate

    Wow, that is a nice site you have put together :slight_smile:

    Well, I do not see any other reason of coupon feature not working. Let me seek help form our lead developer @Barry on this one.

    It might take a bit longer than usual however I would track the progress and make sure we get something soon and would be active on this thread along with you.

    Cheers

    PC

  • RealSparx
    • Flash Drive

    I did the update, and unfortunately, the exact same thing is still happening. I’m getting a confirmation that the coupon was successfully created, but it never appears in the list. I went back into “repair tables” one more time, just in case, but it still didn’t fix the issue.

  • Barry
    • DEV MAN’s Mascot

    Do you have access to your database? Either via phpmyadmin or some other interface so that you can do a quick check to see what membership tables are in there – they will all start with something like wp_m_

    Update: sorry mean’t wp_m_

  • RealSparx
    • Flash Drive

    Hmmm. Not sure if there’s somewhere else I should look, but if I go into Verify or Repair Tables, this is what I get:

    Verifying

    Checking table : wp_m_membership_levels – Ok

    Checking fields in table : wp_m_membership_levels –

    id – Ok

    level_title – Ok

    level_slug – Ok

    level_active – Ok

    level_count – Ok

    Checking table : wp_m_membership_relationships – Ok

    Checking fields in table : wp_m_membership_relationships –

    rel_id – Ok

    user_id – Ok

    sub_id – Ok

    level_id – Ok

    startdate – Ok

    updateddate – Ok

    expirydate – Ok

    order_instance – Ok

    usinggateway – Ok

    Checking table : wp_m_membership_rules – Ok

    Checking fields in table : wp_m_membership_rules –

    level_id – Ok

    rule_ive – Ok

    rule_area – Ok

    rule_value – Ok

    rule_order – Ok

    Checking table : wp_m_subscriptions – Ok

    Checking fields in table : wp_m_subscriptions –

    id – Ok

    sub_name – Ok

    sub_active – Ok

    sub_public – Ok

    sub_count – Ok

    sub_description – Ok

    sub_pricetext – Ok

    Checking table : wp_m_subscriptions_levels – Ok

    Checking fields in table : wp_m_subscriptions_levels –

    sub_id – Ok

    level_id – Ok

    level_period – Ok

    sub_type – Ok

    level_price – Ok

    level_currency – Ok

    level_order – Ok

    level_period_unit – Ok

    Checking table : wp_m_subscription_transaction – Ok

    Checking fields in table : wp_m_subscription_transaction –

    transaction_ID – Ok

    transaction_subscription_ID – Ok

    transaction_user_ID – Ok

    transaction_sub_ID – Ok

    transaction_paypal_ID – Ok

    transaction_payment_type – Ok

    transaction_stamp – Ok

    transaction_total_amount – Ok

    transaction_currency – Ok

    transaction_duedate – Ok

    transaction_gateway – Ok

    transaction_note – Ok

    transaction_expires – Ok

    Checking table : wp_m_urlgroups – Ok

    Checking fields in table : wp_m_urlgroups –

    id – Ok

    groupname – Ok

    groupurls – Ok

    isregexp – Ok

    stripquerystring – Ok

    Checking table : wp_m_communications – Ok

    Checking fields in table : wp_m_communications –

    id – Ok

    subject – Ok

    message – Ok

    periodunit – Ok

    periodtype – Ok

    periodprepost – Ok

    lastupdated – Ok

    active – Ok

    periodstamp – Ok

    Checking table : wp_m_pings – Ok

    Checking fields in table : wp_m_pings –

    id – Ok

    pingname – Ok

    pingurl – Ok

    pinginfo – Ok

    pingtype – Ok

    Checking table : wp_m_ping_history – Ok

    Checking fields in table : wp_m_ping_history –

    id – Ok

    ping_id – Ok

    ping_sent – Ok

    ping_info – Ok

    ping_return – Ok

    Checking table : wp_m_levelmeta – Ok

    Checking fields in table : wp_m_levelmeta –

    id – Ok

    level_id – Ok

    meta_key – Ok

    meta_value – Ok

    meta_stamp – Ok

    Checking table : wp_m_subscriptionmeta – Ok

    Checking fields in table : wp_m_subscriptionmeta –

    id – Ok

    sub_id – Ok

    meta_key – Ok

    meta_value – Ok

    meta_stamp – Ok

    Checking table : wp_m_member_payments – Ok

    Checking fields in table : wp_m_member_payments –

    id – Ok

    member_id – Ok

    sub_id – Ok

    level_id – Ok

    level_order – Ok

    paymentmade – Ok

    paymentexpires – Ok

    Checking table : wp_m_coupons – Ok

    Checking fields in table : wp_m_coupons –

    id – Ok

    site_id – Ok

    couponcode – Ok

    discount – Ok

    discount_type – Ok

    discount_currency – Ok

    coupon_startdate – Ok

    coupon_enddate – Ok

    coupon_sub_id – Ok

    coupon_uses – Ok

    coupon_used – Ok

  • Barry
    • DEV MAN’s Mascot

    Yeah, that’s the verify information from within the plugin – I need to know if you have access to your database via a control panel or something like phpmyadmin so we can double check a couple of things so we’re absolutely sure that everything is as it should be.

  • RealSparx
    • Flash Drive

    Ok. I’m not familiar with this in particular, but I do know where to go into my hosting account and look at the wordpress folders, so if you can point me in the right direction, I bet I can find it. Do I just look in the WordPress/Membership folder?

  • PC
    • WPMU DEV Initiate

    Hiya @realsparx

    Do you have access to your database? Either via phpmyadmin or some other interface so that you can do a quick check to see what membership tables are in there – they will all start with something like wp_m_

    You would need to check this in your hosting account.

    A guide here

    Cheers

    PC

  • PC
    • WPMU DEV Initiate

    Hello @realsparx

    Apologies on having missed your last post on this one.

    This is what you need to do

    /membership/membershipincludes/classes/membershipadmin.php Line 6811:

    if(!is_network_admin()) {
    // We are on a single site admin interface
    $sql .= $this->db->prepare( "WHERE site_id = %d", $this->db->blogid );
    }

    You’re on a single site install, so when your not a network admin it was then trying to add the WHERE is the SQL statement.

    So it can either be removed for now or changed to:

    if(is_network_admin()) {
    // We are on a single site admin interface
    $sql .= $this->db->prepare( "WHERE site_id = %d", $this->db->blogid );
    }

    That will work as a temporary solution until Barry makes a more permanent fix.

    Thanks to Timothy for this solution

    The same issue is being discussed here : https://premium.wpmudev.org/forums/topic/the-coupon-code-manager-overview-page-will-not-display-added-coupons-on-a-fresh-342-wordpress-install

    I hope that helps.

    Cheers, PC

  • Brian Purkiss
    • Smushie Pies

    We hope you were able to resolve this. Since this thread has been inactive for some time I am going to go ahead and close the ticket. If you were unable to resolve it or have any further questions, please feel free to re-open the ticket – we are more than happy to help!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.