This module follows on from Ubercart Products Recommender and provides two default views:

  1. Users who ordered this product also ordered.
  2. Personal recommendation based on your previous purchase.

You can modify the default Views to meet your purpose.

The personalized recommendation view requires to read the user's purchasing history. If a user hasn't made any orders, it displays nothing. In that case, you might consider using the Browsing History Recommender to make recommendations based on users products viewing history.

For Drupal 7

http://drupal.org/sandbox/dwkitchen/1341616

git.drupal.org:sandbox/dwkitchen/1341616.git

CommentFileSizeAuthor
#12 drupalcs-result.txt841 bytesklausi
#9 drupalcs-result.txt1.46 KBklausi

Comments

rogical’s picture

bfr’s picture

This is your correct git clone line:
git clone http://git.drupal.org/sandbox/dwkitchen/1341616.git commerce_rec

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

bfr’s picture

Status: Needs review » Needs work
dwkitchen’s picture

Status: Needs work » Needs review

Updated Git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/dwkitchen/1341616.git commerce_rec

I believe all the actions are now done. I think the unix style terminators issue was just on the those that didn't end in a single new line.

patrickd’s picture

Status: Needs review » Needs work

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

Source: http://ventral.org/pareview - PAReview.sh online service

dwkitchen’s picture

Status: Needs work » Needs review

Used dos2unix to sort out line endings.

No errors on PAReview.sh

Thanks

bojanz’s picture

Assigned: Unassigned » bojanz

I'll review this tomorrow.

bojanz’s picture

Assigned: bojanz » Unassigned

Went through the code, with a small delay.
Don't have experience with the Recommender API.

I see there's not a lot of code. Still, I have reservations about the sql query you are plugging into the API:

  $sql = "SELECT o.uid, p.product_id, o.created
          FROM {commerce_order} AS o
          INNER JOIN {commerce_line_item} AS l
          ON o.order_id = l.order_id
          INNER JOIN {commerce_product} as p
          ON l.line_item_label = p.sku
          WHERE l.type = 'product'
          GROUP BY o.uid, p.product_id";

You are getting the product_id by joining line_items and products tables on l.line_item_label = p.sku.
This seems very fragile. While Commerce does indeed put the SKU as the label by default, there's no guarantee that the label won't be anything else.
It was never meant to be used this way. You'll also notice that there's no index on l.line_item_label.
My advice would be to join the table of the commerce_product reference field (attached to the line_item entity) and get the product_id from there.
It does mean you assume SQL storage for Field API fields, but it's a far better approach than joining based on labels.

Nitpicks (while we're at it):

      'entity_type' => array(
          'similarity' => array('commerce_product', 'commerce_product'),
          'prediction' => array('users', 'commerce_product')
      ),

similarity and prediction are indented with 4 spaces instead of 2.

/**
 * Implements of hook_help().
 */

Should be "Implements hook_help()".

klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)
StatusFileSize
new1.46 KB

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

manual review:

  • This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project if you wish.
  • Have you contacted the recommender module maintainers via the issue queue or other channels? Why can't this module not live inside the recommender project as submodule?
dwkitchen’s picture

@bojanz

I have changed the SQL to the following:

  $sql = "SELECT o.uid, p.product_id, o.created
          FROM {commerce_order} AS o
          INNER JOIN {commerce_line_item} AS l
          ON o.order_id = l.order_id
          INNER JOIN {field_data_commerce_product} lp
          ON l.line_item_id = lp.entity_id
          INNER JOIN {commerce_product} as p
          ON lp.commerce_product_product_id = p.product_id
          WHERE l.type = 'product'
          GROUP BY o.uid, p.product_id";

Which makes much more sense.

@klausi

All but README.txt removed from head now.

I am happy for this to be a single promotion to full project.

The Recommender API does not contain any sub-modules and the integrations are all separate e.g. Browsing History Recommender, Fivestar Recommender etc.

Thanks

David

dwkitchen’s picture

Status: Postponed (maintainer needs more info) » Needs review

Changing back to needs review

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +PAreview: single application approval
StatusFileSize
new841 bytes

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

Otherwise I think this is ready for a single project promotion.

zzolo’s picture

Status: Reviewed & tested by the community » Fixed

Hey @dwkitchen, you now have full Git access. Happy hunting.

Thanks to all the reviewers!

Automatically closed -- issue fixed for 2 weeks with no activity.