$shippingAddress = Mage::getModel('sales/order_address')->load($order->getShippingAddress()->getId());
$shippingAddress
->setFirstname("value")
->setMiddlename("value")
->setLastname("value")
->setSuffix("value")
->setCompany("value")
->setStreet("value"))
->setCity("value")
->setCountry_id("value")
->setRegion("value")
->setRegion_id("value")
->setPostcode("value")
->setTelephone("value")
->setFax("value")->save(); |
Method 1. Adding to layout file
<reference name="head">
<action method="addJs"><script>skin/frontend/base/default/js/yourextension/index/scriptname.js</script></action>
</reference> |
Method 2. Adding to phtml file
<?php echo $this->helper('core/js')->includeSkinScript('js/yourextension/index/scriptname.js') ?> |
Posted
on May 24, 2019, 3:36 pm,
by admin,
under
Magento 1.x.
$mail = new Zend_Mail();
$mail->setType(Zend_Mime::MULTIPART_RELATED);
$mail->setBodyHtml('<p>This is Magento email sample with attachment</p>');
$mail->setFrom("sender@senderemail.com", "Sender title");
$mail->addTo(["recepient@recepientemail.com"]);
$mail->setSubject("Email Subject");
$file = $mail->createAttachment(file_get_contents("/file/path/to/attachment.csv"));
$file->type = 'text/csv';
$file->disposition = Zend_Mime::DISPOSITION_INLINE;
$file->encoding = Zend_Mime::ENCODING_BASE64;
$file->filename = basename("/file/path/to/attachment.csv");
$mail->send(); |
Posted
on May 17, 2019, 2:04 pm,
by admin,
under
Magento 1.x.
$filter = new Mage_Widget_Model_Template_Filter();
$_widget = $filter->filter('{{widget type="cms/widget_page_link" template="cms/widget/link/link_block.phtml" page_id="2"}}');
echo $_widget; |
orders.subtotal = ((orders.grand_total+IFNULL(orders.base_customer_balance_amount,0)) + ABS(orders.base_discount_amount))-orders.base_shipping_amount |
Explanation: Order items makes subtotal, then shipping cost is added to it. From that sum discount is extracted and customer balance (if any) extracted. Remaining amount is total due to pay (amount which really needs to be paid by customer) or grand_total
1. Go to magento root folder and inside the var folder, create a new folder connect.
2. Login to admin panel in your browser.
3. From the admin panel, navigate to System > Magento Connect > Package extensions.
4. This will enable you to create extension package page.
Simply create empty file maintenance.flag in magento www folder
UPDATE core_config_data SET VALUE='http://www.website.com/' WHERE path='web/unsecure/base_url';
UPDATE core_config_data SET VALUE='http://www.website.com/' WHERE path='web/secure/base_url'; |
$blockCollection = Mage::getResourceModel('cms/block_collection');
foreach($blockCollection as $block) {
Zend_Debug::dump($block->getResource()->lookupStoreIds($block->getBlockId()));
} |
$controller = $observer->getEvent()->getControllerAction();
$controller->getResponse()->setRedirect($redirectUrl);
$controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
$controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_POST_DISPATCH, true); |