Category: JavaScript — admin @ 12:11 pm — Comments (0)

Initial conditions:

var fullPath = 'folder1/folder2/folder3/filename.jpg';

What need get:

filename.jpg

(more…)

Category: Ubuntu,Windows XP — admin @ 11:13 pm — Comments (0)

I have faced the problem installing Windows XP on Virtualbox. I will describe in details installing process from CD. Environment: Ubuntu 9.10 i386, Virtualbox 3.2.8-64453.

The first step is download from official site deb package and install it. After installing Virtualbox launch it. You will see the following:

the first during install Windows XP on Virtualbox

Press “New” button. You will see the following:

(more…)

Category: Magento — admin @ 8:49 pm — Comments (1)

I have got an error for Magento 1.3.1.1 and PHP 5.3.2:
Fatal error: Method Varien_Object::__tostring() cannot take arguments

PHP 5.3.2-1ubuntu4 with Suhosin-Patch
Magento version: 1.3.1.1

Below solution of this issue:

(more…)

Category: Magento — admin @ 11:17 pm — Comments (0)

Magento allows customize admin theme. It’s like new theme for frontend but needs specific configuration in config.xml.
Below is an example:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <YOURMODULE_Adminhtml>
            <version>0.0.1</version>
        </YOURMODULE_Adminhtml>
    </modules>
    <stores>
       <admin>
           <design>
               <theme>
                   <default>YOURADMINTHEME</default>
               </theme>
           </design>
       </admin>
    </stores>
</config>
Category: Magento — admin @ 3:25 pm — Comments (0)

The following code allows you illuminate options for configurable products in Magento.

The steps are:

0. Create configurable product with “size”, “color”, “manufacturer” options.

1. Create new field in the table “catalog_eav_attribute”:

ALTER TABLE `catalog_eav_attribute`
ADD `configurable_option_type` TINYINT( 1 ) UNSIGNED NOT NULL

2. Open method Mage_Adminhtml_Catalog_Product_AttributeController::saveAction
and add verification:

//CONFIGURABLE OPTION TYPES
if (!isset($data['configurable_option_type'])) {
    $data['configurable_option_type'] = 0;
}

(more…)

Category: Magento — admin @ 6:54 pm — Comments (9)

The goal of this article is to show to add new image type to product in Magento.

By default Magento has 3 type of images:

  1. Base image
  2. Small image
  3. Thumbnail image

Typically these types of images is sufficient. But sometimes it becomes necessary to add a new type of image. Add a new type of image is easy as Magento in the gallery displays all the attributes for which the attribute ‘input_type’ equals ‘media_image’.

(more…)

Category: Varnish — admin @ 11:34 am — Comments (29)

OVERVIEW

After installing Magento on hosting you probably have a desire to optimize its work.

Google offers solutions, which consist on using one of the following options: installing higher-performance hardware, correction for mysql/php configuration, using PHP accelerators, accelerate downloads JS and CSS, the correction assignment expires date for content, customization Magento core files to fit your needs.

Varien released a book titled “Enterprise Edition Whitepaper High Performance eCommerce” which explains the above methods ofВ  Magento optimization. I recommend reading this book and use the described methods of optimization.

I propose another new approach for the optimization of Magento, which was not described in the Internet before. I propose to use Varnish for caching pages.

What is Varnish you can read here. Varnish handles the request, looks in the cache this page and, if such page is found, returns it. If the page is not found in the cache – a request sent to Apache. This approach allows you to create any number of dynamic pages.

(more…)

Category: Varnish — admin @ 5:42 pm — Comments (0)

Apache configuration for Ubuntu users:

sudo vim /etc/apache2/ports.conf :

NameVirtualHost *:8088
Listen 8088

sudo vim /etc/apache2/sites-available/default :

NameVirtualHost *:8088

<VirtualHost *:8088>
  ...
</VirtualHost>
Category: Varnish — admin @ 3:51 pm — Comments (0)

What Is Varnish?

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites.
Varnish was designed from the ground up as a reverse web accelerator for inbound traffic.

Varnish Installation

Installation was tested on Ubuntu 9.04, 2.6.28-17-generic with Vanish 2.0.6

Download the latest Varnish version.
Extract the archive. Then

sudo ./configure
sudo make
sudo make install

You can find VCL flow here.
(more…)