DEVMODE is something that can be enabled within your config file, which turns on database debugging, logs payments transaction details, and refreshes the cache folder whenever you load a page on your website.
In this article, you will learn:
Using Devmode to Recompile Your Skins Folder
Using DEVMODE to Log Your Payment and Shipping Communication
Using DEVMODE to Debug Database Errors
Note: This article is meant for ADVANCED users and developers.
Using Devmode to Recompile Your Skins Folder
The config file used for turning on DEVMODE is located in content/engine/engine_config.php. By default, this file does not contain a line for DEVMODE. For example, the file would look something like this:
<?php define('DB_HOST', 'localhost'); define('DB_USER', 'desertdessert'); define('DB_PASSWORD', 'mystrongpassword'); define('DB_NAME', 'desertdessert_database'); define('DB_PREFIX', ''); define('LICENSE_NUMBER', '1234-55555-6-777777777-d88899'); define('PASSWORD_SALT', '$1234567abcdefgh9987654321');
When we turn on DEVMODE, we need to add a new line to the config file which tells the cart that it's on. This line is define('DEVMODE',true);. The resulting file would look like this:
<?php define('DB_HOST', 'localhost'); define('DB_USER', 'desertdessert'); define('DB_PASSWORD', 'mystrongpassword'); define('DB_NAME', 'desertdessert_database'); define('DB_PREFIX', ''); define('LICENSE_NUMBER', '1234-55555-6-777777777-d88899'); define('PASSWORD_SALT', '$1234567abcdefgh9987654321'); define('DEVMODE',true);
The DEVMODE constant/flag is used in a couple areas of the cart. First, it is used to determine if the cache folder should be recompiled, meaning, the contents inside the following paths are combined:
/content/engine/design/
/content/skins/<currentskin>/
/content/skins/_custom
To see the difference this mode makes, perform the following test cases in this order:
DEVMODE Flag Set to FALSE
- Ensure that the engine_config.php has the following line:
<?php define('DEVMODE', false);
- View the homepage of the cart and notice the background color.
- Using the filemanager in the cart or an FTP program, change the default.css file in the content/skins/<current skin>/themes/ folder by adding the following css:
body { background-image: none; background-color: red; }
Note: Change the background-color to another value if you already have red as the background-color property value of the body tag.
- View the homepage of the cart. Notice that the background-color has not changed. (The cache folder has not been recompiled from the latest contents of the folders mentioned above.)
DEVMODE Flag Set to TRUE
- Ensure that the engine_config.php has the following line:
<?php define('DEVMODE', true);
- View the homepage of the cart and notice the background color. (If you performed the test case above, the color should now be red).
- Using the filemanager in the cart or an FTP program, change the default.css file in the content/skins/<current skin>/themes/ folder by adding the following css:
<?php body { background-image: none; background-color: green; }
Note: Change the background-color to another value if you already have green as the background-color property value of the body tag.
- View the homepage of the cart. Notice that the background-color has changed as expected. (The cache folder has been recompiled from the latest contents of the folders mentioned above.)
Using DEVMODE to Log Your Payment and Shipping Communication
Setting the DEVMODE flag to true will also allow the cart to log the API communication to and from both payment gateways and real-time shipping. This is especially useful if payment or shipping is failing to work properly.
Follow the same steps above to turn DEVMODE to true.
Now attempt to get a shipping quote or capture payment.
Once attempted, navigate through your files to content/cache/logs. Any gateways you have enabled will show a .txt file. For example, if you use Authorize.net you will see a file named payment-authorizenet_aim_3_1.txt. If you use UPS, you will see a file named shipping-ups.txt.
Edit the file to view it's contents. You will see the request the cart is making to the gateway, and the gateway's response back. If there are any problems, it will typically show within the response from the gateway.
Using DEVMODE to Debug Database Errors
DEVMODE is also used to show more information when a SQL query may encounter a problem or cannot be executed. A developer should be able to see the error so they can troubleshoot and resolve the issue. Without DEVMODE on, the error would look like this:
After turning DEVMODE on, the same error would look like:
Links to Related Articles
How can I get FTP Access to my Files?
If you didn't get your question answered, please contact the Pinnacle Cart Support Team. To submit a ticket, go to the My Account drop-down menu at the top right of the admin area and select Support.