.

.
Solving the 404 error on the System » Configuration custom extension menu

Solving the 404 error on the System » Configuration custom extension menu

When we install for the first time an extension that adds a menu on the System » Configuration panel, it is possible that we receive a 404 error when trying to configure it.
This has happened to me on the Simple Configurable Products extension and theAheadWorks Blog extension. Solving this is really easy:
1. Clean your cache and reindex data
2. Log out from the backoffice and log in again
Everything should work fine now.
Exception printing is disabled by default for security reasons

Exception printing is disabled by default for security reasons

There has been an error processing your request. Exception printing is disabled by default for security reasons.”
This is usually because your Magento install has difficulty in knowing where to put your cache files. Thankfully it’s a simple fix.
If you’ve already set up exception logging (see below) you’ll also have the errors and warnings similar to these in your exception.log
Exception message: Could not determine temp directory, please specify a cache_dir manually
exception ‘Zend_Cache_Exception’ with message ‘Could not determine temp directory, please specify a cache_dir manually’ in

How to specify a cache_dir

Locate the file;
/lib/Zend/Cache/Backend/File.php
and find;
‘cache_dir’ => null,
which can be found around line 99.
and change it to;
‘cache_dir’ => ‘tmp/’,

Create a tmp folder

Now create, if it doesn’t already exist, a folder named tmp in the root of your Magento installation.

Enable Magento exception printing

If this doesn’t fix your issue or to get a more detailed report on your error, you can temporarily enable exception printing.
Go to;
errors/local.xml.sample
and rename local.xml.sample to local.xml
It’s best to revert this back to .sample after you’ve solved your issue, as throwing out error messages in the front end is a basic way for hackers to debug your server and file set up.
In most cases errors will be logged in the /errors folder and you won’t have any need to do this.

Enable Magento exception logging

Enabling exception logging via admin, will also help you to get more information on your Magento errors.
In admin go to;
System > Configuration > Developer > Log Settings > Enabled = Yes
The custom locations for the error log files should be fine, but make sure that the folder is writeable.
Future errors should now be stored in the files;
  • exception.log
  • system.log
which are in the {{base_dir}}/var/log folder.

change database settings in magento ?

change database settings in magento ?

First thing you need to do is create a connection in your module's config.xml. It should look similar to the default_setup in your /app/etc/local.xml. Here you can specify the host to be localhost and then set a different dbname or you can specify a different host completely. I have also used a socket before which works also.

<resources>
    <new_db>
        <connection>
            <host><![CDATA[localhost]]></host>
            <username><![CDATA[db_username]]></username>
            <password><![CDATA[db_password]]></password>
            <dbname><![CDATA[db_name]]></dbname>
            <model>mysql4</model>
            <type>pdo_mysql</type>
            <active>1</active>
        </connection>
    </new_db>
</resources>

Integrate Paypal Payment System in PHP & MySQL

Step 1
Create a Paypal Sandbox account at https://developer.paypal.com/
Step 2
Now create test accounts for payment system. Take a look at Sandbox menu left-side topSandbox->Test Accounts
create a file where we use 
index.php
<?php
// Test Paypal API URL
$paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr';
 // Business email ID
$paypal_id='your_seller_id';
?><h4>Welcome, Guest</h4> 
<div class="product"> <div class="name"> Test Payment </div>
 <div class="price"> Price:$15 </div>  
 <form action="<?php echo $paypal_url; ?>" method="post" name="frmPayPal1">
 <input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
 <input type="hidden" name="cmd" value="_xclick"> 
 <input type="hidden" name="item_name" value="Test Payment">
 <input type="hidden" name="item_number" value="1"> 
 <input type="hidden" name="credits" value="510">
 <input type="hidden" name="userid" value="1">
 <input type="hidden" name="amount" value="15"> 
 <input type="hidden" name="cpp_header_image" value="your logo path or any image">
 <input type="hidden" name="no_shipping" value="1"> 
 <input type="hidden" name="currency_code" value="USD"> 
 <input type="hidden" name="handling" value="0"> 
 <input type="hidden" name="cancel_return" value="cancel.php"> 
 <input type="hidden" name="return" value="success.php">
 <input type="image" src="paypalimage urlor button image" border="0" name="submit" 
alt="PayPal"> </form> 
 </div></div>

success.php
Paypal payment success return file. Getting Paypal argument like item_number. Paypaldatasuccess.php?tx=83437E384950D&st=Completed&amt=10.00&cc=USD&cm=&item_number=1
<?php
$item_no            = $_REQUEST['item_number'];
$item_transaction   = $_REQUEST['tx']; // Paypal transaction ID
$item_price         = $_REQUEST['amt']; // Paypal received amount
$item_currency      = $_REQUEST['cc']; // Paypal received currency type
$price = '15.00';
$currency='USD';
//Rechecking the product price and currency details
if($item_price==$price && $item_currency==$currency)
{
    echo "<h1>Welcome, Guest</h1>";
    echo "<h1>Payment Successful</h1>";
}
else
{
    echo "<h1>Payment Failed</h1>";
}
?>

cancel.php

Paypal API cancel_return file.
<?php
echo "<h1>Welcome, Guest</h1>";
echo "<h1>Payment Canceled</h1>";
?>


 Step 3

When your web application test payment system workflow is completed. Change the form action development API URLs to original API URLs and give valid $paypal_id seller email id.
$paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr';
//to
$paypal_url='https://www.paypal.com/cgi-bin/webscr';