how to use commerce affiliate . how to set 'Entity reference' filed, on to product type or normal Entity type? and refercence to which, commission or campaign? what is parent Entity? how to publish campaigns to users and other website? the readme file do not give a detail. and sorry for my dull.

CommentFileSizeAuthor
commission.jpg82.34 KBshoufeng.xi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shoufeng.xi’s picture

Assigned: Unassigned » shoufeng.xi

waiting support 。。。

dgastudio’s picture

same here. How to add comission to order? to product?

mesch’s picture

I just worked on a project that needed to attach a commission to an order. I'm including a basic rule that does the job (but excludes the project-specific action logic) below.

In words, when an order is completed, check to see if the user has a cookie containing an active affiliate and campaign, and then verify that the campaign is the one I want to give a commission for. Note that the campaign id is not the campaign name, but the actual integer id (the default campaign is "1"). If those conditions are true, then I add a commission.

{ "rules_create_affiliate_commission_cloned_" : {
    "LABEL" : "Create Affiliate Commission (cloned)",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "REQUIRES" : [ "affiliate_ng", "commerce_affiliate", "commerce_checkout" ],
    "ON" : [ "commerce_checkout_complete" ],
    "IF" : [
      { "affiliate_ng_is_active_campaign" : [] },
      { "affiliate_ng_check_cookie" : { "key" : "campaign_id", "value" : "1" } }
    ],
    "DO" : [
      { "commerce_affiliate_add_commission" : {
          "entity" : [ "commerce-order" ],
          "commission_type" : "commerce_order",
          "amount" : "5"
        }
      }
    ]
  }
}

As to how to get campaigns up and running, the module adds an "Affiliate Center" tab to the user menu. If you click on a specific campaign, you get the appropriate affiliate links. Note the user must have the "Act as affiliate" permission to access this affiliate center.

deggertsen’s picture

Status: Active » Needs review

I have added some documentation here: https://drupal.org/node/2020217

Thanks to @bojanz, @sinn, and @MEsch for your contributions as I mostly just copied and pasted with a few additions here and there. I'm going to mark this as needs review as the documentation is quite incomplete and should also be linked to from the project page.

deggertsen’s picture

Assigned: shoufeng.xi » Unassigned
Issue summary: View changes

Unassigning the issue as it really needs to go to the maintainers for review. If you have used the above documentation and it has been helpful for you please change the status to Reviewed & tested by the community.

deggertsen’s picture

Status: Needs review » Closed (fixed)

There is plenty of documentation now here: https://www.drupal.org/node/2020217

Closing as fixed.