Facebook share is good, simple, lets us share almost everything on web in seconds. But Facebook caches already shared urls/pages for better performance. This causes issues at time when we update the title, picture being shared or the description of the page because Facebook still shows the older version of the page.
For modifying which image, title and description FB chooses, read this
I will discuss three simple ways to force facebook to go and fetch the latest stuff from the page being shared. (more…)
Let’s say you have an application, where users can place votes for their favorite products and you’d like to increment the current number of votes by one or count number…
New version theme is not working in old version. After upgrading magento or when I design theme in magento 1.5.0.1 and use that theme in magento 1.4.2 that time my product page shows error like Invalid…
If you want to customize query or product collection data you can easily to do that with addAttributeToFilter funcation in magento. In short you can easily customize product collection select query based on your requirement in magento development.
To retrieve data from another model into view templates or anyplace [php] $this->Model2 = ClassRegistry::init('Model2 '); $this->Model2 ->find(); [/php] Or if the models are associated, just daisy chain the finds:…
PHP: How to create unique short string IDs with PHP & MySQL
IDs are often numbers. Unfortunately there are only 10 digits to work with, so if you have a lot of records, IDs tend to get very lengthy. For computers that’s OK. But human beings like their IDs as short as possible. So how can we make IDs shorter? Well, we could borrow characters from the alphabet as have them pose as additional numbers…. Alphabet to the rescue!
I created this function a long time ago. Time to be nice and share.
More is Less – the ‘math’
The alphabet has 26 characters. That’s a lot more than 10 digits. If we also distinguish upper- and lowercase, and add digits to the bunch or the heck of it, we already have (26 x 2 + 10) 62 options we can use per position in the ID.
Now of course we can also add additional funny characters to ‘the bunch’ like – / * & # but those may cause problems in URLs and that’s our target audience for now.
OK so because there are roughly 6x more characters we will use per position, IDs will get muchshorter. We can just fit a lot more data in each position.
Magento Compiler feature should be disabled on any changes in loaded Magento classes, in other words, you need to disable Magento Compilation every time before installing new extension or initiating upgrade/downgrade/installation or removal of any Magento module.
To disable Magento Compiler you can use one of the following methods:
Admin Interface
navigate to System > Tools > Compilation page and click on Disable button:
Recently, one of our clients could not get their product categories to appear in the order set in the Magento Catalog > Manage Categories screen. No matter how they dragged and dropped the categories, the ones near the top would not display as intended on the front end.
How Magento Orders Categories
Categories are displayed in navigation menus based on a field titled “position” in thecatalog_category_entity data table. By default, the order is displayed in ascending order. There are other ways of adding code to display categories alphabetically, but by default, the order shown is determined by the position value.
So, why would changing the order under Manage Categories not work?
What I Observed
When working in the Manage Categories menu, the client and I were focused on manipulating the top 2-3 categories, as those were the ones most important to him at the time. We could change their order, but even after re-indexing the Flat Catalog, the front end would still not display the correct order. (more…)