Skip to content

Instantly share code, notes, and snippets.

@artmouse
artmouse / gist:3f90c0dc9eee508cb35b
Created May 25, 2015 11:43
Mana Filters DB error FIX
How to fix
If you are reading this article good chances are that you already getting one of the errors listed above and looking for solution.
Here it is:
Let Magento think the extension is not installed.
As extension can be half-installed into database (see below), throw away that half-installed database tables.
Let Magento install the extension anew.
@artmouse
artmouse / gist:6cbfd3f297c6311d57ff
Created June 17, 2015 19:33
Order comment from Gomage in email
{{var order.gomage_checkout_customer_comment}}
@artmouse
artmouse / gist:f60159d401a1d082c34d
Created June 18, 2015 09:22
Magento. How to hide prices and “Add to cart” button for non-logged in visitors
Let’s hide prices for guest users everywhere.
Open app/design/frontend/base/default/template/catalog/product/ folder and copy price.phtml file to the app/design/frontend/base/template/themeXXX/catalog/product/ folder, where XXX is the number of your theme, and then place the following code on top of it:
<?php
if(!Mage::getSingleton('customer/session')->isLoggedIn()){
echo '<span class="login_for_price"><strong>Login to See Price</strong></span><br>';
return;
}
?>

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@artmouse
artmouse / yoast-nulled.php
Created October 16, 2015 19:54 — forked from mihdan/yoast-nulled.php
Занулить yoast-seo-premium
<?php
/**
* 1. В таблице wp_options находим ключ yoast-seo-premium_license или wordpress-seo-premium_license
* и меняем его значение на `a:3:{s:3:"key";s:6:"zalupa";s:6:"status";s:5:"valid";s:11:"expiry_date";s:19:"2970-01-01 00:00:00";}`
*
* 2. Чтобы не слетали все ваши махинации после захода на страницу обновления или проверки лицензии,
* достаточно запретить плагину ломиться по своему АПИ на свой сайт.
* Я это сделал просто: в файле \wordpress-seo-premium\vendor\yoast\license-manager\class-update-manager.php
*/
@artmouse
artmouse / performance.patch
Created November 5, 2015 13:27 — forked from DimaSoroka/performance.patch
Performance improvement for Magento Patch SUPEE-6788
Index: app/code/core/Mage/Admin/Model/Variable.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/code/core/Mage/Admin/Model/Variable.php (revision 2bd128c1f190cd9ea63269824f09789199565251)
+++ app/code/core/Mage/Admin/Model/Variable.php (revision )
@@ -30,6 +30,13 @@
class Mage_Admin_Model_Variable extends Mage_Core_Model_Abstract
{
@artmouse
artmouse / amshopby-ajax.js
Created November 6, 2015 11:11 — forked from dangtrinhtran/amshopby-ajax.js
Add ajax loading
Amasty_Shopby Extension: js\amasty\amshopby\amshopby-ajax.js
<script type="text/javascript">
//Line 116
/*$$('div.amshopby-overlay').each(function(e){
e.show();
});*/
//Call function at here
jQuery(document).configurationAjax('createLoading');
@artmouse
artmouse / local.xml
Created November 9, 2015 23:17 — forked from MikeWilkie/local.xml
Magento – Disable Excessive Logging and Reporting in app/etc/local.xml
<?xml version="1.0"?>
<!-- license -->
<config>
<global>
<!-- global config -->
</global>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
<?php
/**
* Generate modman file from Magento Connect 2.0 package.xml
*
* Usage:
*
* php package2modman.php path/to/package.xml > path/to/modman
*
*/
require_once(__DIR__ . "/../www/app/Mage.php");