Setting the allfiliate days to unlimited

"Setting the allfiliate days to unlimited"

How and where do i change the days to unlimited.

  • Mark Wallace
    • Learn-ing-er

    Yes! lol The language barrier is getting much better. I believe we have made the affiliate plugin a good work around untel he pays for custom coding.

    I am glad i tried to help him. Now that i understand the affiliate plugin, i am switching out my ecwid stores for MarketPress, the awpc for directory, and dumping elgg for a WP mebership site. lol I always thought affiliate ment when you clicked the button it ment anything on that other site was recorded. I didnt know it tied into other plugins.

    Hey! i'll tweet you next week when i set up my twitter account. I've been stalking all of you! lol thanks for ping-n Barry!

  • Mark Wallace
    • Learn-ing-er

    Hi @Barry

    Just to avoid multiple questions. I am sure that once the user deletes cookies from their browser it will not matter how long the cookie was set for, BUT could you verify that so the other party involved will see it to be true, and not have to take my word for it.

    Thank You!

  • Barry
    • DEV MAN’s Mascot

    "Setting the allfiliate days to unlimited"

    The plugin stores a cookie to record that the visitor has visited via an affiliate link, this cookie *MUST* have an expiry date, if it doesn't then it is called a session cookie and is removed when the user closes the browser. As such, you can't have an unlimitied length of time for the cookie.

    If it does work that way i am unable to find the report.

    Which report are you looking for? Are the purchases and amounts not showing on the affiliates graphs / tables?

  • Mark Wallace
    • Learn-ing-er

    @Barry

    Which report are you looking for? Are the purchases and amounts not showing on the affiliates graphs / tables?

    This is the problem we are having. We cannot find the purchases and amounts on the affiliates graphs / tables.

    cookie *MUST* have an expiry date

    Please include istruction on how to increase the number of days, also is there a max or min number of days.

    I notice you said " expiry date" I trust you ment days, correct??? <<< I am not being a smart @$$, but i have learned not to assume anything; no matter how obvious it may seem!

    Thank You barry!

  • Barry
    • DEV MAN’s Mascot

    This is the problem we are having. We cannot find the purchases and amounts on the affiliates graphs / tables.

    Are you looking for a specific marketpress report? Because there isn't one - it uses the standard affiliate reports for this version.

    notice you said " expiry date" I trust you ment days, correct???

    No, I meant date. The plugin adds the number of days you set to todays date and calculates the expiry date for the cookie.

    Please include istruction on how to increase the number of days, also is there a max or min number of days.

    You can either edit the affiliateincludes/includes/config.php file and change the setting in there or add the following to your wp-config.php file, which will retain the setting over upgrades.

    if(!defined('AFFILIATE_COOKIE_DAYS')) define('AFFILIATE_COOKIE_DAYS',30);

    Change the 30 to the number of days you want the cookie to stay in a users browser

  • Mark Wallace
    • Learn-ing-er

    @Barry

    Are you looking for a specific marketpress report? Because there isn't one - it uses the standard affiliate reports for this version.

    What exactly is the 10% or % set in marketpress for then? I believe this will clearfy the and resolve this thread.

    There is no % for a unique click.
    There is no % for a sign up to a store.
    And not many stores charge for memberships so there is no % there.

    This lead him to believe that the % was for products sold in the marketpress store.
    I looked over the Snip Shot agian and do not see anything about marketpress.

    If it is the Debits / Credits / Payments then they are not recording the purchases made when someone buys via the affiliate link.

    What are we misunderstanding about the % to be paid in marketpress/affiliate?

    Thanks For your time Barry!

  • Rystraum
    • WPMU DEV Initiate

    Hi @MTB:

    I'm new here but I was looking over the codebase anyway so I can answer the question.

    The % in MarketPress is indeed % of the total order amount judging from the following code in affiliate/affiliateincludes/addons/marketpress.php, in Affiliate 3.0.4.

    if(!empty($aff_id)) {
      $percentage = aff_get_option('affiliate_mp_percentage', 0);
    
      // We have a referrer - get the total
      $total_amount = get_post_meta($order->ID, 'mp_order_total', true);
    
      // calculate the amount to give the referrer - hardcoded for testing to 30%
      $amount = ($total_amount / 100) * $percentage;
    
      // run the standard affiliate action to do the recording and assigning
      do_action('affiliate_purchase', $aff_id, $amount, 'marketpress', $order->ID, 'Affiliate payment for MarketPress order.');
    
      // record the amount paid / assigned in the meta for the order
      add_post_meta($order->ID, 'affiliate_marketpress_order_paid', $amount, true);
    }

    Judging from the code, the amount should appear as a post meta for the order.
    I've looked over the database and the meta data isn't being created.
    I'm currently investigating this bug by looking over the source code and disabling all other plugins. Will let you know if I get a breakthrough if @Barry doesn't get to it first.

  • Rystraum
    • WPMU DEV Initiate

    If it is the Debits / Credits / Payments then they are not recording the purchases made when someone buys via the affiliate link.

    Marketpress 2.6.4 and Affiliates 3.0.4

    I've got Marketpress configured for manual payments. The affiliates are not credited when the order is manually changed from received to paid.

    Affiliate is attaching the computing of payouts in the mp_order_paid and while it works when we're passing through the gateway, it doesn't work when we're changing the order state manually.

    The fix is actually on the Marketpress side. Essentially, when we're changing between order status, the actions 'mp_order_paid' and friends aren't being called.
    Calling do_action inside the appropriate states in function update_order_status($order_id, $new_status) (line 3305, marketpress/marketpress.php) fixes the issue.

    I'm attaching a git patch of the fix I made.

    Hope it helps.

    PS. Looking through other support tickets, I understand that what I'm doing (fixing things myself) isn't the norm. I figured that since the plugins are GPL anyway and I've got the requisite skills to make the changes myself, might as well fix it up to help @Barry out a bit. (He's pretty in demand in all of the threads I've looked at.)

  • Barry
    • DEV MAN’s Mascot

    The fix is actually on the Marketpress side. Essentially, when we're changing between order status, the actions 'mp_order_paid' and friends aren't being called.

    It was actually in the affiliate system - as I posted, the fix was release on sunday morning but thanks for the interest and hard work - it took me a while to find that one and in the end it was an obvious little bug introduced in the last couple of versions :disappointed:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.