Monthly Archives: November 2013
-
November 30, 2013
Magento Mage Core, Admin Static Blocks, or Phtml edits are usually includes getting url path such as images, javascript, base url, media and store url. There are different ways to retrieve mentioned URL paths depending on which section you’re editing.
To Retrieve URL path in STATIC BLOCK
To get SKIN URL{{skin url='images/sampleimage.jpg '}}
To get Media URLhttps://www.samdoit.com/media//sampleimage.jpg
To get Store URLhttps://www.samdoit.com/mypage.html/
To get Base URL{{base url='yourstore/mypage.html'}}
TO Retrieve URL path in PHTML
Note: In editing PHTML don’t forget to enclode the following code with PHP tagNot secure Skin URL:
getSkinUrl('images/sampleimage.jpg') ?>
-
November 30, 2013
If you want to change your shopping cart display like number of item and price ,
i give sample image show ,
<div class="mybag">
<a href="<?php echo $this->getUrl('checkout/cart')?>">
<span class="mybag-text">Shopping Cart:</span>
<?php $cartcnt= Mage::helper('checkout/cart')->getItemsCount();?>
<?php if($cartcnt==0):?>
<span class="empty-bag"><?php echo '0 items,';?>
<?php echo $this->helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal());
-
November 30, 2013
As a magento developer display related product on product view page.It’s easy to show related product by following few easy steps. First we will have to add products to a particular product as related product. Screen shows product added as related product
After selecting products it will show on your product view page if you can`t view related product on it .Do following steps it`s very easy to follow all the best friends.
1)Open catalog.xml
catalog.xml file available in .
{magento root}/app/design/frontend/default/{your theme}/layout/catalog.xml .
If you not have the file just copy file from
-
November 30, 2013
Login/Logout Code in Header
<?php
if
(! Mage::getSingleton(
'customer/session'
)->isLoggedIn()): ?>
<a href=
"<?php echo Mage::helper('customer')->getLoginUrl(); ?>"
><?php
echo
$this
->__(
'Login'
) ?></a>
<?php
else
: ?>
<a href=
"<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"
><?php
echo
$this
->__(
'Logout'
) ?></a>
<?php
endif
; ?>
-
November 30, 2013
Add wysiwyg editor in magento custom module. is very easy to make it in your magento custom modue use this following method to add wysiwyg editor .
go to the file
{your magento root folder}/Block/Adminhtml/{module name}/Edit/Tab/Form.php
add following code in top of the file
$fieldset->addField('followupemail_text', 'editor', array(
'name'=>'followupemail_text',
'label' => Mage::helper('followupemail')->__('Content'),
'title' => Mage::helper('followupemail')->__('Content'),
'required' => true,
'style' => 'height:24em;',
'config' => $wysiwygConfig, ));
go to the file
{your magento root folder}/Block/Adminhtml/{module name}/Edit.php
-
November 26, 2013
From time to time everyone finds them selves in a position where they are faced with a development they have never confronted before. Today I was achieve to get all orders for a customer based on the customer email address.. While there are almost certainly several ways to do this, I found a nice query that is quick, and capable.
$orderCollection = Mage::getModel(‘sales/order’)->getCollection(); $orderCollection->addFieldToFilter(‘customer_email’,'email@domain.com’);
Happy coding, hope this helps next time you’re working on Magento
-
November 26, 2013
Vtiger outgoing mail server setting for gmail user
Mail Server Settings (SMTP) * Server Name User Name youremail@gmail.com Password your email password From Email youremail@gmail.com Requires Authentication?