WordPress Affiliate Manager

Affiliates Management Plugin for WordPress

  • Home
  • Features
    • Screen Shots
  • Download
  • Documentation
  • Addons
  • Support
    • Support Forum
    • Forum Login
    • Forum Registration
    • Contact
    • Premium Addon/Plugin Support

[Resolved] Where is the couponcode to affiliate association table?

by

WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Where is the couponcode to affiliate association table?

  • This topic has 2 replies, 1 voice, and was last updated 4 years, 7 months ago by nightfreak.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 20, 2020 at 5:26 pm #7069
    nightfreak
    Participant

    Hello,

    as I said in a previous post, my affiliates want to see the pending orders too, not only the completed.
    To get this done, I’m checking the wp_postmeta table and search for orders which have _wpam_id as meta_key.
    This works fine when someone uses an affiliate link to place an order.

    But I noticed when someone doesn’t use an affiliate link and instead uses a coupon code (associated with an affiliate), there is no _wpam_id in the wp_postmeta table.

    So I have to implement it by myself to check if an coupon code applied to an order is associated with an affiliate.id.

    My Problem is now, I can see the association between coupon<->affiliate in the admin backend, but I can’t find the SQL table where this information is stored.

    Can you help me out?

    Thanks,
    Chris

    November 20, 2020 at 9:59 pm #7071
    nightfreak
    Participant

    OK, I just had the idea to make an SQL dump of the whole database and search for the coupon code.
    If someone else is interested in this, it’s stored in the wp_options table. You have to look at option_name affmgr_woo_coupon_association_data.

    November 20, 2020 at 10:18 pm #7072
    nightfreak
    Participant

    Seems to be in a strange format. What is this? It’s no json or something I know. How to parse this?

    O:24:”AFFMGR_WOO_COUPONS_ASSOC”:1:{s:11:”assoc_items”;a:2:{i:0;O:21:”AFFMGR_WOO_ASSOC_ITEM”:3:{s:2:”id”;s:13:”5fb57c4c07766″;s:11:”coupon_code”;s:7:”gs48913″;s:6:”aff_id”;s:2:”14″;}i:1;O:21:”AFFMGR_WOO_ASSOC_ITEM”:3:{s:2:”id”;s:13:”5fb8053fa7466″;s:11:”coupon_code”;s:9:”111222333″;s:6:”aff_id”;s:2:”14″;}}}

    EDIT: it seems AFFMGR_WOO_COUPONS_ASSOC::get_instance() is doing what I’m looking for 😉

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Featured Addons

  • WooCommerce Coupon Tracking
  • WooCommerce Product Specific Commission

Copyright © 2025 | WordPress Affiliate Manager | Privacy Policy