Cross-sell, Up-sell in drupal 7
Hello everybody,
I'am new in drupal commerce world, I need your help about how to use Cross-sell and Up-sell in drupal commerce, I searched all over the web, I concluded that is possible, but no clear method.
thank you in advance.
Comments
A big +1 to this! I've been
A big +1 to this!
I've been trying to find a relatively straightforward way to list related products inside my product displays and haven't really found any clear cut way to do it. Being relatively new to drupal, I initially chalked this up to my shaky understanding of basic drupal concepts, but after pouring through many different message boards, it seems like this has been a rarely-answered question.
My first instinct was to add a node reference field inside of my product listing (not product display) to point to other related product nodes. My thought was I could use these references inside of a block view, which would then list those related products (and a selection of their associated fields) on my product display.
I had minor success here. The view did display related products, but it would display all nodes selected as "related" irrespective of the current product being viewed. For example, if product A had products S, R, and T referenced as related, and product B had products U and V selected, products S, R, T, U and V would all be displayed on both product A and B's pages. Not what I'm looking for, clearly. After more reading, I realized this is probably happening because I'm using a block view to display the list, and contextual filtering doesn't work the same way here.
I've been wringing my hands over this one for a while now, and could really use a point in the right direction. Can I get this approach to work, or am I going the wrong way entirely?
Thanks for any help you can give!
Here is how
How to Create a Product Display Entity Reference and Block View of Related Products
This will guide you through creating a Related Products block for Drupal Commerce. I found this thread while looking for a solution myself. I am happy to answer any questions or suggestions for improvement.
Install the necessary modules
Creating the Reference Field
Configure the "Related Products" field in the dispaly
Add one or more Related Products to a Product Display
Create the View
if (arg(0) && arg(0) == 'node') {
$related_ids = array();
$node = node_load(arg(1));
$related = field_get_items('node',$node,'field_pd_related_products');
if ($related && is_array($related) && sizeof($related) > 0) {
for ($i=0; $i<=count($related); $i++ ) {
$related_ids[] = $related[$i]['target_id'];
}
}
}
return ($related_ids && in_array($row->nid, $related_ids) ? FALSE : TRUE );
Configure the Block
Navigate to the Product Display that has Related Products to confirm everything worked.
Important Notes:
In the PHP code of the filter criteria, it is important that the field name matches the name of the field used as the entity reference. Also, the aggregation setting is required if there is more than one product referenced per product display node to avoid duplicate rows.
Updated
This has been updated. The latest instructions may be found on the Drupal.org documentation section: http://drupal.org/node/1465920
Related product is not the
Related product is not the same cross selling...
I know this is an old post
I know this is an old post but wanted to say that this apparently does not work with Commerce Kickstart2 - I'm using 7.x-2.25.
The main issue appears to be when you create the entity reference field - "Node" does not appear in the "Target Type".
If anyone has a solution of how to create a related products view for Commerce Kickstart2 - I would appreciate any insight you can give to this.