Skip to main content

Posts

Showing posts from June, 2015

[magento] How to activate customer

SELECT * FROM customer_entity_int attribute_id = 179 (customer activation) if value = 1, then the customer is activated +----------+----------------+--------------+-----------+-------+ | value_id | entity_type_id | attribute_id | entity_id | value | +----------+----------------+--------------+-----------+-------+ |     4054 |              1 |          179 |       530 |     1 | +----------+----------------+--------------+-----------+-------+

[symfony] Handling error

(1) List up errors if ( $form -> isValid () ) { // ... } else { // get a ConstraintViolationList $errors = $this -> get ( 'validator' )-> validate ( $user ); $result = '' ; // iterate on it foreach ( $errors as $error ) { // Do stuff with: // $error->getPropertyPath() : the field that caused the error // $error->getMessage() : the error message } }   (2) Frontend $ . extend ({ ajaxData : function ($button , options) { var defaultOptions = { type : 'POST' , beforeSend : function () { $button. prop ( 'disabled' , true ) ; } , complete : function () { $button. prop ( 'disabled' , false ) ; } , success : function (data) { window . location . reload () ; } , error : function (xhr) { if...

[jquery] Update widget every 10 secs by Ajax

var updateWidgets = (function() {             var UPDATE_WIDGETS_INTERVAL = 10000,                 containers = {                     nps: $('#nps-widget-container'),                     feedback: $('#feedback-widget-container')                 };             return function() {                 setTimeout(function() {                     $.ajax({      ...