Useful direct SQL queries for Magento 2 developers

February 14, 2018 Iyngaran Iyathurai 0

Select product default Attribute set id

  Select product Attribute Group Id by using attribute_group_code and Attribute Set ID

  Update attribute_group_id for product attribute

  Update sort_order for product attribute

  Delete a custom attribute using entity_type_id and attribute_code. Delete a custom attribute using entity_type_id and attribute_code.  For this example, I am going to delete a product attribute, which has  attribute_code as ‘iyn_product_option’. To delete a custom attribute, we need to […]

Build Multi-lingual application with the Zend Framework

October 21, 2017 Iyngaran Iyathurai 0

We can not imagine a modern web application without a multi language support. I will show you how easy it is to setup usage of multiple languages in Zend Framework and how to setup some basic language routes (handy for SEO stuff). The Zend Framework offers many ways for you to store your translated strings. It could be an array, a CSV or XML file or you could use gettext which we will be using […]

Configure PHP Remote Debugging in Vagrant box with Xdebug and PhpStorm

July 8, 2017 Iyngaran Iyathurai 0

Note: This article concerns PHP 7.0,PhpStorm 2017.2 (EAP) and Vagrant box bento/centos-7.2. Step1: Install Xdebug on your Vagrant virtual machine You need to have Xdebug installed on your virtual machine to benefit from its services.

Then, we need configure it: We need enable the remote debug and add IDEKEY on XDEBUG. To do that, we need modify the php-xdebug configuration file (xdebug.ini). Lets modify the php-xdebug configuration file

And the following lines at […]

Split time slots between start time and end time in PHP

July 8, 2015 Iyngaran Iyathurai 3

Creating time between start time and end time in interval of 30 Minutes in PHP

Test it now

   

Calculate distance between two locations by Latitude and Longitude

May 22, 2015 Iyngaran Iyathurai 0

The following code returns the distance between to locations based on each point’s longitude and latitude. Passed to function: lat1, lon1 = Latitude and Longitude of point 1 (in decimal degrees) lat2, lon2 = Latitude and Longitude of point 2 (in decimal degrees) unit = the unit you desire for results where: ‘M’ is statute miles (default) ‘K’ is kilometers ‘N’ is nautical miles   PHP Code

Javascript

Reference Links http://blog.iyngaran.info/php-get-latitudelongitude-from-an-address-with-google-map http://www.movable-type.co.uk/scripts/latlong.html  

UTF8 Problem, incorrect display of special characters… (é, É, å, ä, ö etc.)

May 4, 2014 Iyngaran Iyathurai 0

Are you still facing problem, when display the special characters…(£,é, É, å, ä, ö etc.) ? Here is the solution to fix the issue. Firstly, make sure that your database table is set to character set UTF-8. So you must create the database, with UTF-8 encoding. Create a new database, with UTF-8 encoding

Or If you have created the database already, you need to convert it to UTF-8 encoding First, backup! and alter the […]

PHP – Get Latitude/Longitude From an Address with Google Map

March 13, 2014 Iyngaran Iyathurai 4

The  following PHP code convert an address to geocode Latitude/Longitude positioning with Google Maps.

How to check if an email address exists without sending an email?

October 29, 2013 Iyngaran Iyathurai 2

We have all been doing email address validation for a very long time to make sure that the email is correctly formatted. This is to avoid users entering wrongly formatted email address but still they can accidentally give us a wrong email address. Example of a correctly formatted email address but still wrong: iyngaran@oracle.com[VALID format but does not exist] So is there a QUICK solution to really check the email without sending a test message […]

How to enable PHP error logging via .htaccess

October 10, 2011 Iyngaran Iyathurai 0

Tracking PHP errors is a must when troubleshooting unexpected issues, related to plugins, themes. But you don’t want to have them visible on your site, especially not your customers. Here is a tutorial how to log all PHP errors behind the scenes to a private file. Tracking your site’s PHP errors is an excellent way to manage and troubleshoot unexpected issues related to plugins and themes. Even better, monitoring PHP errors behind the scenes via […]

Speed Up Your Site – Web Site Optimization

February 14, 2011 Iyngaran Iyathurai 0

The load time of websites is one of the most important factors affecting its usability; most Internet users will just skip a site altogether if it fails to load within a couple of seconds. Slow-loading websites are one of the main reasons that visitors may leave a site. As a result, it is important to ensure that your website is fast and regularly make improvements as content changes. The content should make up the majority […]