I posted this originally at http://drupal.org/node/1399434#comment-5573526 but I thought I would re-post since it was probably missed.

Could someone kindly explain how the 'display path' is built when the Cart view is rendered and why it may not be rendering some display path URLs?

I'm using a modified version commerce_add_to_cart_extras module whereby I'm trying to link the line item to the product display node by customizing the 'display path '. I can see it being added correctly when I inspect the $line_item object in save function of CommerceLineItemEntityController. But the line items in my cart still aren't linked and when I output the display path as a field in the view, it's empty.

Note: I haven't modified any code in commerce core other than to insert devel print statements to try and figure out what's going on. My code modifications are to the commerce_add_to_cart_extras module.

I can post the output for the $line_item object if that would help.

Comments

liupascal’s picture

Does it happen on EVERY product you add to your cart ?

I saw this happening once, and I realized it was because I was adding the product to the order via the Order edition interface (admin) - hence there was no "display path"... as the display path is the node from where the product was added.

I suspect this is the normal behavior : since you're using commerce_add_to_cart_extras (i've never used it so it's just a random guess) there is not display path for line item to save since you're not in a product display page.

nmc’s picture

This happens to EVERY product added to my cart using the commerce_add_to_cart_extras module. You're right, I'm not in the product display page but the display path is set by some custom code and I can see the display path being set/saved when the line item is saved.

It's just not showing up when the line item is viewed in the shopping cart View.

rszrama’s picture

Status: Active » Closed (duplicate)

I saw your comments there, I just don't have the ability to answer every comment each day. ; )

I'd say let's keep the discussion in there.

nmc’s picture

Sorry. I should have given you more time to answer. Thanks in advance. You're awesome!