Tags/topics: 
2
Answers
Vote up!
1
Vote down!

Commerce 2.x

Hello ,

M building project in drupal 8.x , commerce 2.x

I need to print commerce product fields in node.html.twig file .

How can i print that ? Any idea ?

Thank you in advance.

Asked by: Bhoomi
on July 8, 2016

2 Answers

Vote up!
0
Vote down!

Commerce 2.x does not use nodes in any way, so I'm unsure how you're getting the product linked to the node? And why? You'll need to provide more info.

Bojan Zivanovic
Answer by: Bojan Zivanovic
Posted: Jul 10, 2016
Vote up!
0
Vote down!

Hello ,

Thanx Bojan for your answer .

I have to design product details page ,

For that i need to print fields separately , without array in overrided file (node--content-type.html.twig).

In drupal 7 , print like "

<?php
 
print render($content['product:field_name']);
?>
".

In case of drupal 8 , can i print product fields like this way?

Thanks.

Answer by: Bhoomi
Posted: Jul 11, 2016