Posts

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ProductRepository::getProductFromLocalCache() must be of the type string, null given, called in /vendor/magento/module-catalog/Model/ProductRepository.php on line 270 and defined in vendor/magento/module-catalog/Model/ProductRepository.php:751

Possible reason is that there's a NULL sku in catalog_product_entity. To find out, query the catalog_product_entity table for a NULL sku. Something like: SELECT * FROM catalog_product_entity WHERE sku IS NULL; If there is, then just set the SKU and you're good!

How to fix Cignal Top Box error - Please perform a smart card reset by removing your smart card for 15 seconds then reinsert the card. (1/2)

Turn off the top box. Remove the Smart card from the top box. Clean the chip part (usual color of the chip is gold) with an eraser or a soft cloth Blow the Smart card slot to remove excess dirt Replace the Smart card to the slot Wait for 15-20 seconds and restart the top box. Did it help? If so, can you return the favor? Kindly just click any of the ads on this page.

Magento: Google Checkout Warning: include(Mage/Googlecheckout/Block/Adminhtml/Shipping/Merchant.php): failed to open stream: No such file or directory in app/code/local/Varien/Autoload.php on line 98

Whenever you see this error: Warning: include(Mage/Googlecheckout/Block/Adminhtml/Shipping/Merchant.php): failed to open stream: No such file or directory  in app/code/local/Varien/Autoload.php on line 98 It only means that in app/code/core/Mage/GoogleCheckout/etc/config.xml, the block was not declared. So you just have to add this inside the global node:         <blocks>             <googlecheckout>                 <class>Mage_GoogleCheckout_Block</class>             </googlecheckout>         </blocks> Did that solve the issue? Please leave your comment. Thanks! P.S. If you want the other way of solving this issue (which is the more appropriate one), just let me know.

Magento 1.9: How to re-arrange Wishlist page headings

On wishlist.xml wishlist_index_index, just re-arrange the children under customer.wishlist.items from top to bottom which will result to left to right arrangement on the Wishlist page Also, a bonus. You can also set the heading title there.

Ubuntu 14.04: How to install Compass and Ruby

Simple. sudo apt-get install ruby-compass Done.

Ubuntu 14.04: Can't install phing

It's really such a headache when I migrated to Ubuntu 14.04. Lots of headaches! But anyway, here we go: First you need to install pear first by doing the following command on Terminal: sudo apt-get install php-pear Then add pear channel: sudo pear channel-discover pear.phing.info Install Phing: sudo pear install -Z phing/phing The -Z option will download .tar file instead of the damn .tgz (which always throws this error):  could not extract the package.xml file from "/build/buildd/php5-5.5.9+dfsg/pear-build-download/phing-2.9.1.tgz" Download of "phing/phing" succeeded, but it is not a valid package archive Error: cannot download "phing/phing" Download failed install failed Hopefully it works on your end. Please comment below if it worked.

Magento: Upgrade from 1.6 to 1.9 PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.0' in 'on clause'' in lib/Zend/Db/Statement/Pdo.php:228

I've just upgraded our e-commerce website which uses Magento version 1.5. I upgraded it to the latest 1.9.0.1. Really lots and lots of bug fixes to be done and of them is what's the title of this post. Anyways, you can fix it by going to Mage_Reports_Model_Resource_Product_Collection::setProductEntityId and remove the (int) because it's trying to convert the string into integer. This is not the best fix but I'm in a hurry so if you found something that is more appropriate then please leave a comment and don't just runaway. Cheers     public function setProductEntityId($entityId)     {         $this->_productEntityId = (int)$entityId;         return $this;     }

Magento: How to effectively get the website ID

To get the website ID in Magento: Mage::app()->getStore(true)->getWebsite()->getId()

Adobe Business Catalyst: How to specify image dimension on the web app

Recently, I have an ABC project that uses Web App. I was puzzled how to specify image dimension. I played with the values and finally came up with the correct format. In your web app field that has an 'image' type, simply append the width and height to the image path. Like this:  /path/to/my/image.jpg,370,170

Magento 1.5.1.0 - How to check in the frontend if admin is logged in

In Magento 1.5.1.0, I've tried different approaches just to check in the frontend if the admin is logged in. There are lots of codes I found in the net but they didn't work. Well, the easiest approach is just this : Mage::getModel('admin/session')->isLoggedIn() I used that in the custom router I created. Now buy me some beer!

Ubuntu Terminal: mysql -u username -p database_name < database.sql does not import completely

If ever you have encountered the issue mentioned in the title of this post, I have an alternative for that. I experienced that when I imported a very large sql file which is about 2GB. What I did was I used the mysql command line client. I think you have an idea now how i did it. But here we go. In your terminal, type mysql -u <your_username> -p. Then type of course type the password when prompted. Then run use <database_name>; press enter. And then,  source sqlfile.sql; That should do the trick. Just wait for it to finish importing.

Magento: Cannot add new attribute option values or delete after adding too many values

I've been trying different fixes for the issue mentioned but the fix below is the best. To fix this issue, do the following in php.ini: memory_limit = 256M max_execution_time = 3600 max_input_time = 600 post_max_size = 512M max_input_vars = 100000 suhosin.post.max_vars = 100000 suhosin.request.max_vars = 100000 You may add some lines if they don't exist yet. In CentOS, php.ini can be found in /usr/local/lib/php.ini. In Ubuntu, it's residing in the following : /etc/php5/apache2/php.ini /etc/php5/cgi/php.ini /etc/php5/cli/php.ini After modifying php.ini, please don't forget to restart Apache. That's all!

Ubuntu: Extract tar.bz2

To untar bz2 file, do this tar jxvf firefox-3.5.tar.bz2 If it does not work, you probably need to install bzip2, sudo apt-get install bzip2

Magento : Product CSV import Notice: unserialize(): Error at offset 925 of 1057 bytes in /var/www/magento/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php on line 66

If ever you're getting an error like this when importing products CSV on Magento,  Notice: unserialize(): Error at offset 925 of 1057 bytes in /var/www/magento/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php on line 66 Make sure to fix special characters on the description or short_description column and other columns. For some reason, Magento does not accept those special characters like  ™,  ®,  &,  £, and a lot more. Hope that helps...

Ubuntu: MySQL Export/Import all databases in CLI

To Export all your MySQL databases, do this : mysqldump -u yourusername -p -h localhost --all-databases | gzip > filename.sql.gz To Import all your MySQL databases, do this : mysql -u yourusername -p -h localhost < filename.sql Also you might wonder how I unzipped the gz file. You can do this gunzip filename.sql.gz

Magento: can't login to admin panel, can't add product to cart

Image
If ever you encountered issues like you cannot login to the admin panel or cannot even add product to the cart, I have a better solution for you. Using phpMyAdmin, in your magento database, look for the core_config_data table and click it. Click the "Search" tab.  Then on the "path" column set the operator to LIKE %...% and the Value to cookie and click the "Go" button to search. Screenshot provided for clarity After searching, set the value of web/cookie/cookie_path ,  web/cookie/cookie_domain ,  web/cookie/cookie_httponly , and  web/browser_capabilities/cookies to NULL Just like this on the screenshot. Screenshot provided for clarity Adding product to cart and logging in to the admin panel should work now!

Git: Colorizing

It's much easier to work with Git especially if it's colorized. And you can do that by simply executing these in your Terminal : git config --global core.pager "less -FRSX" git config --global color.ui auto git config --global color.pager true

Ubuntu: MySQL import/export with gunzip

To export your mysql database simply do the following : mysqldump -u user -p database | gzip > database.sql.gz   And to import it : gunzip < database.sql.gz | mysql -u user -p database

Magento: Unable to list current working directory.

If you are experiencing this error : "Unable to list current working directory." when saving the product images you uploaded, simply change the permission of the media folder by doing like this : chmod -R 777 media

Magento: How to fix "The requested URL /index.php was not found on this server" error

Image
If ever you're seeing an error like this when you go to your magento inner pages. This might fix your problem. In your .htaccess file you probably have something like this : RewriteRule ^(.*)$ /index.php/$1 [L,QSA,PT] or RewriteRule .* /index.php [NS,L] If that is so, just simply remove the leading "/" from the index.php then save it. Refresh the page. And voila! The issue should be fixed now.