Linking Commerce Products to Drupal 7 Top Menus

Events happening in the community are now at Drupal community events on www.drupal.org.
jonnystpaul's picture

Hi All,

I'm very new to Drupal 7 and Commerce, and am wondering how I link my products (admin/commerce/products/add/product) to my top menus (admin/structure/menu/manage/menu-top-categories)? I can't find where the list of my paths are.

One product, e.g., has the auto alias: content/vegetarian-shoes-herbert and I want to link it to the top menu: catalog/mens-shoes/oxfords.

Thanks for your help!

Jon

Comments

Hi Jon! So what you are

mndonx's picture

Hi Jon! So what you are trying to do is make a product a menu item? When you add or edit a node, you should see a Menu Settings tab at the bottom. There's a place where you can check "Provide a menu link" and add it to your menu there. However, I'm wondering from what you describe whether you are trying to make a list of items? Or do you want it just to link to the one item?

ryan258's picture

Hi Johnny,

Your first problem is that "Products" are entities and aren't meant public viewing like nodes, they're fieldable things to be referenced by something else that is displayed.

Before I get carried away, here's the basic run down distilling the process of getting your product into node form.

1) Create a product type. - admin/commerce/products/types/add
+++ Make a CD product type.
2) Create a product - admin/commerce/products/add/cd
+++ CD is the product type.
+++ Create a product through here for every variation of your product.
3.) Product Display - admin/structure/types/add
+++ Create CD Display content type
+++ Add Product Reference field
4.) Finally creating the Product Display - node/add/cd-display
+++ Node Creation as usual w/ menu, aliases, and all the standard node functionality.

Here's my long explanation:

1) Create a product type. admin/commerce/products/types/add

Commerce's version of the core "Create a content type" for your usual node types like Article, Basic Page, Event, etc. It's just that in this case it sets up fields for different products because you're going to want different fields for different kinds of products.

Like a field on a CD content type would be tracklist, whereas a DVD content type would have a field for Director.

2) Create a product - admin/commerce/products/add/cd (CD is the product type)

You create products through the content creation forms that you define in product type. The key thing to note here is that you're not creating a viewable node here. Instead what you're doing is creating an entity that can be referenced. (So that's why you're not getting the option to add it to the menu or find a path).

Reasoning behind this product being an entity instead of a node right off the bat is that it provides a separation between the products viewed on your website by visitors (nodes) and all of your stores products (entities).

This means that you remove an item from your store's display while not having to remove it entirely from your site as well as other freedoms like referencing a bunch of products with their variations (size, color, price) to get those cool attributes working in a single display.

3.) Product Display (a content type = nodes) admin/structure/types/add

The piece that you're missing is that now you have to create a new content types for your products.

To keep going with the example - Call it CD Display and for fields what makes this work with Commerce is the "Product Reference" field. Product Reference gives you a select box to pull in the fields from the product entities so that they can be displayed in node form (through product displays!).

4.) Finally creating the Product Display node node/add/cd-display

Once that particular content type is made then you can finally create that product node you had in mind for the world to see because if you have a product entity made (thanks to the Product Type you created) and you've created a content type (Like CD Display) that references the product entity, then finally when you click "Create new content" you'll see you can create CD Display nodes.

When you get to this point that's where mndonx's advice kicks in because the Display is what takes the product from being an entity to the masses as a node. When it's a node you get the node options which is what he was assuming.


Good news about Commerce is that it's actually easy and makes a profound amount of sense, the only catch is that it's a whole lot easier when you know the process above.

Also it gives you a sense what this whole entity business is about as well. :D


If you have any questions feel free to Skype me at the email in my profile and I can do a quick share screen and walk you through it.

Drupal Developer | Saint Paul | Buenos Aires

A gazillion thanks, Ryan, for

jonnystpaul's picture

A gazillion thanks, Ryan, for taking the time to give me such a thorough explanation. Really appreciate it! Jon

thanks ryan that helped me

pipep's picture

thanks ryan that helped me too !

Twin Cities

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: