Monday, 12 September 2016

Magento Select Query

$connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_read');
$resource = Mage::getSingleton('core/resource');
$tableName = $resource->getTableName('marketplace_product');
$query = 'SELECT userid FROM ' . $tableName . ' WHERE mageproductid = '.(int)$product_Id ;

$userid = $connectionWrite->fetchOne($query); 

Thursday, 28 July 2016

mahemto cart use on set description

 ===Set Description===================================
 app/code/core/Mage/Sales/Model/Quote.php
 public function addProductAdvanced(
 after this coding :-
 $items[] = $item;
 $item->setDescription($_customValue);

 =========================================
 app/design/frontend/rwd/nassaunationalcable/template/checkout/cart/item/default.phtml
 $_item->getDescription();

how to remove customer account dashboard links


Step 1: Go to ( yourPackage/YourTemplate/customer/account/navigation.phtml )

Step 2: Replace the below line

<?php $count = count($links); ?>
        **With**
<?php $_count = count($_links); /* Add or Remove Account Left Navigation Links Here -*/
      unset($_links['account']); /* Account Info */    
      unset($_links['account_edit']); /* Account Info */           
      unset($_links['tags']); /* My Tags */
      unset($_links['invitations']); /* My Invitations */
      unset($_links['reviews']);  /* Reviews */
      unset($_links['wishlist']); /* Wishlist */
      unset($_links['newsletter']); /* Newsletter */
      unset($_links['orders']); /* My Orders */
      unset($_links['address_book']); /* Address */
      unset($_links['enterprise_customerbalance']); /* Store Credit */
      unset($_links['OAuth Customer Tokens']); /* My Applications */
      unset($_links['enterprise_reward']); /* Reward Points */
      unset($_links['giftregistry']); /* Gift Registry */
      unset($_links['downloadable_products']); /* My Downloadable Products */
      unset($_links['recurring_profiles']); /* Recurring Profiles */
      unset($_links['billing_agreements']); /* Billing Agreements */
      unset($_links['enterprise_giftcardaccount']); /* Gift Card Link */
?>

Wednesday, 27 July 2016

how to get selected drop down attribute value disply on in frontend?

$_product =Mage::getModel('catalog/product')->load($_product_ID);
                            echo $_product_s->getLength();
                            ======== OR ==========
                            echo  $_product_s->getAttributeText('length');
                            echo $_product->getResource()->getAttribute('length')
                             ->getFrontend()->getValue($_product);

Monday, 25 July 2016

How to call store address on static block

<p><span class="address-heading">{{config path="general/store_information/name"}}</span>
{{config path="general/store_information/address"}}<br />
<br /> {{config path="trans_email/ident_general/email"}}<br />
{{config path="general/store_information/phone"}}</p>

Friday, 22 July 2016

magento 2 base url and media url

$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $storeManager   =   $_objectManager->get('Magento\Store\Model\StoreManagerInterface');
    $currentStore   =   $storeManager->getStore();
/*********** Base url******/
    $baseUrl      =   $currentStore->getBaseUrl();


/*********** mediaUrl url******/
 $mediaUrl      =   $currentStore->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);