Skip to main content

Posts

Showing posts from October, 2016

Fix to Pricing Rule for Magneto >= 1.9.2.0

# MUST PATCH for Magento version >= 1.9.2.0 http://magento.stackexchange.com/questions/53699/fatal-error-when-adding-configurable-product-in-cart-and-using-products-subsele https://gist.github.com/tux-rampage/4d318ef516c8f4b2cf7e#file-luka-mce20151203-salesrule-hotfix-patch ### Example app/code/local/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php ``` public function validate(Varien_Object $object) {     /** @var Mage_Catalog_Model_Product $product */     $product = $object->getProduct();     if (!($product instanceof Mage_Catalog_Model_Product)) {         $product = Mage::getModel('catalog/product')->load($object->getProductId());     }     $valid = parent::validate($object);     if (!$valid && $product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {         $children = $...

Browser caching (.htaccess)

<IfModule mod_expires.c> ############################################ ## Add default Expires header ## http://developer.yahoo.com/performance/rules.html#expires # Turn on the module. ExpiresActive on # Set the default expiry times. ExpiresDefault "access plus 2 days" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType text/css "now plus 1 month" ExpiresByType image/ico "access plus 1 month" ExpiresByType image/x-icon "access plus 1 month" ...

Apache Compressor (server config)

<Location />     # Insert filter     SetOutputFilter DEFLATE     # Netscape 4.x has some problems...     BrowserMatch ^Mozilla/4 gzip-only-text/html     # Netscape 4.06-4.08 have some more problems     BrowserMatch ^Mozilla/4\.0[678] no-gzip     # MSIE masquerades as Netscape, but it is fine     # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html     # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48     # the above regex won't work. You can use the following     # workaround to get the desired effect:     BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html     # Don't compress images     SetEnvIfNoCase Request_URI \     \.(?:gif|jpe?g|png)$ no-gzip dont-vary     # Make sure proxies don't deliver the wrong content     Header...