If you don’t fancy upgrading Magento 1 through command line, you can upgrade Magneto core using Magento’s in-built Magento Connect Downloader.
- Load yoursite.com/downloader.
- Login with a user who has full Magento permissions.
- Make sure to click the “Clear all sessions after successful install or upgrade” option before proceeding.
- Click the Check for Upgardes button
- This will load all the packages with upgrade options beside them.
- Find the package name
- In the dropdown choose the most recent version of
- Use the checkbox beside it to include it in the upgrade
- Click Commit Changes
If you login and don’t see any packages, this may be due to the way the site was built.
At the top of Magento connect downloader enter
magento-core/Mage_All_Latest in the in put box, this will install all latest MagentoConnect core packages on top of existing files and will allow future upgrades through Magento Connect Downloader.
Alternative: Upgrade Magneto using the Magento Connect Downloader
Upgrading Magento is a must to keep your store in top-top condition, protect your customers and your business.
Upgrading Magento through command line is the easiest way to make sure you are running the latest version of the Magento Software
- Load the root directory of your Magento store
- Make sure the “mage” file has the right permissions:
chmod 777 mage
- Then launch Magento set-up:
- If all goes well you can then pull the latest version of the code source code:
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
If things didn’t go well with mage-setup you may need to run set som preferences….
- Make sure your prefered code is set:
./mage config-set preferred_state stable
- Then sync your changes:
You can then try the install command again.
That should do the trick.
I’ve been getting spammed by a company called The Compensation Specialist. They are a personal injury outfit. I’m not sure how they got my email but I didn’t subscribe and we don’t have an existing relationship, both are required for a UK company to send unsolicited email marketing material.
The rules on electronic mail marketing are in regulation 22. In short, you must not send electronic mail marketing to individuals, unless:
- they have specifically consented to electronic mail from you; or
- they are an existing customer who bought (or negotiated to buy) a similar product or service from you in the past, and you gave them a simple way to opt out both when you first collected their details and in every message you have sent.
You must not disguise or conceal your identity, and you must provide a valid contact address so they can opt out or unsubscribe.
I can’t seem to find any online or email contact details so might have to send this post out to him at his registered address.
Edit: Found an email address for one of Lee’s other companies, I’ll email there to find out wasssup.
The link in the spam email directs through to a contact form, which handily includes Mr Meranda’s companies record with the Crisis Management Regulator.
The Claims Regular provides an outline of Lee’s organisations. I’ll see if I can contact him through one of those.
Other trading names include: UK Claim Experts, Accident Compensation Alliance, 60 Second Claim, UK Claim Lawyers, Nationwide Injury Lawyers, Smart Compensation
Every computer has a file on it which allows the owner to specify where a website is loaded from. A hosts file is a simple combination of domain names and IP addresses.
Adding a record to your hosts file means your computer will load the domain using the IP address specified, rather than the one provided by DNS.
- Press the Windows key.
- Type Notepad in the search field.
- Right-click on the Notepad result
- Select Run as administrator.
- From Notepad, open: C:\Windows\System32\Drivers\etc\hosts
- Add the new lines to the file.
- Click File > Save to save your changes.
- Exit Notepad
- Open a terminal window.
- Open the hosts file in a text editor (you can use any text editor) by typing the following line:
sudo nano /etc/hosts
- Enter your domain user password.
- Make the necessary changes to the file.
- Save the file
Mac OS X 10.0 through 10.1.5
- Open /Applications/Utilities/NetInfo Manager.
- To allow editing of the NetInfo database, click the padlock in the lower-left corner of the window.
- Enter your domain user password and click OK.
- In the second column of the browser view, select the node named machines.
The third column contains entries for
- In the third column, select
- From the Edit menu, select Duplicate. (The quickest way to create a new entry is to duplicate an existing one.)
A confirmation alert appears.
- Click Duplicate.
A new entry called localhost copy appears, and its properties are shown below the browser view.
- Double-click the value of the
ip_address property and enter the IP address of the other computer.
- Double-click the value of the
name property and enter the hostname you want for the other computer.
- Click the
serves property and select Delete from the Edit menu.
- From the File menu, select Save.
A confirmation alert appears.
- Click Update this copy.
- Repeat steps 6 through 12 for each additional host entry that you want to add.
- From the NetInfo Manager menu, select Quit.
You do not need to restart the computer.
Mac OS X 10.6 through 10.12
- Open Applications > Utilities > Terminal.
- Open the hosts file by typing the following line in the terminal window:
sudo nano /private/etc/hosts
- Type your domain user password when prompted.
- Edit the hosts file.
The file contains some comments (lines starting with the # symbol), and some default hostname mappings (for example, 127.0.0.1 – local host). Add your new mappings after the default mappings.
- Save the hosts file by pressing Control+x and answering y.
- Make your changes take effect by flushing the DNS cache with the following command:
The new mappings should now take effect.
Moving an entire Magento site from one server to another or between hosts can be a daunting task for non-server administrators.
I’m going to try and expand this over time.
- Agree time frames, a day for file system sync, an hour for database update and DNS update.
- Content Freeze – no new images or content is added by Store owner, customers continue to place orders and create accounts.
- A copy of the site is downloaded to the new server via FTP
- A snapshot of the database is taken and used to test the site on the new server
- Database Freeze – no new orders, holding page on the front end, Admin Panel still accessible if required but no updates allowed.
- Export/import database
- Old Server: mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql
- New Server wget http://www.yourwebsite.com/wantedsqlfile.sql
- New Server: mysql -u YourUser -p YourDatabaseName < wanted.sql
- Copy over/configure your SSL for the new site
- Next-up is the DNS update to repoint the domain
This one will come in useful until Magento 2 sorts itself out.
For some reason, Magento 2 has no way to order assets out of the box. There is now an extension which allows you to set an order attribute in the CSS tags of the layout XML files and layout updates in Admin Panel.
Github: Mage2 Ordered Assets by Quickshiftin
<css src="css/app.css" />
<css src="css/app.css" order="100" />
Return an array of pathnames matching a specific pattern.
// Find all CSV files in the /home/var/imports/ directory
- /home/var/imports/hello-world.csv – Returned
- /home/var/imports/hell-world.csv – Not returned
- /home/var/imports/hello-.csv – Returned.
This script will first scan the var/import directory for all CSV files starting “import-” using the
glob() function in PHP. It will return an array of any files which match the query in the directory including the file path from root.
$file_parts will be used later when we need just the file name.
$cmd is the executable shell command we will be using to load Magmi, set the profile, mode and chosen file.
shell_exec() function runs the command and will return any output to the
$output variable, this can be expanded to check for a successful import. The script below will carry on regardless of import status.
Once the import is complete we take the CSV and copy it into an archive folder, just in case we want to reuse it. The original file is then deleted from the var/import folder using
This script can then either be run manually, or set-up as a scheduled task using Cron.
// Find all CSV files in import directory
$files = glob('/home/admin/public_html/var/import/import*.csv');
// For each of the files found
foreach ($files as $file):
// Explode for teh the file name in 6th position of the array
$file_parts = explode("/",$file);
// Set-up the command
$cmd = 'php /home/admin/public_html/magmi/cli/magmi.cli.php -profile=default -mode=create -CSV:filename="'.$file.'"';
// Execute the comamnd
$output = shell_exec($cmd);
// Copy the executed script into an archive folder
if ( copy($file,'/home/admin/public_html/var/import/archive/'.$file_parts) ):
// Delete the original
This is a regular issue when using Sage Pay with Magento that needs a bit of explaining.
Sage Pay transactions started by the customer are stored in the Magento database. When a transaction is completed successfully this Sage Pay transaction is linked to the completed order in Magento.
When a order does not complete this leaves transactions in the Magento database not connected to a Magento order ID. These are orphaned transactions. The cause can be the customer abandoning the order at some point (e.g. the 3D secure checks), a declined/rejected payment, or caused by an error when Magento Saves the order. Because there is no completed Order ID to connect the transaction to these are considered “orphans”.
Orphaned transactions are not always bad. If you monitor the list of orphaned transactions in Magneto (Sales > Sage Pay > Orphan Transactions) you can use the details to recover lost sales, for example a telephone or email address may be available to contact customers who have been unable to complete 3D Security checks and enter the order manually.
The most important thing to note is that Sage Pay integration will not tell Magento to save an order unless the payment has been successfully taken. The successful payment response from Sage Pay will create the “processing” order in Magento. This stops issues with inventory and shipping unpaid for orders.
The Sage Pay Suite Orphan Transaction list will not only help you spot issues with customers processing orders, it can also help you recover sales.
Used to send a raw HTTP header, often used for page redirects.
Must be called before any other output is sent.
// Redirect the request to https://keithgreer.uk
// Send an error code to the browser, for example a 404
header("HTTP/1.0 404 Not Found");
All instances of $search are replaced with $replace in $subject.
// Will print to screen: "Why is the sky blue?".
echo str_replace("red","blue","Why is the sky red?")
Before you begin, figure out the URL keys that you need for the ID Path, Request Path, and Target Path. Just remember— the “Request Path” is the old URL, and the “ID Path” and “Target Path” are the new URL.
It is easy to set-up multi-currencies in Magento. This code allows you to quickly include a currency drop down or link to the header or footer of your Magento store. Before you begin make sure you have enabled more than one currency as this example won’t work without at least one additional currency alongside your base currency.
Set-up the following code in your theme directory
/app/design/frontend/package/theme/template/currency/currency.phtml. I’ve included code for both a drop down select box, or inline list of hyperlinks.
Continue reading Magento Code: Include currency switcher in the header or footer with Foundation mark-up
Magento makes it really easy to expand the usual product attributes through the Admin Panel. While these can be added to the product page in the standard attribute list table, you may want your attribute to appear differently or use it for another feature. This post explains how.
In this example we’ll be adding an attribute to tell the customer how long they might have to wait on a product to arrive.