Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, firstly, thanks for your work on this excellent and promising module set!
I have question around panels integration.
For product display, it's great that you can select relevant fields from the related product on the product display node under 'display options'
However, those product fields aren't available when added "Node" fields to a panel - only the immediate product display fields are available.
Any idea / thoughts what could be done to make those fields from display options available as panel fields also?
Given some pointers, I may be able to provide a patch for this.
thanks again,
DT
Comment | File | Size | Author |
---|---|---|---|
#2 | panels-add-node-content-to-pane.png | 95.94 KB | davidwhthomas |
#2 | product-display-fields.png | 139.59 KB | davidwhthomas |
Comments
Comment #1
EclipseGc CreditAttribution: EclipseGc commentedDavid,
Not entirely sure what you're asking here, but the typical workflow would be, if you're referencing products from a node, you would add a product reference from the node you're viewing. Then the product's fields would be available for display on the node type.
This all works due to a lot of leg work in page_manager, however it does not yet account for anything other than a 1 to 1 ratio of products to nodes. I do intend on fixing that soonish, but have not yet had a chance.
If this doesn't answer your question then please mark this issue as active again and be a bit more specific.
Eclipse
Comment #2
davidwhthomas CreditAttribution: davidwhthomas commentedHi Eclipse, thanks for your reply.
The problem is perhaps best illustrated with a screenshot.
Basically, I'm wanting to display product fields in a node view override panel for the product display node.
Panels only shows the fields directly on the product display node type, not the referenced fields on the product.
Do the attached screenshots help?
I'd like the 'display option' fields from the second screenshot to be available to add to the panel pane in the first screenshot.
thanks again,
David
Comment #3
EclipseGc CreditAttribution: EclipseGc commentedRight, visit the "contexts" area for the variant, add a relationship to the product entity via your product reference field, and then you'll have a "Commerce Product" entity section in the content_type selector (i.e. all the product fields will be available).
Hope that helps.
Eclipse
Comment #4
davidwhthomas CreditAttribution: davidwhthomas commentedAwesome, that's the one, works perfectly!
Thanks so much for the help.
cheers,
David
Comment #6
amcc CreditAttribution: amcc commentedi'm doing the same thing here and have got the "Commerce Product" entity section now so thanks for that.
BUT... if you have multiple products referenced the nice AJAX that updates the product price and other product fields does not work.
I assume this is because its not all being added as one thing, the form and product fields have to be added separately in panels.
any ideas
Comment #7
EclipseGc CreditAttribution: EclipseGc commentedI'm actually hoping to fix that next week. We're doing a sprint in Colorado for the week leading up to drupalcamp colorado, and that particular issue is the one I want to fix.
Comment #8
courtney.mob CreditAttribution: courtney.mob commentedamcc, I'm having the same issue. I'm glad to see someone is working on it. EclipseGc, thanks for the support. This is what I really love about the Drupal Community.
Comment #9
EclipseGc CreditAttribution: EclipseGc commentedFor those of you following this, the actual progress that's being made here can be tracked at #1182712: Page Manager Integration (postponed pending a ctools patch).
Comment #10
amcc CreditAttribution: amcc commentedWell done for all the great work on this. Meanwhile I've gone back to hand coding node.tpl files. That still works great and sometimes is even easier. But I do love panels all the same.
Comment #11
courtney.mob CreditAttribution: courtney.mob commentedAny update on this?
Comment #12
James A CreditAttribution: James A commentedHi, I am trying to use panels with Drupal Commerce and have run into the issue outlined above where with multiple products my call to "Commerce Product from Node (on Node: Product)" doesn't update when I change the selected product.
I have tried following the Page Manager Integration link with the patches but they don't appear to work for me, the last one does patch to commerce_product_reference.module and creates product_field_from_entity.inc but didn't fix the issue. I then went back up the post assuming I also had to apply the patch for entity_field.inc but this no longer appears to work, failing during the patch routine.
If you can give any further advice or help on this it would be much appreciated.
Comment #13
maxplus CreditAttribution: maxplus commentedHi,
did anyone find the solution for panels in combination with different product variations inside one product display node?
I have the problem that many others have that when changing an attribute in the add to cart form, several components (like the product image inside the product variation) disappear or other product specific fields there appearance changes...
Even when I add a panel pane of rendered entity of a product display node, it does not react well when changing attributes in the add to cart form.
Comment #14
mlundager CreditAttribution: mlundager commentedI have exactly the same problem as #13
Comment #15
Fred E CreditAttribution: Fred E as a volunteer and commentedThis may not fit your exact setup, but I hope it helps. I have a Panels page with the add to cart form in one pane and a Views content pane in another. The Views pane is a slideshow for images of the currently selected product variation. When the add to cart form option is changed, the view needs to be refreshed. This can be done by running hook_commerce_cart_attributes_refresh_alter and adding an AJAX command. I just discovered "RefreshView, " which does the trick. Here is an example:
Depending on your view, this might be enough. It wasn't for me because I needed to update the argument for the contextual filter in my view. Based on comments in #1781988: How to ajax refresh a view?, I opted for a custom ajax command and changed the above to this:
In a separate js file I then wrote my custom command to first reset the views argument and then call RefreshView:
Remember to use drupal_add_js to include your js file. I attached mine to the add to cart form with hook_form_FORM_ID_alter.
Comment #16
heddnMight be related to #1303194: Clarify security implications of granting "View any Product product" permission