Monthly Archives: October 2009

Add a new side box in zen-cart

To add a new side box you have to add code to three place.

  1. to your includes\languages\english\extra_definitions to define the code as your going to add a new side box
  2. To your includes\modules\sideboxes . here add the side box
  3. And last is \includes\templates\template_default\sideboxes. here contain of the side box are add.

now code for a blank side box is added named “blank_sidebox_defines.php”


<?php
/**
* blank sidebox definitions - text for inclusion in a new blank sidebox
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-05-26 kuroi $
*/

define('BOX_HEADING_BLANK_SIDEBOX', 'Blank Sidebox Header');
define('TEXT_BLANK_SIDEBOX', 'Replace this text with your HTML content.');

?>

No:2…. named”blank_sidebox.php”

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  // test if box should display
  $show_blank_sidebox = true;

  if ($show_blank_sidebox == true) {
      require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
      $title =  BOX_HEADING_BLANK_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

And last no.::3 named “tpl_blank_sidebox.php”


<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

  // Replace the text and HTML tags between the apostophes on lines 19 and 20.
  // Use as many or as few lines using this model as you need for your custom content.
  // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
  // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
  $content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>';
  $content .= '<p>You can include text, links, images, HTML markup and even PHP code</p>';

  $content .= '</div>';
?>

After all added go to your admin panel and login where in tools section go to layput box controller and found your newly add side box.

Advertisements

Write a core database query in magento!!!!!!

You can write a core database query in magento which is a new stage for managing magento after all

this is a sample of how to write a core query means raw query

<?php echo '<h1> div area</h1>';
$sql = "SELECT sku  FROM catalog_product_entity ";
$data = Mage::getSingleton('core/resource') ->getConnection('core_read')->fetchAll($sql);
if(!$data)echo "empty";
else
foreach ($data as $data)
echo $data['sku'].'<br/>';
?>

it show all the sku of your store’s product that means nice.

here i can anatomy the code as

  1. $sql stands for the query which you want to write
  2. $data stand for to collect data from the table. Here also come other thing that Mage::getSingleton(‘core/resource’) it is used for connecting the database and                       getConnection(‘core_read’) is used for connecting mode. That means is it connected as read mode or write mode. And last fetchAll($sql) means fetch all data in data array
  3. And rest as similar as php.

That’s ok.Have fun…

import a old database to a new magento

To move database to a new magento is not so easy. Actually it is easy but very ugly.

  1. you first import the database.
  2. back up old skin,media,template which you design your frontend look,back up core files as also if you made any custom core files.
  3. now create a database in which you want to install the new magento
  4. now import the database
  5. when you import the database in the newly created database there will be a error massage, but i still not found that it will effect any in your new database
  6. After import old database in your new database go installation windward  to installation
  7. but before select the database you first edit core_config_data to change two things  no.1 is the base url of unsecure and no.2 is the secure to newly login url.
  8. now copy the old skin,template,media and core files to their desire places.
  9. oh i lost a word after step 6 you must delete all cache from var files.

That’s ok.Have fun.

How to add payment accepted image in footer??

Add payment accepted image in the footer::
If any body want to do that, he just follow this method::

  1. At first go to your core design and found out page template as app/code/design/forntend/default/default/page/1column.phtml
  2. Then find out this code
     <?php echo $this->getChildHtml('footer') ?>
  3. Then add these code just after it.
     <img src="<?php echo $this->getSkinUrl() ?>/images/footer_image/maestro.jpg" border="0" width="120px" height="100px"/>
    <img src="<?php echo $this->getSkinUrl() ?>/images/footer_image/mastercard.jpg" border="0" width="120px" height="100px"/>
    <img src="<?php echo $this->getSkinUrl() ?>/images/footer_image/visa.jpg" border="0" width="120px" height="100px"/>
    <img src="<?php echo $this->getSkinUrl() ?>/images/footer_image/paypal.jpg" border="0" width="120px" height="100px"/>
    <img src="<?php echo $this->getSkinUrl() ?>/images/footer_image/posten.jpg" border="0" width="120px" height="100px"/>
    
  4. And also edit your boxes.css around 560 line like this
    .payment_options_footer { /* see 1columns.phtml */
    width:930px;
    margin:0 auto;
    padding:0px 10px 0px;
    background-color:#618499;
    position:relative;
    border-bottom:0px solid #000000;
    }
    .payment_options_footer img {margin-top: 10px;}
  5. that’s ok.

Manage your Cache!!

Cache Management

Go to your admin->System->cache managenent

then unchecked all in cache manage segment except last.

then change your desire layout and enjoy it.

Store,category and product URL

Skin Url::
In skin url means skin folder in root of the core folder of magento and if you want to explain it in the language of programming skin url means http://www.yourdomainname.com/skin
means the position of skin folder.

So, if we want find a image in a folder like //skin/default/default/images/add/XX.jpg then we just put these code to show the URL

{{skin url='/images/add/XX.jpg'}}

In such way the Media URL will be

{{media url='......'}}

And Store URL::

{{store url='....'}}

customize gift massage

You can use gift massage as a communication between customer and owner.

Edit to change the fornend of gift massage you have to edit some section as

Go to app\design\frontend\default\default\template\giftmessage\inline.phtml

and then change what ever you lick.

Again go to  app\design\frontend\default\default\template\email\order

and also change there.

that’s it.

%d bloggers like this: