<?php $sku = 'Your Product Sku'; $id = Mage::getModel('catalog/product')->getIdBySku($sku); if ($id){ echo "SKU {$sku} exists"; } else{ echo "SKU {$sku} does not exist"; } ?>
Fatal error: Class ‘Zend_Pdf_Color_RGB’ not found in magento using zend library
When you use want to replace this code $page = $this->newPage(); by this: $pdf->pages[] = $pdf->newPage('4:6:'); but the results is: Fatal error: Class 'Zend_Pdf_Color_RGB' not found app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php It is common issue, if you are using Windows you can't see this issue, but when you upload it to your Linux server you will see. It Full Article…
Magento – “Item (Mage_Catalog_Model_Product) with the same id ”xxx“ already exist”
I have been getting this error when trying to filter a products collection Item (Mage_Catalog_Model_Product) with the same id "7631" already exist and wanted to ask what could ne causing the error since there is only one (visible) product with the same ID inside of Magento. ———————————————————– Here is the solution i did to solve the Full Article…
Magento – How to set the tax configuration in the correct way
The following general fixes were made to Magento tax configuration and calculations: Canadian customers now receive an e-mail with the correct totals for invoices and credit memos that include Provincial Sales Tax (PST) and Goods and Services Tax (GST). Resolved issues with incorrect prices and incorrect tax amounts when a custom price is used together Full Article…
Magento – DIRECT SQL QUERIES IN MAGENTO
Magento’s use of data models provide a great way to access and modify data. Using aptly named methods and clever abstraction, Varien hide away the complex SQL needed to perform data operations. While this makes learning models easier, it often impacts the speed of the operation and therefore the responsiveness of your site. This is Full Article…
Magento – HOW TO EXCLUDE BLOCK FROM THE FULL PAGE CACHE
Magento Enterprise Edition Full Page Cache is a great feature that significantly improves the frontend performance. Nevertheless, it is causing the troubles with the customisations that require the dynamic content output. As you may know, the customer and cart information custom outputs are the first “victims” there, especially, if you migrated your Magento store from Community Full Article…
Magento : Get Store Id, website Id, website info
After hours of searching on Google, i find out some ways to get Store and Website info 🙂 Get current store: Mage::app()->getStore(); Get current store Id: Mage::app()->getStore()->getId(); Get current website Id: $storeId = Mage::app()->getStore()->getId(); Mage::getModel(‘core/store’)->load( $storeId )->getWebsiteId(); Get store info by store code: $storeCode = “your_store_code”; Mage::getModel( “core/store” )->load( $storeCode ); Get website info Full Article…
Fixing Magento catalog price rule disappears at night
I have developed the online store on magento platform. Everything works fine except the Catalog price rule for sale. I have created the simple rule that applies 15% discount on all products. When I save and apply the rule, it works fine the whole day. But after 12 at night, the sale is no more Full Article…
How to add custom product attribute in PDF invoice Magento
i am trying to add custom attribute , product(book) publisher name below product name in PDF invoice(like in image)& publisher is custom attribute created by me by copy app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php to app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php with following code in default.php but this not working class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_Order_Pdf_Items_Abstract { /** * Draw item line */ public function Full Article…
Custom module: Access denied (ACL Problem)
I created a module, and it works perfectly; however, I hit a wall. When I'm logged in as admin, everthing is good. I added this in the acl: <?xml version="1.0"?> <config> <menu> <erp translate="title" module="firtal_deadstock"> <title>ERP</title> <sort_order>99</sort_order> <children> <stock_management module="firtal_deadstock"> <title>Stock Management</title> <children> <firtal_deadstock> <title><![CDATA[Firtal Stock Analysis]]></title> <sort_order>99</sort_order> <action>adminhtml/deadstock</action> </firtal_deadstock> </children> </stock_management> </children> Full Article…