Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

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

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1244 posts

Posted 27 June 2013 - 08:58 AM #1

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

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


[ Tested on CS-Cart: version 3.0.6 PROFESSIONAL ]

I hope that helps,

---
Valentin

 
  • BaDTaG
  • Senior Member
  • Members
  • Join Date: 01-Jul 11
  • 188 posts

Posted 10 October 2013 - 08:48 AM #2

Will this work on cs-cart 4?
VPS Hosting whit easy VPS control panel no technical skills required.
EDB Eksperten din online it forhandler

 
  • thefreer
  • Member
  • Trial users
  • Join Date: 17-Oct 12
  • 29 posts

Posted 26 January 2014 - 12:12 AM #3

Hi,

Seems like it doesn't work on cscart 4.

Anyone has an upgrade of file ?

 
  • thefreer
  • Member
  • Trial users
  • Join Date: 17-Oct 12
  • 29 posts

Posted 26 January 2014 - 12:17 AM #4

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

changed :

<option {if $discussion.type == "B"}selected="selected"{/if} value="B">{__("communication")} {__("and")} {__("rating")}</option>
to :

<option {if $discussion.type == "B" || !$discussion}selected="selected"{/if} value="B">{__("communication")} {__("and")} {__("rating")}</option>

and :

<option {if $discussion.type == "D" || !discussion}selected="selected"{/if} value="D">{__("disabled")}</option>

to :

<option {if $discussion.type == "D"}selected="selected"{/if} value="D">{__("disabled")}</option>

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

 
  • NairdaCart
  • Senior Member
  • Members
  • Join Date: 18-Jul 11
  • 306 posts

Posted 26 January 2014 - 10:58 AM #5

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

 
  • thefreer
  • Member
  • Trial users
  • Join Date: 17-Oct 12
  • 29 posts

Posted 26 January 2014 - 09:43 PM #6

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: .

 
  • Angeltown
  • Advanced Member
  • Members
  • Join Date: 05-Feb 15
  • 136 posts

Posted 09 March 2015 - 06:00 AM #7

Edited : /design/backend/templates/addons/discussion/views/discussion_manager/components/allow_discussion.tpl

changed :

<option {if $discussion.type == "B"}selected="selected"{/if} value="B">{__("communication")} {__("and")} {__("rating")}</option>
to :

<option {if $discussion.type == "B" || !$discussion}selected="selected"{/if} value="B">{__("communication")} {__("and")} {__("rating")}</option>

and :

<option {if $discussion.type == "D" || !discussion}selected="selected"{/if} value="D">{__("disabled")}</option>

to :

<option {if $discussion.type == "D"}selected="selected"{/if} value="D">{__("disabled")}</option>


Thank you! Worked beautifully in MV 4.2.4

CS-Cart 4.7.4 & CS-Cart Multi-Vendor 4.9.1


 
  • sendrrmy
  • Member
  • Trial users
  • Join Date: 24-Feb 15
  • 16 posts

Posted 20 June 2015 - 07:16 AM #8

Worked perfectly on CS-Cart Multivendor 4.3.1 as well.

 
  • rmsilver7
  • Junior Member
  • Members
  • Join Date: 30-Mar 10
  • 201 posts

Posted 13 November 2015 - 12:04 AM #9

Thank you this was very helpful!!!


Riika Magnus
Silver-Logic Web & Print Services
http://www.silver-logic.com
(503) 213-3551

I offer Website Design, Management, Hosting and Graphic Design services. I'm located in Portland, OR and have been using CS-Cart since 2009 and doing Website design since 2003. I would love to hear about your next project!

 
  • rmsilver7
  • Junior Member
  • Members
  • Join Date: 30-Mar 10
  • 201 posts

Posted 23 November 2015 - 11:04 PM #10

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"? 


Riika Magnus
Silver-Logic Web & Print Services
http://www.silver-logic.com
(503) 213-3551

I offer Website Design, Management, Hosting and Graphic Design services. I'm located in Portland, OR and have been using CS-Cart since 2009 and doing Website design since 2003. I would love to hear about your next project!

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3303 posts

Posted 24 November 2015 - 07:11 AM #11

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.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • rmsilver7
  • Junior Member
  • Members
  • Join Date: 30-Mar 10
  • 201 posts

Posted 25 November 2015 - 01:42 AM #12

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

<!-- {if $runtime.company_id && "ULTIMATE"|fn_allowed_for || "MULTIVENDOR"|fn_allowed_for} -->
    {include file="common/subheader.tpl" title=__("comments_and_reviews") target="#discussion_product_setting"}
    <div id="discussion_product_setting" class="in collapse">
    	<fieldset>
			{$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}
    	</fieldset>
    </div>
<!-- {/if} -->

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


Riika Magnus
Silver-Logic Web & Print Services
http://www.silver-logic.com
(503) 213-3551

I offer Website Design, Management, Hosting and Graphic Design services. I'm located in Portland, OR and have been using CS-Cart since 2009 and doing Website design since 2003. I would love to hear about your next project!

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1176 posts

Posted 25 November 2015 - 02:51 AM #13

For smarty templates you use

 

{*  this is a comment   *}

 

http://www.smarty.ne...syntax.comments



 
  • rmsilver7
  • Junior Member
  • Members
  • Join Date: 30-Mar 10
  • 201 posts

Posted 25 November 2015 - 04:30 AM #14

For smarty templates you use

 

{*  this is a comment   *}

 

http://www.smarty.ne...syntax.comments

 

Thanks you Triplets that did the trick!!


Riika Magnus
Silver-Logic Web & Print Services
http://www.silver-logic.com
(503) 213-3551

I offer Website Design, Management, Hosting and Graphic Design services. I'm located in Portland, OR and have been using CS-Cart since 2009 and doing Website design since 2003. I would love to hear about your next project!

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3303 posts

Posted 25 November 2015 - 05:45 AM #15

I hope it works as you need now :)


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics