Category Archive: PHP

Jun 01

Wishlist in Magento

Wishlist by customer id in Magento $wishList = Mage::getSingleton(‘wishlist/wishlist’)->loadByCustomer($custid); OR $wishList = Mage::getSingleton(‘wishlist/wishlist’)->loadByCustomer($customer); $wishListItemCollection = $wishList->getItemCollection(); if (count($wishListItemCollection)) { $arrproduct = array(); foreach ($wishListItemCollection as $item) { $product = $item->getProduct(); $arrproduct  [‘product’][] =array($product->getName(),$product->getPrice(),$product->getQuantity(),Mage::getBaseUrl(‘media’) . ‘catalog/product/’ . Mage::getModel(‘catalog/product’)->load($product->getId())->getThumbnail()); } } print_r($arrproduct );

Jun 01

Product Details in Magento

Product details by product id in magento $prod = Mage::getModel(‘catalog/product’); $_product = $prod->load($productid); // Enter your Product Id in $product_id echo $_product->getName(); //get product’s short description echo $_product->getShortDescription(); //get Product’s Long Description echo $_product->getDescription(); //get Product’s Regular Price echo $_product->getPrice(); //get Product’s Special price echo $_product->getSpecialPrice(); //get Product’s Url echo $_product->getProductUrl(); //get Product’s image Url …

Continue reading »

Nov 23

PHP Operator Type

What is Operator Ans.:  Operator used for perform operation on variable and value. Type of Operator Arithmetic operators Comparision Operators Logical (or Relational ) Operators Assignment Operators Conditional (or Ternary) Operators There are following Operator (suppos that A hold 15 and B hold 30) Arithmetic operators +   Add two Operand            A+B=45 –   Subtract second …

Continue reading »

Nov 22

php magic constant

__LINE__              : Current line number of file. echo “This is line number ” . __LINE__ . “.\n”; __FILE__                  : The Full path and Filename of the file. If used inside an include the name of include file return. echo “This file …

Continue reading »

Older posts «