Post by rajeshsangtiani » Sun Jul 01, 2018 3:58 am

Hello All
I want to manually add facebook comments on my opencart 3.0.2.0
Homepage.
any body help how to add facebook comments
Thanks


Posts

Joined
Mon Apr 09, 2018 4:07 am

Post by straightlight » Sun Jul 01, 2018 6:38 am

This extension may be useful: https://www.opencart.com/index.php?rout ... n_id=21571 .

Two files to modify for v3.x releases would be your admin/view/template/extension/module/facebook_comments.twig file (new file):

Code: Select all

{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-google-hangouts" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1>{{ heading_title }}</h1>
      <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
        <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
		{% endfor %}
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    {% if error_warning %}
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    {% endif %}
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3>
      </div>
      <div class="panel-body">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-google-hangouts" class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-name">{{ entry_name }}</label>
            <div class="col-sm-10">
              <input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control" />
		      {% if error_name %}
              <div class="text-danger">{{ error_name }}</div>
			  {% endif %}
            </div>
          </div> 
		 <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-app-id"><span data-toggle="tooltip" title="{{ help_app_id }}">{{ entry_app_id }}</span></label>
            <div class="col-sm-10">
			    <div class="input-group">
					<span class="input-group-addon"><i class="fa fa-facebook"></i></span>
					<input type="text" name="app_id" value="{{ app_id }}" placeholder="{{ entry_app_id }}" id="input-app-id" class="form-control" />
				</div>	
                {% if error_app_id %}
                <div class="text-danger">{{ error_app_id }}</div>
			    {% endif %}
            </div>
         </div>
         <div class="form-group">
            <label class="col-sm-2 control-label" for="input-color-scheme"><span data-toggle="tooltip" title="{{ help_color_scheme }}">{{ entry_color_scheme }}</span></label>
            <div class="col-sm-10">
              <select name="color_scheme" id="input-color-scheme" class="form-control">
				  {% if color_scheme == 'dark' %}
				  <option value="dark" selected="selected">{{ text_dark }}</option>
				  <option value="light">{{ text_light }}</option>
				  {% else %}
				  <option value="dark">{{ text_dark }}</option>
				  <option value="light" selected="selected">{{ text_light }}</option>			  
				  {% endif %}
              </select>
            </div>
         </div> 	
		 <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-num-posts"><span data-toggle="tooltip" title="{{ help_num_posts }}">{{ entry_num_posts }}</span></label>
            <div class="col-sm-10">
				<input type="text" name="num_posts" value="{{ num_posts }}" placeholder="{{ entry_num_posts }}" id="input-num-posts" class="form-control" />
				{% if error_num_post %}
                <div class="text-danger">{{ error_num_posts }}</div>
				{% endif %}
            </div>
         </div>
         <div class="form-group">
            <label class="col-sm-2 control-label" for="input-order-by"><span data-toggle="tooltip" title="{{ help_order_by }}">{{ entry_order_by }}</span></label>
            <div class="col-sm-10">
				<div class="input-group">
				  <span class="input-group-addon"><i class="fa fa-sort-alpha-asc"></i></span>
				  <select name="order_by" id="input-order-by" class="form-control">
					  {% if order_by == 'time' %}
					  <option value="social">{{ text_social }}</option>
					  <option value="reverse_time" selected="selected">{{ text_reverse_time }}</option>		  
					  <option value="time" selected="selected">{{ text_time }}</option>	  
					  {% elseif order_by == 'reverse_time' %}
					  <option value="social">{{ text_social }}</option>
					  <option value="reverse_time" selected="selected">{{ text_reverse_time }}</option>		  
					  <option value="time">{{ text_time }}</option>
					  {% else %}
					  <option value="social" selected="selected">{{ text_social }}</option>
					  <option value="reverse_time">{{ text_reverse_time }}</option>		  
					  <option value="time">{{ text_time }}</option>					  
					  {% endif %}
				  </select>
				</div>  
            </div>
         </div> 			 
         <div class="form-group">
            <label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
            <div class="col-sm-10">
              <select name="status" id="input-status" class="form-control">
				  {% if status %}
				  <option value="1" selected="selected">{{ text_enabled }}</option>
				  <option value="0">{{ text_disabled }}</option>
				  {% else %}
				  <option value="1">{{ text_enabled }}</option>
				  <option value="0" selected="selected">{{ text_disabled }}</option>			  
				  {% endif %}
              </select>
            </div>
         </div> 		  
        </form>
      </div>
    </div>
  </div>
</div>
{{ footer }}
In catalog/view/theme/<your_theme>/template/module/facebook_comments.twig (new file):

Code: Select all

<h3>{{ heading_title }} (<fb:comments-count href={{ url }}</fb:comments-count>)</h3>
<div class="row">
  <div class="col-sm-12">
	<div class="fb-comments" data-href="{{ url }}" data-colorscheme="{{ color_scheme }}" data-numposts="{{ num_posts }}" data-order-by="{{ order_by }}" data-width="100%"></div>
  </div>
</div>

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={{ app_id }}";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
And you have a fully compatible OC v3.x releases with this extension.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rajeshsangtiani » Wed Aug 15, 2018 6:49 pm

Hello
I have replaced both files & upload through filezila
after install I'm facing this error plz support what should I do.
Thanks


Fatal error: Uncaught exception 'Exception' with message 'Error: Could not load model extension/module!' in /home/ravimedi/ocartdata/storage/modification/system/engine/loader.php:89 Stack trace: #0 /home/ravimedi/public_html/html/admin/controller/extension/module/facebook_comments.php(11): Loader->model('extension/modul...') #1 [internal function]: ControllerExtensionModuleFacebookComments->index() #2 /home/ravimedi/ocartdata/storage/modification/system/engine/action.php(79): call_user_func_array(Array, Array) #3 /home/ravimedi/public_html/html/admin/controller/startup/router.php(26): Action->execute(Object(Registry), Array) #4 [internal function]: ControllerStartupRouter->index() #5 /home/ravimedi/ocartdata/storage/modification/system/engine/action.php(79): call_user_func_array(Array, Array) #6 /home/ravimedi/public_html/html/system/engine/router.php(67): Action->execute(Object(Registry)) #7 /home/ravimedi/public_html/html/system/engine/router.php(56): Router->execute(Object(Action)) #8 /home/ravimedi/public_html/html/sy in /home/ravimedi/ocartdata/storage/modification/system/engine/loader.php on line 89


Posts

Joined
Mon Apr 09, 2018 4:07 am
Who is online

Users browsing this forum: Baidu [Spider] and 31 guests