<?php $productType= $_product->getTypeId() ?>
Tag Archives: PHP
Disabling Multiple Address Checkout on Magento
1) Go to System and select Configuration in admin panel
2) Go to Shipping Settings on the left menu under Sales section and Set “Allow Shipping to multiple addresses” to “No”
Change the layout of search result page Magento
Edit the the code in catalogsearch.xmlpage
<reference name=”root”>
<action method=”setTemplate”><template>page/2columns-left.phtml</template></action>
</reference>
How get current step in checkout progress bar Magento
Use the below given code in progress.phtml
echo $toStep = $_REQUEST[‘toStep’]
Check shipping and billing address are same magento review section
$checkout = Mage::getSingleton(‘checkout/session’)->getQuote();
$shipping = $checkout->getShippingAddress();
<?php if($shipping->getData(‘same_as_billing’)!=’1′) { ?>
Not same
<?php } ?>
How to show shipping details on shipping method step Magento
<?php
$checkout = Mage::getSingleton(‘checkout/session’)->getQuote();
$shipping = $checkout->getShippingAddress();
echo $shipping->getName() . $shipping->getStreet(1) . $shipping->getPostcode() . $shipping->getCity() . $shipping->getCountry();
?>
How to show billing details on shipping method step Magento
<?php
$checkout = Mage::getSingleton(‘checkout/session’)->getQuote();
$billing = $checkout->getBillingAddress();
echo $billing->getName() . $billing->getStreet(1) . $billing->getPostcode() . $billing->getCity() . $billing->getCountry();
?>
Default billing address of a customer from customer id Magento
<?php
$customerId=Mage::getSingleton(‘customer/session’)->getCustomer()->getId();
$customer = Mage::getModel(‘customer/customer’)->load($customerId);
$defaultBilling = $customer->getDefaultBillingAddress();
$defaultBilling>getData(‘country_id’)
?>
Default shipping address of a customer from customer id Magento
<?php
$customerId=Mage::getSingleton(‘customer/session’)->getCustomer()->getId();
$customer = Mage::getModel(‘customer/customer’)->load($customerId);
$defaultShipping = $customer->getDefaultShippingAddress();
$defaultShipping->getData(‘country_id’)
?>
Customer ID on product details page Magento
$customerId=Mage::getSingleton(‘customer/session’)->getCustomer()->getId();