How to View Order Status Comments History View?

Hi, this is one of very critical issue for me. I found one forum this solution.

That fourm url is below :
http://www.magentocommerce.com/boards/viewthread/20813/P75/

And I mentioned that code also. If they deleted that thread this is useful.

1. You this path : /app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php

// For All Status View Purpose Below
public function getAllStatuses()
{
$statuses = $this->getOrder()->getConfig()->getStatuses();
return $statuses;
}
// For All Status View Purpose Above

I added this code after “public function getStatuses()” this function inside.

2. Next you go Here : /app/design/adminhtml/default/default/template/sales/order/view/history.phtml”

Find below Code :
<?php foreach ($this->getStatuses() as $_code=>$_label): ?>
<option value=”<?php echo $_code ?>”<?php if($_code==$this->getOrder()->getStatus()): ?> selected=”selected”<?php endif; ?> <?php echo $_label ?></option>
<?php endforeach; ?>

You feel Backup Above code take or Comment line.

And change Below Code :

<!– Write Below for Order Status –>
<?php foreach ($this->getAllStatuses() as $_code=>$_label): ?>
<option value=”<?php echo $_code ?>”<?php if($_code==$this->getOrder()->getStatus()): ?> selected=”selected”<?php endif; ?>><?php echo $_label ?></option>
<?php endforeach; ?>
<!– Write Above for Order Status –>

This is working for me. And check your side. And thanks this option giving that forum “thekanyon” also.

How to View SKU Number in Cart Page from Magento?

You just put Below code in your template file.

<td><?php echo $_item->getSku() ?> </td>

1. Go APP Directory –> template –> checkout –> cart –> item –> default.phtml

Here you place above code.

2. Go APP Directory –> template –> checkout –> cart.phtml

Inside your Heading Title.

that’s all.

How to view Sub Categories only in Parent Categories from Magento?

<?php
$obj = new Mage_Catalog_Block_Navigation();
$current_cat     = $obj->getCurrentCategory();

$currentCatId    = (is_object($current_cat) ? $current_cat->getId() : ”);

$currentPage = (int) $this->getRequest()->getParam(‘p’, 1);
//$currentPage = $_GET[‘p’];

$pageSize = 3;

$collection = Mage::getModel(‘catalog/category’)->getCollection()
->addAttributeToFilter(‘parent_id’, $currentCatId)
->addAttributeToSelect(‘name’)
->addAttributeToSelect(‘url’)
->setLoadProductCount(1)
->setOrder(‘name’, ‘asc’)
->setPage($currentPage, $pageSize);

$totCat = $collection->getSize();
$store_cats = $collection->load();

$pageTot = ceil( $totCat / $pageSize );

?>
<div>
<ul class=’navigation’>
<?php foreach ($store_cats as $cat) : ?>
<li><a href=”<? echo $cat->getUrl() ?>”><?php echo $cat->getName() . ” (” . $cat->getProductCount() . “)” ?></a>
<?php echo $cat->getImageUrl(); ?>
</li>
<?php endforeach; ?>
</ul>

</div>

<ul>
<?php for ( $i=1; $i<=$pageTot; $i++ ) : ?>
<?php if ( $i == $currentPage ) : ?><li><?php echo $i ?></li><?php else : ?><li><a href=”<?php echo $current_cat->getUrl() ?>?p=<?php echo $i ?>”><?php echo $i ?></a></li><?php endif; ?>
<?php endfor; ?>
</ul>

And Just Put below code in your CMS (or) Static Block page inside.
{{block type=”catalog/navigation” name=”catalog.categories” alias=”all_categories_homepage” template=”catalog/navigation/category_listing.phtml”}}

How to Show Magento Particular Categorie Image in Magento?

<?php
$cat_id = 8; // set desired category id
$category = Mage::getModel('catalog/category')->load($cat_id);
$products = $category->getProductCollection()->
addCategoryFilter($category)->addAttributeToSelect('*');
?>
<?php foreach ( $products as $_product ): ?>
<a href="<?php echo $_product->getProductUrl() ?>">
<img src="<?php echo $this->helper('catalog/image')->
init($_product, 'small_image')->resize(135, 135); ?>"
width="135" height="135" title="<?php echo $_product->getName() ?>"
alt="<?php echo $_product->getName() ?>" /></a>
<?php endforeach; ?>

How to add Magento CMS static blocks inside CMS Page?

1. You simply add below code in your cms template :

{{block type="cms/block" block_id="IDENTIFIER"}}

2. You want add static Block in xml file inside :
  <block type="cms/block" name="BLOCK_NAME" after="cart_sidebar">
    <action method="setBlockId"><block_id>IDENTIFIER</block_id></action>
  </block>

3. You want add static Block in page inside :

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId(IDENTIFIER)->toHtml() ?>

its is the method of static block in your cms page...

How to view in weight back value in kg?

Hi you go to app folder.
1. Then go to design–> frontend –> yourtheme –> yourtheme –> template –> catalog –>product –>view –> attributes.phtml

there you can find this code : <?php echo $_helper->productAttribute($_product, $_data[‘value’], $_data[‘code’]) ?>

to change

Then add below code :

<?php
$_weightValue = $_data[‘value’];
if($_data[‘code’]==’weight’){ //this attribute code checkup condition
if (is_numeric($_weightValue)) //this attribute value numberic or not checkup condition
{
$_weightValue = round($_weightValue, 2).’ kg’;  //round to 0.00
}
}
?>
<?php echo $_helper->productAttribute($_product, strip_tags($_weightValue), $_data[‘code’]) ?>

That’s all.

How to Add a field into create account in Zencart?

Below Some Example i found i so this. This is useful for all.

1. You Go to PHPMYADMIN and select your database.
2.And Select your database inside the table “customers”.

3. Now you see the “Customers” table structure Right Side Screen. Example “customers_id”  Something like this.
And add your new filed this table inside. You can set here what type filed value need. Ex :
“VarChar”,  Collation = (latin), This type you can set.

Then You click  “SAVE”

4. Now You Open file includes/modules/YOURTEMPLATE/create_account.php
(Sometime this is controlling in includes/modules/template_default  inside. So where you have control this file you can take your template style via.)

5 . Now search for the following:
$firstname = zen_db_prepare_input($_POST[‘firstname’]);
Once you find out this, You can add your new filed this filed below or above.
Ex: [$lastname = zen_db_prepare_input($_POST[‘lastname’]);]

6. Next search for:
‘customers_firstname’ => $firstname,
Once you find out this, You can add your new filed this filed below or above.
Ex: [‘customers_lastname’ => $lastname]

7.  Now open file: includes/tamplates/YOURTEMPLATE/templates/tpl_module_create_account.php
Just add below type code which “LEGEND” inside that is your choice:
Ex :
<label for=”lastname”><?php echo ENTRY_LASTNAME; ?></label>
<?php echo zen_draw_input_field(‘lastname’, ”, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_lastname’, ’40’) . ‘ id=”lastname”‘) . (zen_not_null(ENTRY_LASTNAME_TEXT) ? ‘<span>’ . ENTRY_LASTNAME_TEXT . ‘</span>’: ”); ?>
<br />

You want to change OR Add This type “ENTRY_LASTNAME”, You can go includes/languages/english.php inside. There the settings created.

8. Once You finished the above Section You go to admin/customer.php, Then Edit this file:
This file viewing the database details in your adminstator purpose.

Here you can find below type, once you got it you can add you field same below type :
a.) $customers_firstname = zen_db_prepare_input($_POST[‘customers_firstname’]);
b.) c.entry_country_id, c.customers_firstname, c.customers_lastname
c.) if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;
$entry_firstname_error = true;
} else {
$entry_firstname_error = false;
}
d.) ‘customers_firstname’ => $customers_firstname,
e.) var customers_firstname = document.customers.customers_firstname.value;
f.) if (customers_firstname == “” || customers_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
error_message = error_message + “<?php echo JS_FIRST_NAME; ?>”;
error = 1;
}
g.) <tr>
<td><?php echo ENTRY_FIRST_NAME; ?></td>
<td>
<?php
if ($error == true) {
if ($entry_firstname_error == true) {
echo zen_draw_input_field(‘customers_firstname’, $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_firstname’, 50)) . ‘&nbsp;’ . ENTRY_FIRST_NAME_ERROR;
} else {
echo $cInfo->customers_firstname . zen_draw_hidden_field(‘customers_firstname’);
}
} else {
echo zen_draw_input_field(‘customers_firstname’, $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_firstname’, 50), true);
}
?></td>
</tr>

This type search. Then you can do this place in your field add. Then you will get good work. And more you can find insert here.

And more discussion going here :
http://www.zen-cart.com/forum/showthread.php?t=73181&page=2

Additional How to add CheckBox  in Zencart Form :
———————————————————————
<?php echo zen_draw_checkbox_field(‘wshop’, ‘1’, $wshop, ‘id=”wshop-checkbox”‘); ?>
<?php echo zen_draw_textarea_field(‘customers_WYOURMESSAGE’, ’10’, ‘5’, ”, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_wyourmessage’, ”). ‘id=”customers_wyourmessage”‘) . (zen_not_null(ENTRY_BUSINESS_WYOURMESSAGE_TEXT) ? ‘<span>’ . ENTRY_BUSINESS_WYOURMESSAGE_TEXT . ‘</span>’: ”); ?>

Final Working Files :
——————————————————-
C:workfreelancerwww.yoururl.comyourfolderincludeslanguagesenglish.php
C:workfreelancerwww.yoururl.comyourfolderincludesmodulestemplate_defaultcreate_account.php
OR
C:workfreelancerwww.yoururl.comyourfolderincludesmodulesnew_templatecreate_account.php
C:workfreelancerwww.yoururl.comyourfolderincludestemplatestemplate_defaulttemplatestpl_modules_create_account.php
C:workfreelancerwww.yoururl.comyourfolderincludesform_check.js.php
C:workfreelancerwww.yoururl.comyourfolderadmincustomers.php
C:workfreelancerwww.yoururl.comyourfolderadminincludeslanguagesenglish.php
C:workfreelancerwww.yoururl.comyourfolderincludesmodulespagescreate_accountjscript_form_check.php <-- (JS Error Check UP File). Database name : Customers

How to add “Shortcode” for WP Contact Form 7?

1. Example :

Copy this code and paste it into your post, page or text widget content.
[contact-form-7 404 "Not Found"]

2. Example

Copy Below code in your php file inside where you want put this:
<?php echo do_shortcode( ‘[contact-form-7 404 "Not Found"]‘ ); ?>

How to write first php code?

This is very easy. Just write below code in your php file.

<?php

echo “Welcome New Php Reader”;

?>

Then refersh your server or localhost. There showing  Welcome New Php Reader.

How to Create Php info Page?

Hi, its very easy to create.
1. Just put below code in php file inside

<?php
echo phpinfo();
?>

2. Save file phpinfo.php
3. Upload your server or localhost
4. Run yourdomain/phpinfo.php
5. It’s show your “php info” results.

Allways happy. 🙂

© 2020 Spirituality