Comment a product

Author Message

Henning Deiters

Wednesday 22 September 2010 7:31:30 am

Hi,

is there a solution to comment a product? Has anybody an idea?

Thank you in advance.

 

Henning

Håvard Bergersen

Wednesday 22 September 2010 11:03:49 am

The easiest way is to include the "comments" parts from ezwebin.:

<div class="attribute-comments">                                    
<a name="comments" id="comments"></a>                                    
<h1>{"Comments"|i18n("design/ezwebin/full/blog_post")}</h1>                                    
<div class="content-view-children">                                        
{foreach fetch_alias( comments, hash( parent_node_id, $node.node_id ) ) as $comment}                                            
{node_view_gui view='line' content_node=$comment}                                        
{/foreach}                                    
</div>
                                   
{if fetch( 'content', 'access', hash( 'access', 'create', 'contentobject', $node, contentclass_id, 'comment' ) )}                                   

<form method="post" action={"content/action"|ezurl}>    
<input type="hidden" name="ClassIdentifier" value="comment" />              
<input type="hidden" name="NodeID" value="{$node.object.main_node.node_id}" />   
<input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'ContentObjectLocale', 'site.ini')}" />                                       
<input class="new_comment button" type="submit" name="NewButton" value="{'New comment'|i18n( 'design/ezwebin/full/article' )}" />                                   
</form>                                   

{else}                                       
{if ezmodule( 'user/register' )}                                           
<p>{'%login_link_startLog in%login_link_end or %create_link_startcreate a user account%create_link_end to comment.'|i18n( 'design/ezwebin/full/blog_post', , hash( '%login_link_start', concat( '<a href="', '/user/login'|ezurl(no), '">' ), '%login_link_end', '</a>', '%create_link_start', concat( '<a href="', "/user/register"|ezurl(no), '">' ), '%create_link_end', '</a>' ) )}</p>                                       
{else}                                           
<p>{'%login_link_startLog in%login_link_end to comment.'|i18n( 'design/ezwebin/article/comments', , hash( '%login_link_start', concat( '<a href="', '/user/login'|ezurl(no), '">' ), '%login_link_end', '</a>' ) )}</p>             
{/if}                                
</div>

Just remember to give the users you want to be able to comment, the access to add comments.

'content', 'create', class( 'comment' ), parent class( 'product' )

And edit the product class to be a container..

Henning Deiters

Thursday 23 September 2010 12:05:58 am

Hi Håvard,

it's working fine. Thanks a lot! :-)

Best regards from Hamburg // Henning

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.