Tuesday, August 5, 2014

Magento Remote IP Address

//Get Visitor's information  
  $visitorData = Mage::getSingleton('core/session')->getVisitorData();  

  // printing visitor information data  
  echo "
"
; print_r($visitorData); echo "
"; // user's ip address (visitor's ip address) $remoteAddr = Mage::helper('core/http')->getRemoteAddr(true); // server's ip address (where the current script is) $serverAddr = Mage::helper('core/http')->getServerAddr(true);

Tuesday, June 17, 2014

Magento get product price

<?php
 
// assuming that you have known product object, $_product
 
//get product price snippet
echo $this->getPriceHtml($_product, true);
 
//get $_product price
echo $_product->getPrice();
echo number_format($_product->getPrice(), '2', '.', ',');
 
//get $_product special price
echo $_product->getSpecialPrice();
echo number_format($_product->getSpecialPrice(), '2', '.', ',');
 
//get $_product final price
echo $_prodcut->getFinalPrice();
echo number_format($_product->getFinalPrice(), '2', '.', ',');
 
//get $_product Msrp
echo $_product->getMsrp();
echo number_format($_product->getMsrp(), '2', '.', ',');
 
?>

Wednesday, May 7, 2014

Magento – Get Store Email Addresses

General Contact

/* Sender Name */
Mage::getStoreConfig('trans_email/ident_general/name'); 

/* Sender Email */
Mage::getStoreConfig('trans_email/ident_general/email');
------------------------------------------------------------

Sales Representative

/* Sender Name */
Mage::getStoreConfig('trans_email/ident_sales/name'); 

/* Sender Email */
Mage::getStoreConfig('trans_email/ident_sales/email');
------------------------------------------------------------

Customer Support

/* Sender Name */
Mage::getStoreConfig('trans_email/ident_support/name'); 

/* Sender Email */
Mage::getStoreConfig('trans_email/ident_support/email');
------------------------------------------------------------

Custom Email 1

/* Sender Name */
Mage::getStoreConfig('trans_email/ident_custom1/name'); 

/* Sender Email */
Mage::getStoreConfig('trans_email/ident_custom1/email');
------------------------------------------------------------

Custom Email 2

/* Sender Name */
Mage::getStoreConfig('trans_email/ident_custom2/name'); 

/* Sender Email */
Mage::getStoreConfig('trans_email/ident_custom2/email');

Tuesday, March 18, 2014

Path-based links:
<a href="{{store url="checkout/cart/"}}">Shopping Cart</a> - shopping cart
<a href="{{store url="checkout/onepage/"}}">Proceed to Checkout</a> - checkout
<a href="{{store url="catalog/category/view/id/36"}}">Women Apparel</a> - category
<a href="{{store url="catalog/product/view/id/16"}}">Nokia 2610 Phone</a> - product
<a href="{{catalog/product/view/id/85/category/16}}">Classic Jeans</a> - product in context of a category

Direct links:
<a href="{{store direct_url="customer-service"}}">Customer Service</a> - cms-page
<a href="{{store direct_url="apparel/women"}}">Women Apparel</a> - category
<a href="{{store direct_url="electronics/cell-phones/nokia-2610-phone.html"}}">Nokia 2610 Phone</a> - product in context of a category


About

Blogger templates