Saltar al contenido
Codifíca.me | Desarrollo web | Programación

PopUpTo Share | Opencart

9 diciembre, 2013
Popup To share | opencart

Hemos realizado esta extensión para los usuarios de Opencart. El funcionamiento es bastante sencillo, mostrará un lightbox en modo Popup pidiendote que compartas el contenido de tu website en Facebook, Twitter o Google +.

Popup to Share muestra una ventana con los botones para compartir y con los textos que tu hayas escrito antes.

Compartir contenido de tu tienda y darte a conocer en las redes sociales puede ser una forma rápida de incrementar el número de tus visitas y posiblemente las ventas, sobretodo si quieres dar a conocer tu tienda online a través de las redes sociales.

Esta imagen muestra la extensión en funcionamiento.

 

Popup To share | opencart

Este es el código del fichero vQmod, por si queréis modificarlo para vuestra tienda o web.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<modification>
	<id><![CDATA[Add popuptoshare to opencart]]></id>
	<version><![CDATA[1.0]]></version>
	<vqmver><![CDATA[2.1.7]]></vqmver>
	<author><![CDATA[codifica.me website]]></author>
	<file name="admin/view/template/common/header.tpl">
		<operation>
			<search position="after"><![CDATA[
			<li><a href="<?php echo $information; ?>"><?php echo $text_information; ?></a></li>
			]]></search>
			<add><![CDATA[
			<?php if(isset($show)=="1"){ ?> 
			<li><a href="<?php echo $popuptoshare; ?>">PopUp To Share</a></li>
			<?php } ?>
			]]></add>
		</operation>
	</file>
	<file name="admin/controller/common/header.php">
		<operation>
			<search position="after"><![CDATA[
			$this->data['zone'] = $this->url->link('localisation/zone', 'token=' . $this->session->data['token'], 'SSL');
			]]></search>
			<add><![CDATA[
			$this->data['popuptoshare'] = $this->url->link('module/popuptoshare', 'token=' . $this->session->data['token'], 'SSL');
			]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[
			$this->data['text_zone'] = $this->language->get('text_zone');
			]]></search>
			<add><![CDATA[
			$this->data['text_popuptoshare'] = $this->language->get('text_popuptoshare');
			]]></add>
		</operation>
			<operation>
			<search position="after"><![CDATA[
			$this->load->model('setting/store');
			]]></search>
			<add><![CDATA[
			/* Extension uninstall code start */
			$this->load->model('setting/extension');
			$extensions = $this->model_setting_extension->getInstalled('module');  
			if (in_array("popuptoshare", $extensions)) {
			    $this->data['show'] = 1;
			} 
			/* Extension uninstall code end */
			]]></add>
		</operation> 
	</file>
	<file name="admin/model/setting/extension.php">
		<operation>
			<search position="after"><![CDATA[
			public function uninstall($type, $code) {
			]]></search>
			<add><![CDATA[
			if($code=="popuptoshare" && $type=="module"){
				$this->db->query("TRUNCATE TABLE " . DB_PREFIX . "t_popuptoshare");
		    }
			]]></add>
		</operation>
	</file>	 
	<file name="admin/language/english/common/header.php">
		<operation>
			<search position="after"><![CDATA[$_['text_zone']                        = 'Zones';]]></search>
			<add><![CDATA[$_['text_popuptoshare']                        = 'popuptoshare';]]></add>
		</operation>
	</file>
 
	<file name="catalog/view/theme/*/template/common/header.tpl">
		<operation error="after">
			<search position="before"><![CDATA[
             </head>
             ]]></search>
			<add><![CDATA[
			<style type="text/css">
    .fadebox {   
        display:block;    
        position: fixed;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: black;
        z-index:1001;
        -moz-opacity: 0.6;
        opacity:.60;
        filter: alpha(opacity=60);
 
   }
    .overbox {
        display: block;
        position: absolute;
        top: 30px;
        left: 25%;
        z-index:1002;        
        background-color: white;   
        width: 450px; 
        height: 200px;          
       -moz-box-shadow: 20px 20px 5px #424242;
       -webkit-box-shadow: 20px 10px 5px #424242;
        box-shadow: 20px 20px 5px #424242;
 
border-bottom:1px solid#ccc;border-top:1px solid#ccc;background-image:linear-gradient(bottom,#D8E7FC 0%,#EBF2FC 65%);background-image:-o-linear-gradient(bottom,#D8E7FF 0%,#EBF2FF 65%);background-image:-moz-linear-gradient(bottom,#D8E7FF 0%,#EBF2FF 65%);background-image:-webkit-linear-gradient(bottom,#D8E7FF 0%,#EBF2FF 65%);background-image:-ms-linear-gradient(bottom,#D8E7FF 0%,#EBF2FF 65%);background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#D8E7FF),color-stop(0.85,#EBF2FF));padding:16px;
 
 
border-radius: 32px; 
-moz-border-radius: 32px; 
-webkit-border-radius: 32px; 
border: 10px solid #000000;
 
}		
#eltitulo{
    overflow:hidden;
    font-family: verdana,sans-serif;
    font-size: 14px;
    font-weight: bold;
    color:white !important;  
    margin-left:10px;
}
#apDiv3 {
  overflow:hidden;
	position:relative;
	width:450px;
	height:20%;
	z-index:1004;
	background-color: #336699;
  font-size: 14px;
  font-weight: bold;
  color:white !important;  
  border-radius: 20px 20px 0px 0px; 
  -moz-border-radius: 20px 20px 0px 0px; 
  -webkit-border-radius: 20px 20px 0px 0px; 
  border: 0px solid #000000;  
  margin-top:0px !important; 
}
 
#apDiv4 {
  overflow:hidden;
	position:relative;
	width:450px;
	height:40%;
	z-index:1004;	  
  background-color: #F5FFFA;
  background: #F5FFFA; 
  background-repeat:no-repeat;
  background-position:left;
}
#apDiv45 {
  overflow:hidden;
	position:relative;
	width:450px;
	height:30%;
	z-index:1004;	  
  background-color: #F5FFFA;
  background: #F5FFFA; 
  background-repeat:no-repeat;
  background-position:left;
}
 
#apDiv5 {
  overflow:hidden;
	position:relative;
	left:0px;
	height:10%;
	z-index:1004;
	background-color: #336699;
 
  font-weight: bold;
  color:white !important;    
border-radius: 0px 0px 20px 20px; 
-moz-border-radius: 0px 0px 20px 20px; 
-webkit-border-radius: 0px 0px 20px 20px; 
border: 0px solid #000000;
font-size: 4px;
}
 
a.#apDiv5{
font-size: 4px;
}
#divimagen{
position:absolute;
}
</style>
 
<script type="text/javascript">
   function hideLightbox() {
        document.getElementById('over').style.display='none';
        document.getElementById('fade').style.display='none';
	}
		</script>
 
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>		
 
 
 
 
			]]></add>
		</operation>
	</file>
 
	<file name="catalog/controller/common/footer.php">
		<operation>
			<search position="after"><![CDATA[
			$this->load->model('catalog/information');
			]]></search>
			<add><![CDATA[
		 error_reporting(0);		 
         if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . DB_PREFIX . "t_popuptoshare' "))==1){
 
			//popuptoshare code start
	    $this->load->model('popuptoshare/popuptoshare');  
        $result[]= $this->model_popuptoshare_popuptoshare->ShowCompanyDetails(); 
 
        if(!empty($result[0])){			
			foreach ($result as $results) {
			    $this->data['detail'][] = array(		
		                'id'           => $results['id'],  
						'cabecera_popup'       => $results['cabecera_popup'],  
				        'textocuer_popup'       => $results['textocuer_popup'],  
				    	'facebook'       => $results['facebook'],  
				        'google'       => $results['google'],
				      	'status'       => $results['status'],
					    'twitter'       => $results['twitter']			        
				); 				
			}
        }       
        }            
        //popuptoshare code end
			]]></add>
		</operation>
	</file>
 
	<file name="catalog/view/theme/*/template/common/footer.tpl">
		<operation>
			<search position="before"><![CDATA[
			</body>
			]]></search>
			<add><![CDATA[
				<?php 
			error_reporting(0); 	
 
if (isset($this->request->get['route'])) {
	$route = $this->request->get['route'];
} else {
$route = '';
}
if (($route == 'common/home')||($route == '')) {		
if(isset($detail)) {   
	foreach ($detail as $detail_data) { 
	    if($detail_data['status']){
	?>
 
	<div id="over" class="overbox">
 
   <div id="divimagen" class="divimagen">
<a border="0" href="javascript:hideLightbox();">
<img border="0" style="border:0px; background:0; margin-left:445px; margin-top:-50px;" alt="X" title="Close" src="catalog/view/theme/default/image/close.png">
</a>
 
</div>
<div id="apDiv3">
<?php   
echo "<div style='margin-top:10px;' align='center'>".$detail_data['cabecera_popup']." </div>";
?>
 
    </div>
    <div id="apDiv4">      
      <p align="center">&nbsp;</p>
<?php   
echo "<div align='center'>".$detail_data['textocuer_popup']." </div>";
?>       
    <br>  <br>
</div>
<div id="apDiv45">
    <!--Facebook1 -->
 
 &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp
 
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $detail_data['facebook']; ?>&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; line-height:20px; margin:5px 15px 0 0; width:100px; height:20px"></iframe>
 
 &nbsp&nbsp&nbsp
 <!--Follow me twitter -->
 <a href="https://twitter.com/<?php echo $detail_data['twitter']; ?>" class="twitter-follow-button" data-show-count="false" data-lang="en">Seguir a @<?php echo $detail_data['twitter']; ?></a>
 
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
&nbsp&nbsp
 
 &nbsp&nbsp&nbsp&nbsp
<!-- Google +1. -->
<!-- Coloca esta etiqueta donde quieras que se muestre el botn +1. -->
<div class="g-plusone" data-href="<?php echo $detail_data['google']; ?>"></div>
 
<!-- Coloca esta peticin de presentacin donde creas oportuno. -->
<script type="text/javascript">
  (function() {
    var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
    po.src = \'https://apis.google.com/js/plusone.js\';
    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
 
 
 
  </div> 
  <div id="apDiv5"><div align="left">
       &nbsp; &nbsp&nbsp <a href="https://www.codifica.me/" target="_blank"> by CJO </a> </div></div>  
 
 </div><div id="fade" class="fadebox">&nbsp;</div>  ';
 
 
<?php 
		}
	}	
}
}
 ?>		
 		]]></add>
		</operation>
	</file>
 
</modification>