How to enable by default reviews to products on cs-cart v3.x

Hi,

This trick will help you to automatically add comments to you products without having to enable it every time you add a product.



on file skins/basic/admin/addons/discussion/views/discussion_manager/components/allow_discussion.tpl :

[color=#ff0000]#replace[/color]

<br />
<div class="form-field {if !$non_editable}cm-no-hide-input{/if}"><br />
<label for="discussion_type">{$title}:</label><br />
{assign var="discussion" value=$object_id|fn_get_discussion:$object_type}<br />
<select name="{$prefix}[discussion_type]" id="discussion_type"><br />
  <option {if $discussion.type == "B"}selected="selected"{/if} value="B">{$lang.communication} {$lang.and} {$lang.rating}</option><br />
  <option {if $discussion.type == "C"}selected="selected"{/if} value="C">{$lang.communication}</option><br />
  <option {if $discussion.type == "R"}selected="selected"{/if} value="R">{$lang.rating}</option><br />
  <option {if $discussion.type == "D" || !$discussion}selected="selected"{/if} value="D">{$lang.disabled}</option><br />
</select><br />
</div><br />

```<br />
<br />
[color=#008000]#with[/color]<br />
```php
<br />
{** changed by hungryweb.net **}<br />
<div class="form-field {if !$non_editable}cm-no-hide-input{/if}"><br />
<label for="discussion_type">{$title}:</label><br />
{assign var="discussion" value=$object_id|fn_get_discussion:$object_type}<br />
<select name="{$prefix}[discussion_type]" id="discussion_type"><br />
  {if $controller == 'products'}<br />
		 <option {if $discussion.type == "D"}selected="selected"{/if} value="D">{$lang.disabled}</option><br />
	  <option {if $discussion.type == "B" || !$discussion}selected="selected"{/if} value="B">{$lang.communication} {$lang.and} {$lang.rating}</option><br />
		{else}<br />
		 <option {if $discussion.type == "D" || !$discussion}selected="selected"{/if} value="D">{$lang.disabled}</option><br />
	  <option {if $discussion.type == "B"}selected="selected"{/if} value="B">{$lang.communication} {$lang.and} {$lang.rating}</option><br />
		{/if}<br />
  <option {if $discussion.type == "C"}selected="selected"{/if} value="C">{$lang.communication}</option><br />
  <option {if $discussion.type == "R"}selected="selected"{/if} value="R">{$lang.rating}</option><br />
</select><br />
</div><br />

```<br />
<br />
<br />
[ Tested on CS-Cart: version 3.0.6 PROFESSIONAL ]<br />
<br />
I hope that helps,<br />
<br />
---<br />
Valentin

Will this work on cs-cart 4?

Hi,



Seems like it doesn't work on cscart 4.



Anyone has an upgrade of file ?

Edited : /design/backend/templates/addons/discussion/views/discussion_manager/components



changed :


```php

{__("communication")} {__("and")} {__("rating")}
```
to :

```php
{__("communication")} {__("and")} {__("rating")}
```

and :

```php
{__("disabled")}
```

to :

```php
{__("disabled")}
```

It sould work, but cleared cache, doesn't work, does it need to be modified somewhere else ?

Works for me that way. Are you sure the cache cleared properly?

Yes, changed file :


  • allow_discussion.tpl
  • bulk_allow_discussion.tpl



    Cleared cs cart cache

    Cleared browser cache



    Triyng to create new product, wow :shock: , it’s working :grin: .

[quote name='thefreer' timestamp='1390695428' post='176073']

Edited : /design/backend/templates/addons/discussion/views/discussion_manager/components[color=#282828][font=arial, verdana, tahoma, sans-serif]/allow_discussion.tpl[/font][/color]



changed :


```php

{__("communication")} {__("and")} {__("rating")}
```
to :

```php
{__("communication")} {__("and")} {__("rating")}
```

and :

```php
{__("disabled")}
```

to :

```php
{__("disabled")}
```

[/quote]

Thank you! Worked beautifully in MV 4.2.4

Worked perfectly on CS-Cart Multivendor 4.3.1 as well.

Thank you this was very helpful!!!

So, I thought making this change worked, and it sort of did, but not really. My client is using three storefronts and when she adds products as "All Stores" it shows the "Communication & Rating" as selected after creating a new product, but when you actually go and view the product on the storefront the review tab is not showing. The only way to get it to show up would be to turn it to a different drop down, save, then change it back and save.

If I create the product as a specific store it works perfectly. Any ideas on how to get it to work when creating as "All Stores"?

So, I thought making this change worked, and it sort of did, but not really. My client is using three storefronts and when she adds products as "All Stores" it shows the "Communication & Rating" as selected after creating a new product, but when you actually go and view the product on the storefront the review tab is not showing. The only way to get it to show up would be to turn it to a different drop down, save, then change it back and save.

If I create the product as a specific store it works perfectly. Any ideas on how to get it to work when creating as "All Stores"?

You can modify the 'design/backend/templates/addons/discussion/hooks/products/detailed_content.post.tpl' file: remove or comment the '{if $runtime.company_id && "ULTIMATE"|fn_allowed_for || "MULTIVENDOR"|fn_allowed_for}' condition (and the closing '{/if}' also).

In this case in 'All stores' mode the changes will be applied for all stores. If you select a store, the changes will be applied for selected store only.

Thanks Simtech. I tired that and it still didn't work. This is what I did to the code:

    {include file="common/subheader.tpl" title=__("comments_and_reviews") target="#discussion_product_setting"}
    
{$no_hide_input = false} {if "ULTIMATE"|fn_allowed_for} {$no_hide_input = true} {/if}
		{include file="addons/discussion/views/discussion_manager/components/allow_discussion.tpl" prefix="product_data" object_id=$product_data.product_id object_type="P" title=__("discussion_title_product") no_hide_input=$no_hide_input}
	

Before I did the I tried just // both lines and it still didn't work.

For smarty templates you use

{* this is a comment *}

http://www.smarty.net/docsv2/en/language.basic.syntax.tpl#language.syntax.comments

For smarty templates you use

{* this is a comment *}

http://www.smarty.net/docsv2/en/language.basic.syntax.tpl#language.syntax.comments

Thanks you Triplets that did the trick!!

I hope it works as you need now :)