Scriptbaker
ScriptbakerAI & Software Engineering
Insights & Guides

Scriptbaker Blog

Bringing you the latest technology trends, engineering guides, industry thinking, and practical tutorials from the Scriptbaker team.

AllJavaScriptMagentoYiiWordPressSugarCRMEngineeringLaravel
JavaScript

JQuery Multi fileupload

File Upload widget with multiple file selection, drag&drop support, progress bars and preview images for jQuery. Supports cross-domain, chunked and resumabl

October 24, 2023 · 5 min read
Magento

Magento 1: Export manufacturers CSV by specific store view

This post will guide you on how you can export the manufacturer list (Magento 1.9) to CSV file. In this script, I am filtering the list by store view. Let’

January 12, 2022 · 5 min read
Magento

Magento 1: Export catalog categories for a specific store view

In this post you will learn how you can export Magento 1.9 categories for a specific store view as CSV. For example, you have Arabic store view with ID 7, and y

January 12, 2022 · 5 min read
Magento

Search Magento products by product labels

Project Overview: Task was to develop a Product Labels Magento extension. Where admin can create product labels by uploading an image, enter label title and att

September 06, 2017 · 5 min read
Yii

How to separate front and admin panel in yii-framework

In my previous post I demonstrated you how to render different layout for different user role, now lets move a step forward and see how to create separate front

March 07, 2017 · 5 min read
Yii

How to save multiple related models in Yii [Complete Solution]

Scenario: You are in a situation where you have two related tables a Parent and a child table. You need to create a user experience in which user presses Save b

March 07, 2017 · 5 min read
Yii

How to make Yii checkBoxList selected

Many people find it hard to make the Yii checkBoxList selected on update view, but believe me in fact its very easy and straight forward. This post will help yo

March 07, 2017 · 5 min read
Magento

How to Conditionally remove Magento header/footer?

<p>Are you looking for a solution to conditionally remove Magento header footer but don’t know where to start? Right in this post I will show you how to create custom layout handles and utilize them to conditionally remove header/footer blocks.</p>

March 07, 2017 · 5 min read
WordPress

Adding Custom Fields to WordPress User Profile and Add New User page

Adding custom profile fields in WordPress made easy through action hooks. .Most of the solutions available on internet tell you about adding custom fields on &#

March 07, 2017 · 5 min read
WordPress

Script Logic Plugin

Introduction Script Logic is a WordPress plugin that lets you control on which pages scripts and style sheets load using WP’s conditional tags. This plug

January 16, 2017 · 5 min read
WordPress

Multi Image Upload

Multi Image Upload adds a meta box to upload multiple images for posts and pages. You can enable it for custom post types also. Download: http://wordpress.org/p

January 16, 2017 · 5 min read
JavaScript

JQuery tooltip

Here is a nice jQuery tool tip. How to use: 1- Download the file 1.1- Rename the file tipsy-zip.doc to tipsy.zip 1.2- Extract the zip folder or download it from

October 20, 2016 · 5 min read
SugarCRM

Get list of records from SugarCRM module using REST API

Its very common problem for many people to fetch data from SugarCRM application and feed it to some other application. Using REST API we can easily fetch list o

October 20, 2016 · 5 min read
Engineering

My 3 days trip to Swat, Malam Jabba and Kalam (20th Mar to 23rd Mar)

Pakistan is a land of natural beauty and has been blessed with the abundance of awe-inspiring outdoor areas. From the unspoiled golden beaches,across the desola

April 11, 2016 · 5 min read
Engineering

Lamudi.pk is The Fastest growing real estate startup in Pakistan

There are several online real estate portals running in Pakistan, a couple of them have captured the market and leading the industry. In such a scenario it’s ha

April 11, 2016 · 5 min read
WordPress

Install WordPress plugins, themes & upgrades without providing FTP access?

You must have experienced that WordPress asks for FTP credentials if you initiate upgrade or install plugins. And sometimes developers don’t have FTP access and

April 11, 2016 · 5 min read
JavaScript

Get selected value of radioButtonList using jQuery in Yii

Sometimes you want to get selected value of radioButtonList using jQuery in your Yii powered application and it feels difficult due to Yii’s field naming

April 11, 2016 · 5 min read
Magento

Creating Magento order programmatically and charging saved credit card.

Creating order is the basic functionality of Magento but its the trickiest one at the same time for developers. Yes, its true because its not straight forward l

April 11, 2016 · 5 min read
Magento

Magento 2.0 : Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory

You may encounter below fatal error While installing Magento 2.0 Fatal error: Uncaught exception ‘Magento\Framework\Exception\LocalizedException’ wi

November 18, 2015 · 5 min read
Laravel

How to install Laravel on Ubuntu

How to install Laravel on Ubuntu | Scriptbaker

October 06, 2015 · 5 min read
SugarCRM

How to parse Salesforce tables and put data in SugarCRM?

In previous post you learnt how to create REST API to fetch data from SugarCRM application, in this tutorial you will learn to migrate data from Salesforce to S

June 26, 2015 · 5 min read
Magento

Magento: Render static block in a phtml file

Suppose you have created a static block from Magento administration panel (CMS -> Static Blocks) and you want to render its content in some phtml file. [source

June 22, 2015 · 5 min read
Magento

How to render custom phtml in Magento admin tabs block?

It’s possible to add custom tabs on any page of Magento administration panel. Normally tabs are generated by Form Blocks, this is fine if you want to crea

June 21, 2015 · 5 min read
SugarCRM

How to make certain field readonly or disabled based on some other field’s value using SugarCRM Dependencies

Let’s suppose you want to make Mobile field readonly based on Title field’s value in Contacts Module. SugarCRM Dependencies: You can achieve above with SugarCRM

June 21, 2015 · 5 min read
WordPress

How to create custom form in WordPress and handle submission?

There are cool plugins available that create forms without any programming effort but still many times we need to create custom forms in our WordPress website.

June 21, 2015 · 5 min read
SugarCRM

How to change logo of SugarCRM application

After completing installation of SugarCRM community edition, one of the first things you may want to change is the application logo. SugarCRM provides the optio

June 21, 2015 · 5 min read
Magento

Get custom attribute value in Magento

So you have created some custom attributes for your Magento products and now you want to fetch their values. Magento provides a function getAttributeText that t

June 21, 2015 · 5 min read
WordPress

Common mistakes in WordPress Theme Development

This post will let you know about common mistakes in WordPress theme development and also tell you how to avoid them. Template Tags: WordPress template tags are

June 21, 2015 · 5 min read
Magento

Add custom Javascript in Magento admin form

In previous post we learnt how to render custom html in tabs block. Now lets add custom JavaScript in Magento admin form. Magento is flexible enough to insert y

June 21, 2015 · 5 min read
JavaScript

Ajax based Yii login form

Ajax helps us creating fancy forms, Ajax based forms boost user experience. Yii framework provides ajax validation but at the end form is submitted without ajax

May 29, 2015 · 5 min read
Yii

Yii 1.1: Behaviors & Events

Behaviors & Events provide endless possibilities and unbelievable flexibility, but as current Yii documentation does not give more than a few examples, it m

March 18, 2015 · 5 min read
Yii

Switch Yii layout based on user role

You can assign different layouts to different users using following filter class 1. Add LayoutFilter.php to your protected/components/ folder [code language=

July 12, 2014 · 5 min read
WordPress

Add remove Wordpress dashboard widgets

WordPress comes with a bunch of widgets loaded on its dashboard. The default WordPress dashboard may seems cluttered to some users because many widgets may be i

June 19, 2014 · 5 min read
JavaScript

mouseover with delay (using hoverIntent plugin)

hoverIntent is a plug-in that attempts to determine the user’s intent… like a crystal ball, only with mouse movement! It works like (and was derived

June 15, 2014 · 5 min read
Engineering

Trigger Google conversion on some event

Normally Google conversion code is added in header or footer of the “Thank you for your purchase” pages. A conversion is logged when someone lands o

June 15, 2014 · 5 min read
Engineering

Random string generator

Random string are often used in web application to assign records a unique random key. Here is very useful random string generator function that allows you gene

June 15, 2014 · 5 min read
Magento

Add Home link in Magento top navigation menu

By default there is no Home link in Magento top navigation menu but you can easily add it yourself. 1- Copy following 2 files design/frontend/base/template/pag

June 15, 2014 · 5 min read
JavaScript

nl2br equivalent JavaScript function

PHP provides a useful function nl2br that inserts HTML line breaks before all newlines \n in a string. Many times we want to utilize this functionality in JavaS

June 14, 2014 · 5 min read
Yii

Table 'DATEBASE_NAME.AuthAssignment' doesn't exist

<p>If you have used Rights module for RBAC in your Yii application and you deploy it on Linux based server, you may encounter this error.</p>

June 14, 2014 · 5 min read
WordPress

WordPress search filters based on custom fields

WordPress custom fields are good for adding meta data to posts. These custom fields are not just for displaying data but can be used to sort and filter posts. Y

June 09, 2014 · 5 min read
Yii

Keeping your Yii Models Lean - Use Behaviors

Active Record models are fantastic for consolidating “black box” logic and keeping your models self-aware of their business logic, but what do you d

June 07, 2014 · 5 min read
Magento

Configure Authorize.net in Magento

Magento has various built-in payment methods, one of them is Authorize.net. To enable and configure Authorize.net as your payment processor, you should have API

June 07, 2014 · 5 min read
Yii

Yii password, repeat password fields

Yii framework has awesome input validation mechanism, one of the many validation rules is “compare” rule. You can utilize it for creating confirmati

June 04, 2014 · 5 min read
Yii

Yii Rights: Get all assigned roles of a user

[sourcecode language=”php”] $command = Yii::app()->db->createCommand("SELECT * FROM `authassignment` WHERE userid={$user_id}"); $res

June 04, 2014 · 5 min read
Magento

Magento: Add radio/checkbox custom column in Admin Grid

Magento grids are very useful for displaying/filtering and sorting data. Their flexibility is endless, you can customize them in any way. One may want to add a

June 04, 2014 · 5 min read
Engineering

MySQL calculate hours since row created

[code lang=”sql”] SELECT DATEDIFF(now() , created_at)*24 AS hours_passed FROM table_name; [/code]

June 03, 2014 · 5 min read
Engineering

How to reindex tables with MySQL

[code lang=”sql”] ALTER TABLE wp_posts CHANGE ID ID int(11) UNSIGNED NOT NULL; — Removes auto-inrement from ID DROP INDEX `PRIMARY` ON wp_pos

September 11, 2013 · 5 min read
Magento

Magento Admin: 404 Error Page not found.

Let’s suppose you are logged in to Magento admin panel and you are installing a new extension that adds some new sections to Magento Configurations. You a

December 13, 2012 · 5 min read
Magento

Get Magento root category id

[code language=”php”] public function getRootCategoryId() { $categories = Mage::getModel(‘catalog/category’)-&gt;getCollection()

December 10, 2012 · 5 min read
Magento

Set Magento website template, skin and layout programmatically

[code language=”php”] $groups[‘theme’][‘fields’][‘template’][‘value’] = ‘template_name’;

December 07, 2012 · 5 min read
Magento

Set Magento store's base_link_url programmatically

[code language=”php”] $installer->setConfigData(‘web/unsecure/base_link_url’,'{{unsecure_base_url}}mystore/’,’stores̵

December 07, 2012 · 5 min read
Magento

Magento get store by storecode

[code language=”php”] function _getStoreByCode($storeCode) { $stores = array_keys(Mage::app()->getStores()); foreach ($stores as $id)

December 07, 2012 · 5 min read
JavaScript

Post to your Facebook wall using Javascript SDK

Step1: [code language=”html”] <div id="fb_div"> <h3>Post to your Facebook wall:</h3> <br /> <textarea i

December 06, 2012 · 5 min read
Magento

Get Magento Website meta data and configurations data

Following functions will help you to get Magento meta data like “Default Title”, “Default Description” To get Default Title: [code langu

December 06, 2012 · 5 min read
Magento

How to change Magento Base URL

1- Logon to Admin panel 2- Navigate to [code language=”html”] System >> Configuration >> Web >> Unsecure >> Base URL [/code]

November 22, 2012 · 5 min read
Yii

Disabled Yii logs and stack trace messages

Open up the index.php from root folder and comment out following 2 lines [code language=”php”] defined(‘YII_DEBUG’) or define(‘YII

November 16, 2012 · 5 min read
Yii

Allow admin to change user role

1. Add following code to _form.php [code language=”php”] Yii::app()->getModule(‘rights’); if (Yii::app()->user->isSuperuser) {

November 12, 2012 · 5 min read
JavaScript

keyup function with delay

This code will execute a function after the user has stopped typing for a time of 1000ms. Hence the function will not be called on each keyup event. Grea

June 22, 2012 · 5 min read
WordPress

Change WordPress login screen logo

[code language=”php”] function my_custom_login_logo() { echo ‘h1 a { background-image:url(‘ . get_bloginfo(‘template_directory

April 10, 2012 · 5 min read
Engineering

Add custom menu item for WP subscribers panel

[code language=”php”] if (is_admin()) { add_action(‘admin_menu’, ‘my_menu’); } function my_menu() { add_menu_page(&#

April 10, 2012 · 5 min read
Yii

Remove index.php from URL in YII

1- Open root/protected/config/main.php and uncomment the UrlManager 2- Create .htaccess file and place it on the root of your site. Contents of .htaccess s

February 14, 2012 · 5 min read
JavaScript

jQuery UI Multiselect by Michael

First off, you can visit the demo to see the widget in action. The script depends on jQuery 1.3 and jQuery UI 1.7 and is style-able using Themeroller. It works

February 13, 2012 · 5 min read
JavaScript

jQuery Alert Dialogs by Bill Beckelman

Screenshots Live Demo | Download

February 13, 2012 · 5 min read
JavaScript

Style file upload field

You can turn file upload field to a very sexy looking file upload by using this handy script Demo: Needed JQuery files : 1. jquery.min.js 2. jquery.filestyle.

February 13, 2012 · 5 min read
Yii

Integrate Filemanager to FCKeditor in YII

Before starting the tutorial you may also like to view the fully functional demo, or you may download the example and start working on it. Please note that this

February 13, 2012 · 5 min read
Engineering

Disable Browser's Back button

function disableBackButton() { window . history . forward(); } setTimeout(

September 14, 2011 · 5 min read
WordPress

debug WP Queries and boost performance

Hi, I found a very useful plugin for WP Query debugging. I proudly share this resource with you, because I believe it will be very useful to people who want to

February 13, 2011 · 5 min read