Magento: How to get product stock quantity & other stock information?

Here is a quick code to get any product’s stock information like quantity (qty), minimum quantity (min_qty), stock availability (is_in_stock), minimum and maximum sale quantity (min_sale_qty and max_sale_qty), etc. First load the product. Product can be loaded in different ways. Here are the two different ways to load any product in Magento:- 1. Load product … Read more

WordPress Fix: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)

Scenario: I am getting this warning message in my wordpress blog:- open_basedir restriction in effect. File(/tmp) is not within the allowed path(s) Solution: You should check the Uploading Files path settings in your wordpress admin. – Go to Settings -> Media – Under ‘Uploading Files‘, see the path for ‘Store uploads in this folder‘ – … Read more

WordPress Contact Form 7: Quick Fix to spinning arrow displays forever & no success/error message displayed

Scenario / Problem I am using Contact Form 7 plugin on my WordPress blog. The form is displayed properly. But, when I submit the form, the spinning arrow is displayed forever and no success or error message is displayed. However, the form is working. It is submitted and I get the message in my inbox. … Read more

Javascript: How to Submit form and Change form action?

This article will show you how to submit form and change form action using javascript. This is a very simple trick but it’s very useful and frequently used. Submit Form using Javascript HTML form <form name="myForm" action="http://google.com" method="get"> Search: <input type="text" name="q" /> <button onclick="javascript: submitForm()">Search</button> </form> Javascript function function submitForm() { document.myForm.submit(); } Change … Read more

Magento: Show/Hide Demo Store Notice

A demo store is where there are products but the order done by customer is not processed. If your website is in development mode then it is better to enable demo store notice. Enabling demo store notice in Magento is very simple. You just need to select an option in configuration settings in admin panel. … Read more

Magento: Show/Hide website to search engines by adjusting robots meta tag

The Robots META Tag is meant to provide users who cannot upload or control the /robots.txt file at their websites, with a last chance to keep their content out of search engine indexes and services. <meta name="robots" content="robots-terms"> The content=”robots-terms” is a comma separated list used in the Robots META Tag that may contain one … Read more

Magento: How to get actual price and special price of a product?

Here is a quick and useful code on getting actual price and special price of any product in Magento. The actual price is the real price assigned to the product and special price is the price after any discount is applied to the product. Loading Product $_productId = 52; $_product = Mage::getModel('catalog/product')->load($_productId); Get Actual Price … Read more

Windows: How to install and setup XDebug in PHP Eclipse?

PHPEclipse is a PHP development plugin for the Eclipse IDE Framework. And, XDebug is a PHP extension which provides debugging and profiling capabilities. I am using Windows 7 Operating System and WAMP Server. Install XDebug in Windows – Create a php file with the code phpinfo(). – Open the newly created file in a browser. … Read more

Ubuntu Linux: How to install and setup XDebug in PHP Eclipse? [IMAGES]

PHPEclipse is a PHP development plugin for the Eclipse IDE Framework. And, XDebug is a PHP extension which provides debugging and profiling capabilities. I am using Ubuntu Operating System. This article provides a step-by-step guide on installing and setting up XDebug in PHP Eclipse in Ubuntu. Install XDebug in Ubuntu Open terminal and type the … Read more