Jump to content


Highest Reputation Content


#808 For those with issues, Few Tips

Posted by Jacob Bowen on 31 July 2013 - 08:37 PM

Hello People, So surfing thru the forums on alot of different sites that pertain to opencart, and even here on the openshop forum. I've noticed that people have alot of failings due to common things they did not due.

Remember, Always Delete your VqCache when adding/updating vqmods

Always keep your Cache folder clean (Located at /system/cache/)

Always Do backups, and with that do not use the built in backup/restore system in opencart as it CAN NOT HANDLE large databases(Mines roughly 40MB, couldn't use the backup once my DB became around 10-15MB)

When testing new Mods/Extentions, always use a test site, even if its http://www.stupiddomainname.com/Test , it doesn't have to be a subdomain.


With those things said, Here are a few files of use you guys might like:

 

A opencart Optimized .htaccess

<IfModule pagespeed_module>
	ModPagespeed off
	ModPagespeedEnableFilters move_css_above_scripts,move_css_to_head,rewrite_style_attributes,flatten_css_imports,make_google_analytics_async,combine_javascript,local_storage_cache
	ModPagespeedEnableFilters convert_jpeg_to_progressive,inline_preview_images,resize_mobile_images,remove_comments,collapse_whitespace,sprite_images,lazyload_images
	#ModPagespeedDisableFilters combine_css
</IfModule>

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin: "*"
	BrowserMatch MSIE ie
	Header set X-UA-Compatible "IE=Edge,chrome=1"
    # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
    <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
      Header unset X-UA-Compatible
    </FilesMatch>
</IfModule>

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

AddType application/javascript         	js
AddType audio/ogg                      	oga ogg
AddType audio/mp4                      	m4a
AddType video/ogg                      	ogv
AddType video/mp4                      	mp4 m4v
AddType video/webm                     	webm
AddType image/svg+xml              		svg svgz 
AddEncoding gzip                       	svgz                      
AddType application/vnd.ms-fontobject  	eot
AddType application/x-font-ttf    		ttf ttc
AddType font/opentype                  	otf
AddType application/x-font-woff        	woff                                      
AddType image/x-icon                   	.ico
AddType image/webp                     	webp
AddType text/cache-manifest            	appcache manifest
AddType text/x-component               	htc
AddType application/x-chrome-extension 	crx
AddType application/x-xpinstall        	xpi
AddType application/octet-stream       	safariextz
AddType text/x-vcard                   	vcf


<FilesMatch "\.combined\.js$">
  Options +Includes
  AddOutputFilterByType INCLUDES application/javascript application/json
  SetOutputFilter INCLUDES
</FilesMatch>
<FilesMatch "\.combined\.css$">
  Options +Includes
  AddOutputFilterByType INCLUDES text/css
  SetOutputFilter INCLUDES
</FilesMatch>

<IfModule mod_deflate.c>

<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  </IfModule>
</IfModule>

<IfModule filter_module>
  FilterDeclare   COMPRESS
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
  FilterChain     COMPRESS
  FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
</IfModule>

<IfModule !mod_filter.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
  AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive on

  ExpiresDefault                          		"access plus 1 month"
  ExpiresByType text/cache-manifest       		"access plus 0 seconds"
  ExpiresByType text/html                 		"access plus 0 seconds"
  ExpiresByType text/xml                  		"access plus 0 seconds"
  ExpiresByType application/xml           		"access plus 0 seconds"
  ExpiresByType application/json          		"access plus 0 seconds"
  ExpiresByType application/rss+xml       		"access plus 1 hour"
  ExpiresByType application/atom+xml      		"access plus 1 hour"
  ExpiresByType image/x-icon          	  		"access plus 1 month" 
  ExpiresByType image/gif                 		"access plus 1 month"
  ExpiresByType image/png                 		"access plus 1 month"
  ExpiresByType image/jpg                 		"access plus 1 month"
  ExpiresByType image/jpeg                		"access plus 1 month"
  ExpiresByType video/ogg                 		"access plus 1 month"
  ExpiresByType audio/ogg                 		"access plus 1 month"
  ExpiresByType video/mp4                 		"access plus 1 month"
  ExpiresByType video/webm                		"access plus 1 month"
  ExpiresByType text/x-component          		"access plus 1 month"
  ExpiresByType font/truetype             		"access plus 1 month"
  ExpiresByType font/opentype             		"access plus 1 month"
  ExpiresByType application/x-font-woff   		"access plus 1 month"
  ExpiresByType image/svg+xml             		"access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject 	"access plus 1 month"
  ExpiresByType text/css                  		"access plus 1 year"
  ExpiresByType application/javascript    		"access plus 1 year"
  
  <IfModule mod_headers.c>
    Header append Cache-Control "public"
  </IfModule>
  
</IfModule>

<IfModule mod_headers.c>
  Header unset ETag
</IfModule>

FileETag None

BrowserMatch "MSIE" brokenvary=1
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
BrowserMatch "Opera" !brokenvary
SetEnvIf brokenvary 1 force-no-vary

 <IfModule mod_rewrite.c>
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
 </IfModule>
 
Options +FollowSymlinks
Options -Indexes

<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Do you have ALOT of Items in your OC site? Is it running Very slow(4+ seconds to load)

More then likely this is due to OC's shitty handling of queries for product counts, Try these fix's:

 

If you are running 1.5.5.1 Try this Vqmod script (Just copy/paste into a file in your XML file such as making a file called say "Prodcutfix.xml"

    <!-- Created using vQmod XML Generator by UKSB - http://uksb.github.com/vqgen/ //-->
    <modification>
    <id><![CDATA[Fast Category Product Count Mod]]></id>
    <version><![CDATA[002]]></version>
    <vqmver><![CDATA[2.3.2]]></vqmver>
    <author><![CDATA[midgette ([email protected])]]></author>
    <file path="admin/model/catalog/" name="product.php">
    <operation info="Update category table whenever products are added to product_to_category table.">
    <search position="after" offset="1" index="1"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_category SET product_id = '" . (int)$product_id . "', category_id = '" . (int)$category_id . "'");]]></search>
    <add><![CDATA[ $this->updateCategory();]]></add>
    </operation>
    <operation info="Update category table whenever products are updated in product_to_category table.">
    <search position="after" offset="2" index="2"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_category SET product_id = '" . (int)$product_id . "', category_id = '" . (int)$category_id . "'");]]></search>
    <add><![CDATA[ $this->updateCategory();]]></add>
    </operation>
    <operation info="Update category table whenever products are deleted from product_to_category table.">
    <search position="after" index="3"><![CDATA[$this->cache->delete('product');]]></search>
    <add><![CDATA[ $this->updateCategory();
    }
    public function updateCategory() {
    $query = $this->db->query("SELECT COUNT(*) as 'haveqty' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" . DB_PREFIX . "category' AND COLUMN_NAME = 'qty'");
    if (empty($query->row['haveqty'])) {
    $this->db->query("ALTER TABLE " . DB_PREFIX . "category ADD COLUMN qty INT(11) DEFAULT 0 AFTER `status`");
    }
    $this->db->query("UPDATE " . DB_PREFIX . "category SET qty = (SELECT COUNT(*) FROM " . DB_PREFIX . "product_to_category WHERE category_id = " . DB_PREFIX . "category.category_id)");
    $this->cache->delete('category');]]></add>
    </operation>
    </file>
    <file path="admin/controller/setting/" name="setting.php">
    <operation>
    <search position="after" offset="5" index="1"><![CDATA[if (isset($this->request->post['config_product_count'])) {]]></search>
    <add><![CDATA[ $query = $this->db->query("SELECT COUNT(*) as 'haveqty' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" . DB_PREFIX . "category' AND COLUMN_NAME = 'qty'");
    if (empty($query->row['haveqty'])) {
    $this->db->query("ALTER TABLE " . DB_PREFIX . "category ADD COLUMN qty INT(11) DEFAULT 0 AFTER `status`");
    $this->db->query("UPDATE " . DB_PREFIX . "category SET qty = (SELECT COUNT(*) FROM " . DB_PREFIX . "product_to_category WHERE category_id = " . DB_PREFIX . "category.category_id)");
    $this->cache->delete('category');
    }
    ]]></add>
    </operation>
    </file>	
    <file path="catalog/controller/common/" name="header.php">
    <operation>
    <search position="replace" index="1"><![CDATA[$product_total = $this->model_catalog_product->getTotalProducts($data);]]></search>
    <add><![CDATA[//$product_total = $this->model_catalog_product->getTotalProducts($data);]]></add>
    </operation>
    <operation>
    <search position="replace" index="1"><![CDATA['name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),]]></search>
    <add><![CDATA['name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $child['qty'] . ')' : ''),]]></add>
    </operation>
    </file>
    <file path="catalog/controller/module/" name="category.php">
    <operation>
    <search position="replace" index="1"><![CDATA[$total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id']));]]></search>
    <add><![CDATA[//$total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id']));]]></add>
    </operation>
    <operation>
    <search position="replace" index="1"><![CDATA[$product_total = $this->model_catalog_product->getTotalProducts($data);]]></search>
    <add><![CDATA[//$product_total = $this->model_catalog_product->getTotalProducts($data);]]></add>
    </operation>
    <operation>
    <search position="replace" index="1"><![CDATA[$total += $product_total;]]></search>
    <add><![CDATA[//$total += $product_total;]]></add>
    </operation>
    <operation>
    <search position="replace" index="1"><![CDATA['name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),]]></search>
    <add><![CDATA['name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $child['qty'] . ')' : ''),]]></add>
    </operation>
    <operation>
    <search position="replace" index="1"><![CDATA['name' => $category['name'] . ($this->config->get('config_product_count') ? ' (' . $total . ')' : ''),]]></search>
    <add><![CDATA['name' => $category['name'] . ($this->config->get('config_product_count') ? ' (' . $category['qty'] . ')' : ''),]]></add>
    </operation>
    </file>
    <file path="catalog/controller/product/" name="category.php">
    <operation>
    <search position="replace" index="1"><![CDATA[$product_total = $this->model_catalog_product->getTotalProducts($data);]]></search>
    <add><![CDATA[//$product_total = $this->model_catalog_product->getTotalProducts($data);]]></add>
    </operation>
    <operation>
    <search position="replace" index="1"><![CDATA['name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),]]></search>
    <add><![CDATA['name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $result['qty'] . ')' : ''),]]></add>
    </operation>
    </file>
    </modification>

Or if you are running the new 1.5.6 Try this:

 

Open /catalog/controller/module/category.php and find this:

					'name'        => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),

Replace it with:

					'name'        => $child['name'] . ($this->config->get('config_product_count') ? : ''),

Also Find:

				'name'        => $category['name'] . ($this->config->get('config_product_count') ? ' (' . $total . ')' : ''),

Then replace with:

				'name'        => $category['name'] . ($this->config->get('config_product_count') ? : ''),

Then open /catalog/controller/common/header.php

 

Find line:

						'name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),

Replace with:

						'name'  => $child['name'] . ($this->config->get('config_product_count') ? : ''),

The above fix for 1.5.6 Is a hack and slash fix, USE AT YOUR OWN RISK, as there is not a VQmod made yet for 1.5.6 that works,.

 

 

 

 

 

 

 

 

Well those are a few things, I'll add more little tid bits here and there and fix this up a bit, If MaxD wants to sticky this i'll make sure its updated so that people can have some go to place for small fix's.


  • 2


#995 how to backup news in news extension

Posted by Jacob Bowen on 27 August 2013 - 05:04 AM

Everything is stored in the database, OC/OS is NOT a file based storage system. Its all MySQL


  • 1


#964 news background color

Posted by MaxD on 22 August 2013 - 08:29 PM

Cool )


  • 1


#956 Suggestions and feature requests

Posted by MaxD on 21 August 2013 - 08:20 PM

I havn't seen POS yet ))


  • 1


#953 how to remove menu in small screen?

Posted by MaxD on 21 August 2013 - 09:05 AM

Omg, my pleasure  :D


  • 1


#878 Need Webhosting?

Posted by Jacob Bowen on 06 August 2013 - 06:06 PM

Howdy all,

 

Some of you may know me from around the forums a bit, but if you don't, then hello :D

 

I own a Web hosting and Design company based in the US. I'm extending a offer to all users of the OpenShop script Discounted hosting with my company.

If you are wanting to get superb hosting, Design specifically for E-Commerce websites, Then Send me a PM.

We do have Set up hosting plans, But for the OpenShop community, i am willing to develop Individual plans made specifically for your needs.


Plans start for as low as 2$ a month, and will never go higher then 10$ depending on the type of service you request.


We also can help you set up your website, Develop a theme, and Do the SEO/Marketing for you, Just request a Quote and we can see what we can do.



Again if you are interested, Send me a PM On here or e-mail me at [email protected]


  • 1


#823 MORE SLIGHT ERRORS TO 1.6

Posted by Jacob Bowen on 01 August 2013 - 09:05 PM

Oh ok, it was due to a rich snippit mod, I have one that might work for you, But im running off a combined 1.5.5.1 and 1.5.6 settings so i'll test on both to make it work.


  • 1


#820 MORE SLIGHT ERRORS TO 1.6

Posted by Jacob Bowen on 01 August 2013 - 06:09 PM

No worries at all, we where all new to it at one point.


  • 1


#795 Uploading Products

Posted by markherman1234 on 28 July 2013 - 05:18 PM

I finally got it working.  You need to register to use the Web Tools API from the USPS web site.  Again, specifically, it is the Web Tools API that you need to register for.  Then, you will get an API Username (different from the regular Business Username).  Then, you need to run a couple of test calls to their API.  Once you do that, you call their tech support number and have them move your account to production.  The Web Tools API Username is the one you type into the OpenCart USPS Shipping configuration.

 

Good luck!!


  • 1


#764 Adding link in top menu

Posted by MaxD on 21 July 2013 - 10:41 AM

Yep. Do you have Link to the URL (for top menu) field at category Data Tab?


  • 1


#762 Adding link in top menu

Posted by MaxD on 21 July 2013 - 02:40 AM

You can add the link to top menu another way. Create a category and specify the link at second tab.


  • 1


#2735 Не находит доп картинки и описание к товару с Алиэкспресс !?

Posted by MaxD on 27 December 2016 - 11:36 AM

В LiveImport есть готовая настройка для Aliexpress. Не справляется?


  • 1


#2262 Cron job Clear Cache

Posted by MaxD on 17 July 2015 - 11:11 AM

Mail me your shop address to [email protected] and I will write you URL back.


  • 1


#1639 Where is my previous data

Posted by MaxD on 08 April 2014 - 01:04 PM

The config.php & admin/config.php is the same database as my previous one.

If the prefix is the same too, then your previous data was overwritten by installer.


  • 1


#1636 Where is my previous data

Posted by MaxD on 08 April 2014 - 08:53 AM

Greetings!

 

You should use OpenShop-Extension.zip to upgrade existing shop. I advise you to return to backup - if its possible.

 

If no, try to edit config.php and admin/config.php and specify correct DB_PREFIX for your data.


  • 1


#1287 how to check malicious code?

Posted by MaxD on 22 November 2013 - 05:02 PM

There are too many methods to do bad things. There is no way to check properly except reading and understanding the whole code.

 

All modules and themes are a matter of serious trust.


  • 1


#1255 idea for news + rss

Posted by MaxD on 13 November 2013 - 01:03 PM

Let me know when pavblog will become a nice replacement for OpenShop news module.

 

All $this-> ... things are simple refs to "global" objects (like request, session and so on). I don't know why Daniel decided to stuff them into controller object.

 

$a += 3; is equal to $a = $a + 3; 

$a .= "x"; is equal to $a = $a . "x";

 

Dot (.) is strings concantenation operand at PHP. "a" . "b" = "ab"


  • 1


#1218 [SOLVED] Error when viewing news

Posted by Ivan Pramono Susanto on 09 November 2013 - 11:26 AM

for fresh install before using news mod it's ok

but after installing news that would be a problem

see my other post about news and how to upgrade it's database

hope it will help

http://devs.mx/topic...ce-news-module/


  • 1


#1159 Video embed

Posted by Ivan Pramono Susanto on 31 October 2013 - 02:34 PM

as far as i know and tried i can embed youtube video in product discription by copy n paste embed code in product description source

hope it help


  • 1


#1088 Change opacity on menu dropdown

Posted by MaxD on 06 October 2013 - 01:55 PM

Find at vqmod/xml/OpenShop/-Max-Theming.xml

opacity: 0.9

and change it to desired value.


  • 1


Community Skin by Fredson Nunes Junior