Modify shared item’s title, description & title appear on Facebook

Modify shared item's title, description & title appear on Facebook

Modify shared item’s title, description & title appear on Facebook

Thousands of websites are shared in facebook each day. Whenever you share a URL on facebook, it generates a feed against that url. The feed has a title, an excerpt or description and an image.

You can enhance how the shared item appears on Facebook by configuring how it gets previewed on a user’s profile and when a user tries to share it.You do this with <meta> tags. If there are no meta tags specified then Facebook share will take the site title, starting content of the site as excerpt and usually the first image shown.

In order to customize how your site looks while being shared on facebook you need to add meta tags in the <head> of your page.
(more…)

Clear Facebook Share’s Cache for images and description?

FaceBook: How to clear Facebook Share’s Cache?

FaceBook: How to clear Facebook Share’s Cache?

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…)

Incrementing a field in CakePHP like Hits & Votes

Incrementing a field in CakePHP like Hits & Votes

Incrementing a field in CakePHP like Hits & Votes

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 of hits(Number of page views)

It’s very easy by using updateAll:

$this->Product->updateAll(array('Product.vote'=>'Product.vote+1'), array('Product.id'=>40));

You may want to restrict Product model by using unbindModel, containable, etc.

Also, you don’t have to pass in the second argument to updateAll, if you wish to update all records in your table.

Magento Invalid Method Mage Catalog Model Product IsDuplicable

Magento Invalid Method Mage Catalog Model Product IsDuplicable

Magento Invalid Method Mage Catalog Model Product IsDuplicable

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 method Mage_Catalog_Model_Product::isDuplicable

I find the solutin and its work for me.

Copy your product.php file from this path: app\code\core\Mage\Catalog\Model\product.php and replace in your maegnto folder.

Magento AddAttributeToFilter SQL Conditionals

Magento AddAttributeToFilter SQL Conditionals

Magento AddAttributeToFilter SQL Conditionals

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.

< ?php $collection = Mage::getModel('catalog/product')->getCollection(); ?>

If you want get all fields then use below condition select (more…)

PHP: How to create unique short string IDs with PHP & MySQL

PHP: How to create unique short string IDs with PHP & MySQL

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.

This is basically what url shortening services do like tinyurl, is.gd, or bit.ly. But similar IDs can also be found at youtube: http://www.youtube.com/watch?v=yzNjIBEdyww
(more…)

Page 3 of 241234567»

Pin It on Pinterest