Magento 404 Error CMS Page Not Found In Admin Panel

Thursday, 1. November 2012

If you have been getting a 404 error when trying to access CMS pages in magento admin, possibly after an upgrade, chances are you have store IDs mixed up!

Run this script in phpmyadmin against the site database and hopefully it will bring smile to your face!

DELETE FROM cms_page_store WHERE store_id NOT IN (SELECT store_id FROM core_store);

Setting Up Magento Cron Jobs Via SSH Command Line

Tuesday, 10. April 2012

Setting up cron jobs via command line tool is easy if you know how. First you will need to open the cron tab before you can enter and schedule your tasks.

This simple walk through will shade some lights on how to do just that and what are the required setting to complete a successful job setup.

1) Opening the Cron Tab

To open the cron tab as the user you are logged in as type:

crontab -e

To open the cron tab as a specific user, type:

crontab -u USERNAME -e

Time Format Steps:
minute hour day month day-of-week

minute 0-59
hour 0-23
day 1-31
month 1-12
day-of-week 0-7 (where both 0 and 7 mean Sun, 1 = Mon, 2 = Tue, etc)

This is how the cron should look

min hour day month dayofweek command_to_run

Examples: What stuff really means

0 1 * * *  ==> Every day at 1Am
* * * 12 * ==> December
14,29,44,59 * * * * ==> at after 14, 29, 44 and 59 minutes every hour of everyday
*/5 * * * * ==> Every 5 minutes

Now that you know where to add your cron job command, let’s go through two simple ways to set it up.

Magento Cron Job Using WGET

*/5 * * * * wget -q

Magento Cron Job Using PHP

*/5 * * * * /path/to/php -f /local/path/to/cron.php

Testing The Magento Cron Jobs

It is difficult to test that the Magento cron jobs are now set up correctly without waiting a couple of days and seeing whether your indexes have been refreshed. Fortunately, there is a quick test you can perform to tell. Change your cron tab command to one of the following (depending on the method you chose).

[email protected]
*/5 * * * * wget-bad-command -q
[email protected]
*/5 * * * * /path/to/php -f /local/path/to/cron-bad-filename.php

More examples

# run at 10 pm on weekdays, 
0 22 * * 1-5   mail -s "It's 10pm" ken%Ken,%%Where is food?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
5 4 * * sun     echo "run at 5 after 4 every sunday"

Manually Format Prices Using Number_Format

Thursday, 5. April 2012

If you have used round, floor etc while trying to format the prices display in Magento (or any other cart for that matter) but to undesired effect due to decimal points – a php number_format could be just the solution you are looking for!

It format the number nicely with ability to round and even change the decimal separator!

It also keeps the ending ‘0’ so you are sure your price display will be consistent across the pages.


number_format($_product->getPrice(),2); # 23.70

You can ready more Here

Successful Linnworks Magento Ebay Amazon integration

Thursday, 23. February 2012

If you are looking for specialist in Magento, eBay, Amazon and Linnworks integration, then you have come to the right place.

We at Zone-Connect specializes in providing solutions for Linnworks Integration with various sales channels such as ebay, Amazon and Magento and can help you quickly get up to speed with selling on these platforms with Linnworks acting as a central player to your order and inventory management.

Linnworks is a proven key player for multi-channels sales integration and we have been well impressed by their dedication to helping online retailers retain competitive edge in what they do, hence our decision to join as solution partners.

Our core focus at Zone-Connect is to help you and all online retailers do what they do best and that’s selling stuff online! When it comes to the technical side of things we will step in and iron things out for you just to guarantee your valuable time goes purely into your core business strategy and expanding your brand online.

If you would like to chat more about how we can help you start selling online and into multiple channels environment, please get in touch with us today! and we will make sure we get you to a flying start in no time!

We promise to work hard for you so you don’t have to!!

Use Curl With Magento and Zend Framework

Tuesday, 25. October 2011

Just a little snippet of curl implementation inside Magento for anyone interested.

try {
  $http = new Varien_Http_Adapter_Curl();
  $config = array('timeout' => 30); # Or whatever you like!

  ## You attach proxy with your custom implementation like this::
  if ($this->getUseProxy()) {
    $config['proxy'] = $this->getProxyHost(). ':' . $this->getProxyPort();
  ## You can add ssl certificate with your custom implementation like this::
  if ($this->getUseCertAuthentication()) {
    $config['ssl_cert'] = $this->getApiCertificate();
  ## make a POST call
  $http->write(Zend_Http_Client::POST, $this->getApiUrl(), '1.1', array(), $requestQuery);
  ## Get Response
  $response = $http->read();
} catch (Exception $e) {
  $debugData['http_error'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
  throw $e;
# Close Call

PHP – Magento Jobs At Zone-Connect Leeds UK

Friday, 21. October 2011

– Are you excellent with PHP?

– Do you have any experience in E-Commerce and/or Magento platform?

– Do you enjoy working with PHP and other Web Development technologies, platforms or frameworks currently available?

– Are you looking for a job that will challenge you every day but also provide you with an opportunity to be creative?

– Can you work on your own, good at making decisions and quick at finding solutions when you hit the wall?

– Are you based in Leeds (or close range) area in UK?

– Are you looking for decent rewards for your hard work?

– Can you work for at least 3 days a week?

If you feel like you have the answers for these questions, please get in touch with us today.

Magento showing ‘special price’ even though no rule is active

Thursday, 20. October 2011

I have had a strange issue today on Magento – all products were showing a Special Price even though all catalogprice rules were inactive and there was no special prices set for any of the products!

Even after deleting all the rules there completely, the special price never went away.

After a bit of digging I realized the table catalogrule_product_price on the database still had rows and rows of data even though there was no rules on the system.

So I did what you might have guessed – backed the table up and trancate all row!

Back to the site and WOOP WOOOP, special prices were all gone! Completely GONE!

Happy day at the office in the end and hope this may help you.

I don’t see to find this to be an issue on later versions but certainly on older ones prior to 1.5. However, I will not hesitate to do the same should I encounter the same problem on 1.6!

why prices not showing on product page for simple products magento?

Thursday, 13. October 2011

Why is my prices not showing up on product pages for Magento simple products??

If you have asked yourself that question preciously this maybe a solution for you. More than often this is a theme configuration related issue and especially if you are using a custom theme based on the default theme or default theme itself (which is BAD!)

To fix this, you will need to look for the Layout folder on your custom theme and locate the catalog.xml file.

– Look for a line similar to this one (I would search for

<block type="catalog/product_view_type_simple" name="" as="product_type_data" template="catalog/product/view/type/simple.phtml">

– Replace it with this line:

<block type="catalog/product_view_type_simple" name="" as="product_type_data" template="catalog/product/view/type/default.phtml">

– Refresh your cache and jobs a gooder again!

Exclude Tables With Mysqldump – Reduce the Size of Magento database backup

Wednesday, 12. October 2011

If you have ever wondered or be in need of excluding certain tables from your Mysqldump, here is snippet for you!

Basically you only have to specify the –ignore-table flag with your Mysqldump command. In order to exclude as multiple tables you will need to repeat the command as many times as the tables you want to exclude.

One important thing to remember, the –ignore-table flag expects you to specify the full table path i.e include the database name such as dbname.tablename.

Example: How to exclude Magento log table from mysqldump

mysqldump -uUSERNAME -pPASSWORD  --ignore-table=<DBASE_NAME>.log_url --ignore-table=<DBASE_NAME>.log_url_info  --ignore-table=<DBASE_NAME>.log_visitor --ignore-table=<DBASE_NAME>.log_visitor_info  --ignore-table=<DBASE_NAME>.log_customer --ignore-table=<DBASE_NAME>.log_quote --ignore-table=<DBASE_NAME>.report_event  --ignore-table=<DBASE_NAME>.index_event --ignore-table=<DBASE_NAME>.index_process_event  --ignore-table=<DBASE_NAME>.report_viewed_product_index --ignore-table=<DBASE_NAME>.dataflow_batch_export  --ignore-table=<DBASE_NAME>.dataflow_batch_import <DBASE_NAME> | gzip > <DBASE_NAME>_dump.sql.gz

Disable Foreign Key Checks AND Ignore inserts

mysqldump -uUSERNAME -pPASSWORD  --ignore-table=<DBASE_NAME>.log_url --ignore-table=<DBASE_NAME>.log_url_info  --ignore-table=<DBASE_NAME>.log_visitor --ignore-table=<DBASE_NAME>.log_visitor_info  --ignore-table=<DBASE_NAME>.log_customer --ignore-table=<DBASE_NAME>.log_quote --ignore-table=<DBASE_NAME>.report_event  --ignore-table=<DBASE_NAME>.index_event --ignore-table=<DBASE_NAME>.index_process_event  --ignore-table=<DBASE_NAME>.report_viewed_product_index --ignore-table=<DBASE_NAME>.dataflow_batch_export  --ignore-table=<DBASE_NAME>.dataflow_batch_import --disable-keys --extended-insert --insert-ignore  <DBASE_NAME> | gzip > <DBASE_NAME>_dump.sql.gz

Magento Multiple Store or Website Setup with Index.php

Wednesday, 14. September 2011

There are many ways to set up a multi-store or multi-website environment in Magento and make sure specific URL requests reaches the right website or store on Magento.

One popular way is to use the index.php file. Here are steps to do to get redirect URLs to associated stores or websites using this file.

Redirect URL to Magento’s website Code

1) Open index.php file

2) Search for the line below

$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

3) Change it to

switch($_SERVER['HTTP_HOST']) {
	case '':
	case '':
		$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '<your_websitecode>';		
                $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

4) Search for the line below

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

Make sure the type is says website and not store:

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';

Redirect URL to Magento’s Store Code

Repeat the same steps as above but make sure this time around you specify store codes in place of website code. Also, on step 4, set the type to store as opposed to website