Page 6 - Magento Tutorial
-
- January 11, 2014
When you add jquery in your magento .
if you are got following error comes.
1) You can`t add product in magento shopping cart,
2) Product image not shown correctly in product view.
Solution :
open the file in
{magento root folder}/app/design/frontend/default/{your magento theme}/template/page/html/head.phtml
and
Paste the following lines
<script type="text/javascript">// <![CDATA[jQuery.noConflict();
// ]]>after
<!--[if lt IE 7]>
........
.........
<![endif]--> -
- January 11, 2014
Here we discuse about how to add vTiger Sales Order item detail in any where in your vTiger , for example if you want to add Sales Order Item detail in your email .you just need that is just add simple function . if you want to add salesorder item view using single function.
getDetailAssociatedProducts('SalesOrder',$focus);
to youse the above function you got all the detail in your html format .
-
- January 11, 2014
Magento e-commerce has a standard newsletter function that is useful if you get it to work. This post will highlight the major reasons why your newsletter is not sent to your customers.
- Magento schedules and sends the newsletters using a cronjob script called “cron.php” in your Magento installation root folder. To schedule this cronjob you need to access your web server using SSH (You can use for example Putty). For more information see the Magento wiki.
- If you don’t want to schedule the cronjob you need to go twice to the cron.php file in your browser e.g. www.yoursite.com/cron.php every time you want to send your newsletter. The first time it will schedule the newsletter and the second time it will send it.
- After login with ssh type: crontab -e This will open an editor. The contents may be empty if you have never set up crontabs for the current user.
- To schedule the cronjob every 5 minutes you should enter: */5 * * * * php /absolute/path/to/magento/cron.php
- Save and close
- Now you can
-
- January 11, 2014
1.1 Defining your module
Once you've set up Magento and entered it into the root Magento directory, go into app/code/local/. This will be where your module lives on the system. The first folder is your namespace, usually your company name. Then directory underneath this is your module name.
All your module folders will live underneath this module directory. We will create many here, but for starters just create the etc/ and controllers/ directories. We will also create a file called config.xml in this etc/ directory. This is the main, and incredibly important, the configuration file for your module.
Create this folder structure now. Your directory layout should look as follows:
[magentodir]/app/code/local/NAMESPACE/MODULENAME/etc/config.xml
[magentodir]/app/code/local/NAMESPACE/MODULENAME/controllers/
The content of config.xml should be as follows. It adds this module to the rest of the <modules> in the Magento system. And everything is in a module, even the 'core' Magento classes
-
- 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') ?>
Secure Skin URLgetSkinUrl('images/ sampleimage.gif', array('_secure'=>true)) ?>
Get Current URL$current_url = Mage::helper('core/url')->getCurrentUrl();
Get Home URL$home_url = Mage::helper('core/url')->getHomeUrl();
Get Magento Media UrlMage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
Get Magento Media -
- 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()); ?></span><?php else:?><span class="bag-item"><?php echo $cartcnt.' '.'items,';?><?php echo $this->helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?></span><?php endif; ?></a></span></div> -
- 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
{magento toot}/app/design/frontend/base/default/layout/catalog.xml
to your theme i already mention the path.
2) Remove & Add some xml in catalog.xml
Search catalog_product_view in
{magento root}/app/design/frontend/default/{your theme}/layout/catalog.xml
. Command or remove the following line from there .Search in catalog.xml "catalog.product.related" in appropriately line 258 under <reference name="right">
-
- November 30, 2013
Login/Logout Code in Header
<?phpif(! Mage::getSingleton('customer/session')->isLoggedIn()): ?><a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>"><?phpecho$this->__('Login') ?></a><?phpelse: ?><a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"><?phpecho$this->__('Logout') ?></a><?phpendif; ?> -
- 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.phpadd 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.phpadd the following line in this file
protected function _prepareLayout(){// Load Wysiwyg on demand and Prepare layoutif (Mage::getSingleton('cms/wysiwyg_config')->isEnabled() && ($block = $this->getLayout()->getBlock('head'))){$block->setCanLoadTinyMce(true);}parent::_prepareLayout();} -
- 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