Magento – Adding custom variables to Magento Static Blocks

I’ve been asked to customize the front page of a magento store. The client wanted the ability to specify a set of variables that can be used in CMS static blocks so static blocks can be a little more dynamic.

By default, the standard magento CMS static blocks don’t provide access to the custom variables. so I thought I was going to have to build an extension to pass the variables in. However after a little bit of finding, I found that this functionality is available as standard in Magento, you just need to do it properly.

Continue reading

Laravel – Change user password with tinker tool

change password

Today just asked myself if i can change user password in Laravel via command line, so things will be easier for us to work with Laravel products. I bet many of you use default Laravel user model (which is good for us in this case). if you do, this article is for you, i found an interesting tool within Laravel command line interface name ‘tinker’

Continue reading

Ruby – Introduce a new great tool for developers : regular expression builder

Today is a great day because i just finished my little tool name ‘RegexiZ’ (AKA : regular expression with ndthanh.net). this tool will help you to solve your problem with regular expressions – yeah, it’s a big problem when you decided to use regular expressions in your program. every developer know about the magic of regular expression, so let’s get start at https://ndthanh.net/regexiz 😀

note : this program is implemented base on Rails 4

Some people, when confronted with a problem, think
“I know, I’ll use regular expressions.” Now they have two problems.

Magento – Clean database dump for development purpose

cleaning database

Mangeto Database is huge and complicated, everyone knows about this truth. It’s a big obstacle for many developers who start working on a new project or grab latest changes on production server. The following procedure will help you to reduce size of production database a lot before downloading to you local environment.

Continue reading

Magento – Remove redundant attributes

Delete_Banner

Some time Magento redundant attributes can be very harmful. for example, AheadWork shop by brand will add aw_shopbybrand_brand attribute to catalog_product, it’s ok when you still use AheadWork module but it can be a big trouble like fatal error on server or producing error messages in your log file when you replace it with another extension. This issue happened because you just removed AheadWork module code from your Magento installation, aw_shopbybrand_brand attribute is still stay in your database. in this article, i will show you a setup script that will remove it.
Continue reading

Javascript – continuously, respectively send requests to server

continuous

Sometime you may want to send requests continuously to server with one request each time ( like a foreach in PHP, or for x in array or .each in Ruby …). we have ‘for’ and ‘for .. in’ loop but it’s not smart enough to wait for an Ajax request to be responded. so it doesn’t help us to fulfill our target. what should we do to loop through array, send Ajax request to server with data from array element and wait for response before sending new request ?

Continue reading

MySQL general error – 2006 MySQL server has gone away

paperplan

Does this error message scare you ?

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Today we will take a look at it and find ways to deal with it 🙂 . after investigating the issue and google it online, i founded two most common reasons (and fixes) for the MySQL server has gone away (error 2006) are:

Continue reading

Magento – Installing Extensions via Command Line

install-banner

I don’t like the idea of having to change permissions of my magento install to add on new extensions. There’re some services that allow you to download extension in compressed file like http://freegento.com/ddl-magento-extension.php , so you will only need to extract then copy&paste to your Magento installation folder, this is also a pain to me, especially when i’m on a Mac (yes, Mac is bad at merging files) . Thanks to Magento, we have command line for this type of work.

Continue reading