Catalog Product update Magento 1.x – CSV

If you want to update attribute value for Magento catalog product in bulk, you can use CSV. Just create a CSV file with column SKU and respective attribute values for a product.

Using the above PHP script you can update multiple attribute value programmatically. You can set CRON to run this script automatically.

The above script capable to upload above 1 lakh products attributes value via CRON and CSV read from bottom to up that help when you have a very large file.

 

 

 

Creating Header and Footer Template in Codeigniter

When you are creating/developing large websites/applications you need to fragment your web-page in sections like navigation menu, header and footer. The navigation menu, header and footer usually stay same on all pages of your website/application. If you don’t use sections for your web-page and if you want to change something like logo in header, add link in navigation menu or add/edit description in footer then you have to change on all pages manually.

PHP already have solution for this problem with the include() method. With this method you can include any file within another file.

In Codeigniter, you can create custom method in Loader class and call group of views. Codeigniter have Loader Class, initialized automatically by the system, as the name of class, is used to load elements like libraries, helpers, models, view files or your own files.

Steps to follow:

  1. Create new php class extends CI_Loader in application/core directory

2. Create a method inside MY_Loader class named template

In this template method we have 3 parameters:

Now we call 3 views in this method, first for header, main template and then footer and return result if we want to show view as data otherwise this will show all called views in sequence.

Final code looks like:

 

PHP, MySQL, Ajax, Infinite Scroll with PhoneGap | Cordova

About PhoneGap:

Adobe PhoneGap is used to develop hybrid mobile applications. PhoneGap allows create app using web-development languages like HTML, CSS, and JQuery. You doesn’t require to have knowledge of mobile application languages like Java, Objective C, or Swift. PhoneGap extends the features of of HTML and JavaScript to work with the device.

Let’s start how to make simple infinite scroll application with MySQL database in phonegap.

Steps to follow:

  1. Create MySQL Database and Table
  2. Write PHP code on Server Side for handling request
  3. Write JQuery(Ajax) code on PhoneGap or Cordova side

Create MySQL Database and Table:

First, create MySQL database with table (user_details) with fields such as id, name, contact_number, address.

Connect to Database Server:

Display/Retrieve Data:

Get data from MySQL table with date filter and limit for enabling infinite scroll:

HTML code for PhoneGap / Apache Cordova Side:

Here we write simple HTML code with help of bootstrap classes.

First we showcase some filters elements then we listed data in list format:

Writing Jquery code for PhoneGap / Apache Cordova Side:

Using this code, on page load run Ajax to get data from MySQL table. For Infinite scroll when page scroll down same Ajax run again with incremented page number to get next set of data.

 

If you have any query or suggestion, So i’ll be happy to help you.

Thank you