Apr 17, 2013

Magento Programming: Adding a “Home” link to the top menu (Magento Way)

So, in this article I’ll give you a handy script to add a home link to the top menu.

In magento 1.7, the menu is now created via an *event* (page_block_html_topmenu_gethtml_before)

The catalog observer hooks into this and adds menu items as Varien_Data_Tree_Node objects.

I have some samples here to show you how to add a link at the beginning of this menu.

config.xml portion:


Copy The Code:


===============================
<pre>
<config>
….
<frontend>
<events>
<page_block_html_topmenu_gethtml_before>
<observers>
<catalog_add_topmenu_items>
<class>cp_layout/observer</class>
<method>addTopMenuItems</method>
</catalog_add_topmenu_items>
</observers>
</page_block_html_topmenu_gethtml_before>
</events>
</frontend>
</config>

</pre>

observer portion:
=================================
<pre>
<?php
Class Cp_Layout_Model_Observer
{
/**
* Adds additional links to the top menu
*
* @param Varien_Event_Observer $observer
*/
public function addTopMenuItems(Varien_Event_Observer $observer)
{
$nodeId = “home”;
$menu = $observer->getMenu();
$tree = $observer->getMenu()->getTree();

$data = array(
“name” => “Home”,
“id” => $nodeId,
“url” => Mage::getBaseUrl(),
“is_active” => Mage::getSingleton(‘cms/page’)->getIdentifier() == ‘home’ && Mage::app()->getFrontController()->getRequest()->getRouteName() == ‘cms’
);
$homeNode = new Varien_Data_Tree_Node($data, ‘id’, $tree, $menu);
$this->_prependNode($homeNode, $menu);

}

protected function _prependNode($node, $menu)
{
$menu->addChild($node);
$nodeId = $node->getId();
$readded = array();
foreach($menu->getChildren()->getNodes() as $n)
{
if ($n->getId() != $nodeId)
{
$readded[] = $n;
$menu->getChildren()->delete($n);
}
}
foreach($readded as $r)
{
$menu->getChildren()->add($r);
}
}
}
</pre>


Apr 10, 2013

Upgrading to Magento Enterprise 1.13 – Introduced by Roy Rubin

At the Magento Imagine Conference today, Tuesday, April 9, 2013, Roy Rubin announced the release of Magento Enterprise Edition version 1.13

Magento Enterprise 1.13 Announced

Magento Enterprise 1.13 Announced by Roy Rubin, founder of Magento

The biggest benefits to Magento Enterprise Edition (EE) 1.13 are all performance related. These improvements are the hardest to describe to a customer, but for large accounts, are the area that Magento has been most lacking in.

We have received a lot of inquiries over the past 2 years of customers trying to squeeze the most out of Magento  We always have some way or another to help them, but the truth is just that Magento is somewhat clunky. The improvements I’ve seen in 1.13 indicate that Magento feels the same way, and the core team is making every effort to remedy that issue (an effort that I hope will come to full fruition in 2.0)

==================================================================

Redis Support

Magento EE 1.13 now support Redis NoSQL as a cacheing session storage solution. I’m not yet sure of the specifics, but this could provide an advantage over memcached — and Magento now recommends using redis on new deployments. It’s not that redis is “faster” in terms of storing cached values, but it has more support for storing objects (I’m getting into some pretty technical stuff here, but the point is, this could be a better cacheing solution assuming the Magento core team implements it correctly). However, I’m not sure how long it will take for hosting solutions like pier1/nexcess to support Redis.

 

Reindexing

As many of you may have encountered, re-indexing is a pain in the @$$. Especially on sites with large (10,000+ SKUs) catalogs. EE 1.13 supports mysql database triggers as a means of keeping the indexes up to date, and it makes re-indexing an incremental process rather than an en masse process. The Magento core team has also limited the number of instances where a full re-index is required (hopefully never once the store is setup)

From the Magento article:

In Magento Enterprise Edition 1.12, any change to a product would result in a full re-index. Magento Enterprise Edition 1.13 introduces a new feature–incremental re-indexing. With incremental re-indexing, only those items that were changed or added will be re-indexed, reducing the processing time to a fraction of what was required before.

This is huge—I’ve seen stores where store owners are crippled if they update their product data, as reindexing 10,000+ products can take hours. So, this is a big plus. No longer will a store owner need to have a once-a-day product update regiment.

Also, if you look on the bench marking page: http://www.magentocommerce.com/knowledge-base/entry/ee113-performance-and-scalability-white-paper you will see significant improvement in the time required to make a full re-index (53% improvement on 500,000 SKUs!)

 

Onepage Checkout Speeds

So, whenever a user enters the checkout, Magento can’t rely on all the fancy cacheing layers. And, it’s a known problem that onepage checkout is slow; this is the whole reason onestepcheckout exists. But, even that (I’ve noticed) has problems related to the amount of time it takes to return shipping rates, payment methods, and order review steps.

See this link: http://www.magentocommerce.com/images/uploads/2184-1.13_Benchmark_Report_Checkout_Flow_r1v1.png

You will notice the checkout has been extremely optimized in terms of the amount of time it takes to perform one of these operations. As to the effect that has on the core code, I’m not yet sure. I’m really hopeful this feature will be in CE 1.8 as well.

From the benchmark page:

During our testing, which simulated a storefront running at peak hours, EE 1.13 executed 33% more orders and 31% more page views than Magento Enterprise Edition 1.12 on the multi-node benchmarking configuration. Notably, Magento Enterprise Edition 1.13 served 47K pages during the test run (10 minutes).

This is also a big improvement…once again, it’s only targeted at high volume sites, but I can think of several customers that would benefit from this.

 

MySQL Performance

I’d like to highlight one of the observations made in the bench marking article:

  • The MySQL instance did not show any significant signs of CPU or I/O load during the tests.
    • The CPU was under 10% and no queries exceeded a 2-second threshold.

I’ve noticed that MySQL seems to be a memory and CPU hog on some instances of Magento  This observation (specifically the no queries beyond 2-second threshold) shows an improvement in the scalability of Magento from a database perspective. Now, I don’t know what Magento’s benchmark for 1.12 was, but I’ve definitely seen stores not getting near the volume that the benchmark took place with, having MySQL performance issues.

 

Improved Tax Calculations:

There had been problems with tax calculations, especially with rounding up to the one-cent and when using multiple types of currency. The tax calculation algorithm was updated to get rid of errors with rounding offsets when displayed on purchasing screens. Additional support has also been given for various nationalities, primarily Canadian.

 

Increased Overall Functionality:

A whole slew of over 350 functional improvements for the web store, shopping cart, web API, payment options, import and export functionality, and admin order creation. All of these minor improvements add up to a big difference in the end, which will drastically increase user experience, and make it easier for admins to make changes without worrying over slowing down the whole site.

Feb 15, 2013

Magento 1.7.0.2: How to Select Both PayPal Express Checkout and PayPal Standard

In Magento Community version 1.7.0.2, many of our clients have complained that they have not been able to select more than one PayPal method at the same time.

For example, if you are running Magento Community 1.7.0.2, and want to enable both PayPal Express Checkout, as well as PayPal Website Payments Standard, the system throws an error like this:

Magento Community 1.7.0.2 Admin Error Message: There is already another PayPal solution enabled.  Enable this solution instead?

Magento Community 1.7.0.2 Admin Error Message:
There is already another PayPal solution enabled. Enable this solution instead?



This happens when you are in the Magento admin area of the site, under the PayPal Payment Solutions:

Magento Admin Community 1.7.0.2 Screenshot - PayPal Payment Solutions Options

Magento Admin Community 1.7.0.2 Screenshot – PayPal Payment Solutions Options



If you attempt to add both the first option (PayPal Website Payments Standard) and the fourth option (PayPal Express Checkout) at the same time, you’re not able to add both at the same time.

A big reason to add both is that a customer will often choose the PayPal Express Checkout option on the shopping cart page (and thereby bypass the checkout page). Mobile users are a huge reason why a website should enable PayPal Express Checkout. Instead of having to find and then type your credit card information into a form on an iPhone, iPad or other mobile device or tablet, you merely have to enter in an email address and a password, and you can check out. Without having to create a new profile on the site, etc.

It’s important to have PayPal as a payment option on the checkout page, so if someone wants to pay via PayPal instead of a credit card, they can do this easily. I do this all the time when I’m trying to place an order, and don’t have my credit card handy.

PayPal Express Checkout is an altogether different customer experience than PayPal Standard, and that’s why so many Magento Community version 1.7.0.2 users have been frustrated.

Our Magento Certified Developers at Customer Paradigm have developed a quick fix to allow you to enable both PayPal Standard and PayPal Express Checkout, and can usually apply this patch to your site in about an hour. Want more information? Call 303.473.4400 or visit here to have a real person contact you now.

Jan 25, 2013

Magento Tutorial: Building Products in Magento With Multiple Options

In Magento Commerce, the question of how do you best build products with multiple options isn’t straightforward.

Lonny Burgos - Developer, Customer Paradigm  Magento Certified DeveloperIn this tutorial, Lonny Burgos, a Magento Certified Developer, guides you through the process.

 

Questions? Need help with your Magento site? Call us – 303.473.4400 or visit here to have a real person contact you now >>

Four Main Steps to Building Configurable Products with Multiple Options

  1. Build the Attributes – these are the options that will show up as dropdowns on the product page.
  2. Add the Attributes to an Attribute Set – the attribute set will provide an easy way to reuse the attributes for other products.
  3. Create Simple Products – these are the individual products for each option.
  4. Create Main Configurable Product – this main product will house all the simple products.

To better understand the relationship between the Main Configurable Product and the simple products, I will outline a simple scenario:

I have a product called Crispy Tee:

  • This product is manufactured in 2 sizes (small and medium), and 2 colors, red and white.
  • I will have to build out a total of 5 products:
    • 1 Main Configurable Product
    • 1 Simple Product – small/white
    • 1 Simple Product – small/red
    • 1 Simple Product – medium/white
    • 1 Simple Product – medium/red
  • I intend for the customer to pick out the size and color of my Crispy Tee product before they add it to the cart.

Step 1 – Build the Attributes (aka the options size and color)

Lets begin by building out the new attributes for our Crispy Tee. I am going to use the following attributes names:

  1. crispyshirtsize
  2. crispyshirtcolor

In the admin, navigate to Catalog->Attributes->Manage Attributes. Notice the Add New Attribute button to the right and click on it. (Right Side of screen)

Magento - New product attribute for attribute code, scope, catalog input type for store, values required.
Be sure to set the following for each attribute:

  • Attribute Code – the internal name of the attribute must be lowercase.
  • Scope - set to Global otherwise the attribute will not be visible throughout the site
  • Catalog Input Type Store – set to Dropdown, this setting will come into play later when we are setting up the Main Configurable Product.
  • Values Required – set to Yes so that the customer will be forced to pick both a size and color for the shirt.
  • Use to Create Configurable Product - set to Yes so that this attribute will be included in the list of options for the Main Configurable Product.

After these options are set. Click on Manage Labels on the right-hand side.


Magento - Edit Product Attribute - Default Size - Manage Options

Set the titles:

  • Admin  - Uppercase name that will show in the Manage Admin screen under Attribute Label
  • Default Store View – Lowercase label that will show on the frontend product page.

Manage Options:
Since we selected this option as a dropdown, the options need to be defined by clicking on the Add Option button. The options cannot be empty

  • Admin  - Uppercase name that will show in the backend.
  • Default Store View – Lowercase dropdown option that will show on the frontend product page.
  • Position - Sort the dropdown. In this case small will show up before medium in the dropdown.
  • Is Default – Select the dropdown option that dropdown will automatically default to the selected option.

Now Click on the Save the Attribute button.

Repeat Step One for each attribute. In this case, I will repeat for the crispyshirtcolor attribute.

The new attributes should now be visible in the Manage Attribute screen. Now it is time to move onto Step 2 – Add the Attributes to an Attribute Set.
Magento - Manage Attributes for color, size, attribute code and label

 

Step 2 – Add the Attributes to an Attribute Set


Navigate to Catalog->Attributes->Manage Attribute Sets and click on the Add New Set Button in the top right corner.

In the next screen, add a new name and base this attribute off of Default.

Magento - Add the attributes to an attribute set in Magento for editing set name

Now Click on the Save the Attribute Set button.

At this point, the newly created attributes need to be added to the attribute set. The new attributes are located under Unassigned Attributes.

Click and drag the newly created attributes from Unassigned Attributes and place into Groups. See screenshot below.

Click and drag attributes from unassigned attributes to groups

Now Click on the Save the Attribute Set button.

At this point, the new Attribute Set should appear in the Manage Attribute Sets screen. The next steps are to add the products and attach the attributes along with attribute sets.

Step – 3 Create Simple Products

Navigate to Catalog->Manage Products and locate the Add Product button.

Magento - Create new simple products by navigating to catalog and create product settings for attribute set and product type
Create Product Settings:

  • Attribute Set – Set this option to the new attribute set that we created in Step 2, Crispy Tee Shirts.
  • Product Type – Set this option  to Simple Product.

Click on the Continue button.

Now, the product’s configuration will be need to be setup in the General, Prices, Inventory, Categories sections in the left sidebar menu.

 

General Product Configuration Screenshot for Magento

 

Set the General Settings:

  • Name - the product name that will be used for all the Simple Products and the Main Configuration Product
  • Crispy Shirt Color and Crispy Size – each simple product will have a different option enabled. For the first simple product we will use the default dropdown options: white and medium.
  • Description – Enter a description of the product.
  • Short Description –  Enter a short description of the product.
  • SKU –  Enter a unique value for the SKU.
  • Weight – Enter a weight value
  • Status – Set this option to Enabled.
  • Visibility – Set to Not Visible Individually. This option is important so that the simple product does not show on the frontend. The product will hide inside the Main Configuration Product.

Next move onto the Prices section.
Prices section screenshot for Magento admin to add new product with prices

Set the Prices Settings:

  • Price – Set a price for the simple product.
  • Tax Class –  Set this value to the desired Tax Class, cannot leave blank in order to save the product.

Manage Inventory Screenshot for Magento commerce - quantity and stock availability

Setup Inventory Settings:

  • Qty –  Set a number of available products in stock.
  • Stock Availability – Set to In Stock so that the product is available.

Click on the Save button to save the product.
The product should now be added to the Manage Product screen.

So now, the other simple products need to be setup with the alternate options:

  • 1 Simple Product – small/white
  • 1 Simple Product – small/red
  • 1 Simple Product – medium/white – Created
  • 1 Simple Product – medium/red

In order to easily setup the alternate simple products. Click on the first simple product and in the Product Information screen, locate the Duplicate button.

A duplicate of the medium/white option will be created. Change the attribute options to medium/red and change the Status to Enabled. Keep everything the same, except for Description, Short Description, and SKU in the General Settings. Go through the Prices, Inventory, and Categories Setting to configure the product correctly.

Price Settings:
Be sure that a price and tax class are entered.

Inventory:
Be sure that a value is assigned to Qty and set the Stock Availability to In Stock.

Categories:
Add the product to the correct categories.

At this point, if everything is setup. Click on the Save button.
Repeat the duplication process for each attribute option.

All the following Simple Products should be created:

  • 1 Simple Product – small/white – Created
  • 1 Simple Product – small/red – Created
  • 1 Simple Product – medium/white – Created
  • 1 Simple Product – medium/red – Created

The last step is to create the Main Configurable Product. This product will be visible on the frontend and will contain all of the simple products.

Step 4 – Create Main Configurable Product

First, copy the name of the product from the simple products that we created. In this scenario all 5 products will have the name Nash Shirt.

Add a new product from the Manage Product screen.

Magento Screenshot - Create Main Configurable Product - attribute set and product type
Configure the Create Product Settings:

  • Attribute Set – Set to the same attribute set as the simple products, in this case, Crispy Tee Shirts.
  • Product Type – Set to Configurable Product. This option is setting up the Main Configurable Product.

Click Continue.

New Product Settings in Magento - Attribute Set and Product Type


Since we setup our attributes to Global, Dropdown, and to use with the Main Configurable Product, the options/attributes will be available. Enable both attributes.

Magento Screenshot - set new product general infomation, including name, description SKU and status

Set the General Settings:

  • Name - the product name that will be used for Main Configuration Product.
  • Description – Enter a description of the product.
  • Short Description –  Enter a short description of the product.
  • SKU –  Enter a unique value for the SKU.
  • Weight – Enter a weight value.
  • Status – Set this to Enabled.
  • Visibility- Set this to Catalog, Search so that it is visible in the frontend and included in the search.

Next move onto the Prices section.
Magento Screenshot - Set Price in New Product Screen

Set the Prices Settings:

  • Price – Set a price for the simple product.
  • Tax Class –  Set this value to the desired Tax Class, cannot leave blank in order to save the product.

Next Add the images for the main configurable product

Price and Tax Class - Thumbnails for Magento Product - Magento Screenshot

Use the Browse Files and Upload Files buttons to add the image.
Set an image Base Image, Small Image, and Thumbnail.
In this case, I only added one image, however multiple images can be added.

Next set the Inventory Settings:
New Product - Set Inventory Settings
Stock Availability - Set the Main Configurable Product to In Stock.

Next set the Categories for the Main Configurable Product.
Magento - New Product Category

Now the Simple Products need to be added to the Main Configurable Product.  To assign the Simple Products, navigate to the Associated Products in the left sidebar Product Information menu.

Magento Configurable Product - Simple Product with Associated Product Information Screenshot

Use the top portion to add a different price for specific options.
Add all of the Simple Products.
Click Save.

Navigate to the Main Configurable Product in a web browser.

See the Main Configurable Product in the Web Browser - Screenshot of Magento Storefront

The attributes/options will now be required before the customer adds the product to the cart.

Conclusion – Magento Configurable Products:

Once the entire is process has been completed. Magento makes it very easy for you to reuse attribute sets. In the scenario above, assume that the Crispy Tee now comes in blue and xsmall.

To accommodate for this change, the blue and xsmall features would be added to the dropdown for each existing attribute as follows: (Step 1)
1. crispyshirtsize – xsmall
2. crispyshirtcolor – blue

Next a simple product would need to be added similar to Step 3. Finally, the simple product would need to be included in the Associated Products in the Main Configurable Product.

Alternately, if you did not want to offer a small/white any longer. Then you would disassociate that simple product from the Associated Products in the Main Configurable Product.

Questions? Need help with your Magento site? Call us – 303.473.4400 or visit here to have a real person contact you now >>

Oct 11, 2012

7 Tips to Get Your Magento Website Ready for the Holidays: Payment Methods

Customer Paradigm

Did you know that 12% of eCommerce transactions in the US use PayPal? One of the key tips for making sure your website will perform properly for the upcoming holidays is making sure that you have all of the payment options installed that customers expect. Read more below >>

7 Tips to Get Your Website Ready for the Holidays:
Payment Methods

I’m sure your eCommerce site accepts credit cards. Visa, Mastercard and Amex are the top three.

But do you also accept PayPal? As well as PayPal Express Checkout? If not, you might be missing out on a big customer segment.

Standard Credit Card Checkout:

A user goes through the standard checkout process, and adds their shipping and billing address, as well as their credit card information into the secure form. Payment happens in the background, and is transparent to the end user.

PayPal:
PayPal: Standard PayPal transactions work when someone goes through your shopping cart, and at the end (after filling in their shipping information), they click on a button to pay via PayPal. The user is then taken to a PayPal login page, where the user can login with their email address and password. The user can then select payment options (such as paying via a bank account or a credit card). To confirm the order, the user is usually redirected back to the original site, and clicks to confirm that the order is valid.

PayPal Express Checkout:
Instead of giving the site all of your information (i.e. your email address, billing address, shipping address and payment information), they click on a link on the cart page to go to the PayPal Express Checkout link. Then, the user is taken to a PayPal login page, and PayPal then sends the required information over to the Website, so that the user doesn’t have to fill it out. PayPal Express Checkout requires a bit of additional integration and testing, but it makes it quick, fast and easy for a customer to part with their money and place an order.

Payment Options Not to Worry About:

– Google Checkout. The only reason to do this used to be that you were able to get a special icon next to your CPC advertisements. But hardly anyone is using Google Checkout these days, and it’s one more thing that can go wrong with your site.

– Pay By Check. Most customers are wary (and rightly so) about giving out their checking account information to a website. Again, unless your site is doing hundreds of orders a day, don’t worry about this.

– Bill Me Later. If your site has really high-dollar ticket items, this might be worthwhile to explore. But if your average order is $25, you probably don’t want to pay the finance charges for small ticket amounts.

– Foreign Credit Cards. If you do a lot of business in a specific country (i.e. Brazil or China), then go ahead and put in a payment method specific to that country. However, most people placing an order on an international site are happy to pay via Visa or MasterCard.

I hope this was helpful… Are you getting your site ready for the busy holiday season?

Talk to you soon!

Thanks,

Jeff FinkelsteinFounder, Customer Paradigm
Jeff Finkelstein
Founder, Customer Paradigm

303.473.4400


We love referrals! Our Referral Promise >>


 

Customer Paradigm
5353 Manhattan Circle, Suite 103
Boulder, Colorado 80303
Visit our Website
direct 303.499.9318
fax 303.374.6104
toll free 888.772.0777
Web & Print Design • Programming • Email Newsletters • Search Engine Marketing • eCommerce
Sep 18, 2012

Update on Site Load Speed – 96% Increase in Website Load Time

Customer Paradigm
888.772.0777
303.473.4400

A quick follow up on last week’s Godaddy DNS server incident: according to an article in the New York Times, Godaddy claims the outage occured due to an internal network error (and not a hack or attack). Godaddy hosts five million websites and manages 53 million domain names.

And in a follow-up to the previous week’s Site Load Speed Test article, one company took us up on helping them speed up their site.

96% Website Speed Increase: 60 seconds –> 2.17 seconds.

Before, the site TVPartsOutlet.com took more than 60 seconds to load. (The test times out after 60 seconds, and the test shows that not all of the content of the home page was loaded.)

TV Parts Outlet - 60 second load time

We helped move TV Parts Outlet to a new hosting account on Nexcess – a web hosting provider based in Michigan.

The results speak for themself:

TV Parts Outlet - Fast Load Time

A couple of notes to help you understand how what this report means.

Slow Hosting Company.
The first report was run on Wed, Sep 12, 2012 at a data center in Dallas, Texas. There were 72 requests on the home page (each image, CSS file, javascript is it’s own request). After 60 seconds, the system had only downloaded 480 kb of data. You’ll notice that the mini-screenshot of the home page has a big black box on it where a piece of content did not load. On the older server, the site was slower than 96% of all tested websites. Again, the load test timed out after a full minute.

Faster Hosting Company.
The second report was run one day later on Thursday, Sep 13, 2012 from the same data center. There were 73 total requests — one more than the slower server (we assume that one request didn’t load). Simply moving over to a new, faster and more reliable hosting company allowed the site to load in 2.17 seconds. The total page size was 923.4 kb – almost double the amount of content that was downloaded from the slower server.

Yes, this is an extreme example — it’s not often we see a 96% increase in speed from simply moving a site from one hosting company to the next. (We didn’t do anything else to the overall site.)

Let us know if you`d like us to test out your site, or help install page caching to create quicker page load times.

Talk to you soon!

Thanks,

Jeff FinkelsteinFounder, Customer Paradigm
Jeff Finkelstein
Founder, Customer Paradigm

303.473.4400

Connect Via Facebook >>
Connect Via Google+ >>
Connect Via Linked In >>
Connect Via Twitter >>

We love referrals! Our Referral Promise >>

Customer Paradigm
5353 Manhattan Circle, Suite 103
Boulder, Colorado 80303
Visit our Website
direct 303.473.4400
fax 303.374.6104
toll free 888.772.0777
 
Web & Print Design • Programming • Email Newsletters • Search Engine Marketing • eCommerce
Jul 6, 2012

Critical Magento Security Update – Zend Vulnerability

There is an important security update for any company using Magento; this was posted yesterday (July 5, 2012) to Magento`s blog.

Magento uses the Zend Platform; the vulnerability is in the Zend software.

The Issue: The vulnerability potentially allows an attacker to read any file on the web server where the Zend XMLRPC functionality is enabled. This might include password files, configuration files, and possibly even databases if they are stored on the same machine as the Magento web server.

Summary: We`re not trying to scare you, but it`s really not very good if you don`t apply this patch. An atacker could access all of your customer`s information, your admin functionality, and gain complete access to your site. They could delete all of your products, customers, change pricing. It wouldn`t be pretty.

What Should You Do:
a. Patch it
b. Put in a workaround until it`s patched.

If you`d like us to take care of this for you, we can fix this for you in one hour of billable time (we just need FTP access).  Call 303.473.4400 or visit here to have someone contact you now >>



Technical Details About the Magento Local File Inclusion (LFI) security vulnerability:

The attack is called local file inclusion (LFI) and essentially it allows a hacker to read any file on the server. At a high level, here’s what happens:

 

  1. Someone connects to your Magento installation’s Web API. Great, you think to yourself “I’m checking login/passwords, so I won’t give them anything they don’t have access to. And even if they do have access, I’ll only allow them certain actions (getting orders, creating products, etc)
  2. Your api reads the request using zend framework
  3. Zend framework uses a PHP xml library
  4. You send a response back saying “Sorry, you don’t have access to my api” or “Ok, you just updated your product description”
  5. But little do you know, you also sent back the entire password file! Now your hacker owns the server!!

 

Here’s an example XML request the hacker might send:

<?xml version=”1.0″?>

<!DOCTYPE api_username [<!ENTITY my_api_username SYSTEM "php://filter/read=convert.base64-encode/resource=/etc/passwd">]>

… XML REQUEST …

<api_username>&my_api_username</api_username>

….The rest of the request

 

So, assuming they don’t have access (or they do, this really is just an example) your application might send something back like:

<?xml version=”1.0″?>

<message>Sorry, {insert_api_username_here} you don’t have access</message>

 

But where you just inserted the api username, you actually inserted the contents of the entire password file!

 

Luckily PHP provides us with an easy function to prevent this: http://php.net/manual/en/function.libxml-disable-entity-loader.php

The magento patch works by using this function in the appropriate places.

 

Need help applying this Magento Security Fix?  Call 303.473.4400 or visit here to have someone contact you now >>

Jun 16, 2012

Magento’s Newest Version – Community 1.7 and Enterprise 1.12

At the Imagine conference in Las Vegas Magento released the newest versions for both Community and Enterprise. The new releases are packed with great features, new technology and better security. As always we recommend that anyone who is using Magento Community 1.5 or earlier upgrade to version 1.7. If your website needs to be upgraded please give us a call at 888.772.0777 or 303.473.4400 for a quote.

Magento Community 1.7

There are tons of new features in Community 1.7 but I would say our favorite (and perhaps our client’s favorite) has been the Customer Group Pricing. This new feature allows you to easily create separate prices for products depending on the Customer Group. That means that you can set up pricing for your Wholesale, Retail and other Customer Groups right in the product page. Here’s a quick example:

How to set up customer group pricing in Magento

In this image you can see that all my regular customers would purchase the T-shirt for $10. While my Wholesale customers can purchase the T-Shirt for $5.99. Another great feature is that you can import all your Wholesale or other Customer Group Prices directly into Magento. So if you intent to upgrade and use this new feature it’s fairly easy to set up.

Next we love the new support for Mobile HTML 5  which makes it much easier to create a mobile friendly store. It’s out of box features are enough to get any site on it’s feet in the Mobile arena and should open up the door for cheap development for Mobile stores. Here’s a list of all the great new features:

  • Device-specific media capabilities for audio and video
  • User-friendly search and results display
  • Clean display of product detail pages
  • Pinch, multi-touch and scaling images
  • Easy swipe between product images
  • Zoom capabilities
  • Cross-sell and up-sell capabilities
  • Drag-and-drop of products to the shopping cart

Perhaps one of the most frequently requested features we get from clients is the ability to create coupon codes automatically. We used to give clients a list of extensions to choose from for this functionality, however now it’s built in. With Magento’s new Auto-generation of Coupon Codes you can now set up thousands of single use coupon codes for customers! To use this feature add a new rule in Magento and under Coupon select Specific Coupon. Now you’ll see a check box to use Auto Generation and once you save this rule you’ll have the option to generate multiple coupon codes that all follow that same rule.

How to Auto Generate Coupon Codes Magento

This is a life saver for anyone who wants to do promotional email campaigns.

 

Apr 26, 2012

Running Varnish Caching on Magento – but pages not updating

If you care about optimizing an eCommerce site, you know that page load times are critical.  For every second you shave off the time of a page load, conversions increase dramatically.

For every 1 second delay your page takes to load, you’ll see approximately 7% less conversions, and 11% fewer subsequent page views.

Our clients don’t usually call us to see if we can help speed up their page views.  Rather, we look at their sites, using advanced tools (some free, like Google Analytics), and see how long pages take to load, and what the conversion rates are.

If we speed up a page, it means (a) more business for the eCommerce Magento site, (b) a better experience for the end user (we save them time), and (c) the page tends to be ranked higher via Google and other search engines.

If you set up your Magento eCommerce site correctly with caching turned on well, it will scream.  Fast page load times – sub-one-second.  We’ve taken sites from 8-10 second page load times, and had them load in 1 or 1.5 seconds.

How?  We use many techniques, but one is Varnish.

What is Varnish?

Varnish is a HTTP Accelerator (reverse proxy for technical folk). 

A HTTP Accelerator sits between your web server and other people’s web browsers, and creates copies of content normally served from the web server. This content can include anything from images, JavaScript files, swf files, HTML files, to dynamically generated content.

How does Varnish benefit someone running Magento?

Magento varies in the amount of resources it consumes, suffice it to say Magento is more resource hungry than most PHP apps.

For this reason Magento has many types of caching built into it (you can see these in your admin panel).

These caches can help quite a bit, but there is still more you can do.

The overhead of loading the actual Magento core to start utilizing these caches is one more component that we can eliminate with Varnish.

For the following cases:
•    First time users to your site
•    Users that are not logged in
•    Users that do have items in their carts

There may be no reason to have Magento load more than once.

Why is that? In the cases listed above Magento may not render any differently for different users.

Because of this we only need to let Magento once per page, from there Varnish will keep a static copy of the content so that PHP, Mysql, and Magento do not need to run in the future.

This saves system resources, and just as important it significantly lowers your First Byte Time.

Your users will be waiting less for the page to load, and Google will love you!

So you may be asking what about when I do not meet the criteria listed above.

In those cases you will need to let Magento run as it normally would, this is because we want each user to have a unique experience based on their interactions with the site (i.e. if a user adds a product to the cart, it needs to be shown to them in the header as it normally would).

In these cases however,  users still benefit from Varnish since the system is not working as hard as it normally would, and can serve those users faster.

The problem with Varnish: When You Add New Products, Edit Products, Edit Categories or CMS Pages:

Why is the Customer Paradigm Magento Varnish Extension needed to run Varnish on my Magento site?

The Customer Paradigm Magento Varnish Extension takes a lot of the headache out of running Varnish, it automates many of the tasks needed to keep the Varnish Cache in sync with the actual Magento install.

For instance, if you did not have the Customer Paradigm Magento Varnish Extension , and updated a product from the Magento Admin Panel, your updates would not be reflected on the frontend until your restarted Varnish, thus reducing the effectiveness of Varnish.

With the Customer Paradigm Magento Varnish Extension , all changes to Categories, Product, and CMS pages are kept in sync.

It does this without ever needing to clear the entire Varnish cache, thus keeping most of your Magento site fast.

Customer Paradigm’s Magento Varnish Extension also provides methods to flush the entire cache, or to disable the cache for certain parts of your site. This is very useful for people that may not manage their server infrastructure directly.

What the Customer Paradigm Magento Varnish Extension Does:

•    Lowers the amount of time needed to setup a Varnish Cache.
•    Syncs Varnish with Magento’s Catalog Search, Catagories, Products, and CMS pages.
•    Adds debugging features to the Magento Admin panel.

Requirements:
•    Magento 1.5 +
•    Varnish 3.0.0

 

Results:

Non-Varnish results (3 users):

SIEGE 2.70

** Preparing 3 concurrent users for battle.

The server is now under siege…

 

Lifting the server siege…-done.

Transactions:                    23 hits

Availability:                100.00 %

Elapsed time:                 14.57 secs

Data transferred:              0.13 MB

Response time:                 1.38 secs

Transaction rate:              1.58 trans/sec

Throughput:                    0.01 MB/sec

Concurrency:                   2.19

Successful transactions:          23

Failed transactions:              0

Longest transaction:           1.87

Shortest transaction:          0.89

 

 

 

Varnish results (1st run ie. Not in cache)

SIEGE 2.70
** Preparing 3 concurrent users for battle.
The server is now under siege...

Lifting the server siege...-done.
Transactions:                    33 hits
Availability:                100.00 %
Elapsed time:                 14.76 secs
Data transferred:              0.19 MB
Response time:                 0.71 secs
Transaction rate:              2.24 trans/sec
Throughput:                    0.01 MB/sec
Concurrency:                   1.59
Successful transactions:          33
Failed transactions:              0
Longest transaction:           1.52
Shortest transaction:          0.01

Varnish results (2nd run cache is loaded):

SIEGE 2.70
** Preparing 3 concurrent users for battle.
The server is now under siege...

Lifting the server siege...-done.
Transactions:                    48 hits
Availability:                100.00 %
Elapsed time:                 14.04 secs
Data transferred:              0.27 MB
Response time:                 0.36 secs
Transaction rate:              3.42 trans/sec
Throughput:                    0.02 MB/sec
Concurrency:                   1.25
Successful transactions:          48
Failed transactions:              0
Longest transaction:           1.96
Shortest transaction:          0.00

Want the Extension?

This extension is currently being submitted to Magento Connect, but if you’d like to get a copy before it’s available there, please call us at 303.473.4400 or click here to have someone contact you now >>

Jan 10, 2012

Quick Magento MySQL Query for Tax Forms

Quick Magento MySQL Query for Tax Forms Recently one of our clients tried running the Tax Report in Magento under Reports -> Sales -> Tax for the last year. Unfortunately the company that had originally set up her site did not have her tax setting configured correctly! So as it turned out she had never collected tax for any of the orders in her State. Luckily thought we we’re able to come up with a quick MySQL query to run on her database that could extract these orders and their totals for us. Her store is located in Michigan so we need to pull out all the orders with the state abbreviation ”MI”. If you need to run this query on your own database simply replace the two “MI”s with your state’s abbrevation.

Here’s the query:

select s.entity_id as order_number, s.base_grand_total, s.shipping_amount, s.base_shipping_amount, s.base_subtotal, br.code as billing_state, ar.code as shipping_state from sales_flat_order s left join customer_address_entity_int b on s.billing_address_id = b.entity_id and 28 = b.attribute_id left join directory_country_region br on b.`value` = br.region_id left join customer_address_entity_int a on s.shipping_address_id = a.entity_id and 28 = a.attribute_id left join directory_country_region ar on a.`value` = ar.region_id where br.code = ‘MI’ or ar.code = ‘MI’

Note that this was done on Magento ver. 1.4.1.1, some modifications may be necessary for other version of Magento.

Oct 6, 2011

So You’ve Installed Magento… Now what?

So you’ve installed Magento on your server and your ready to start developing your new store, but your not quite sure where to start. You know you don’t want Google to index your site until it’s ready to go live and you know you will need to configure some initial settings in the system, but exactly what should you do? Here are my steps to configuring your new Magento store for development, once your are ready to go live a couple things will need to be changed back. The things that will need to be turned back on are in BOLD.

Theme

To start it’s always easiest to pick an existing Magento theme and install it by uploading the app, skin and media folders your root directory. You should merge these files and if necessary you may need to overwrite some files. Once you have uploaded the theme log in to your backend of your Magento Administration and go to “System”→ “Configuration “→”Design”. Open the “Themes” tab, then enter the identifier of the theme you are setting up (for example: hellocanvas) in the fields: “Templates” , “Skin (Images / CSS)” , “Layout” , “Default” , and then click “Save Config”.

General Maintenance

Clear out the Messages Inbox: System → Notifications. Then Select All and Actions: Mark As Read and Submit.

Go to System  → Index Management, and reindex all of the indexes.

Disable the Cache in System → Cache Management

Finally update all the Configurations, go to System → Configuration

Under General

Update with Locale Options and Store Information.

In Web update Unsecure and Secure Base URLs to be your store’s URL, if you are developing on a development domain you will need to update these URLs when your store goes live.

In Design update your HTML Headers, and make sure Default Robots is set to “NOINDEX, NOFOLLOW”

Then update information in Header and Footer to reflect your business.

In Store Email Addresses update with correct emails for your business.

In Contacts update the Email options with the correct email.

Under Catalog

Catalog go to Frontend and use Flat Catalog Category and Use Flat Catalog Product to Yes.

Under Inventory

If you are not using Magento to manage your inventory then under Product Stock Options change Manage Stock to No. Otherwise leave as is you will update your inventory for products in each individual product’s page.

Under Sales

In Sales, update the invoice and Packing slip with Address & logo.

In Tax, update Default Tax Destination Calculation with correct Country, State, and Zip.

In Shipping Settings, update Origin with address. In Shipping Methods make sure you set up at least one shipping method.

In Google API add your Google analytics account numeber.

In Payment Methods, set up your Authorize.net account or whatever other payment gateway is needed.

Disable Unused Modules, go to Advanced →Advanced.

Disable modules like Find_Feed, Newsletter, Polls, ect anything that won’t get used.

Changing out Logos

First get your logo, open up FTP and go to store/skin/frontend/theme and replace

i. Logo.gif

ii. Logo_email.gif

iii. Logo_print.gif

Next replace the “No Image” default pictures in catalog/products/placeholder/

i. Image.jpg

ii. Small_image.jpg

iii. Thumbnail.jpg

Removing Test Data

Go to CMS → Polls and delete the test poll Go to CMS → Static Blocks and remove or edit the Footer Links (if using a hello themes them you’ll need to replace with the supplied ones in the folder → staticblock) Go to CMS → Pages and remove or edit the About Us, Customer Service, and Home Page pages.

Finally go to System →Index Management and Reindex all your indexes.

When your website is ready to go live make sure you go back through and update your web URLs, Default Robots and remove the Demo Store Notice. I personally always make a list of settings I feel need to be updated when a Magento store goes live, this way I do not miss any and I highly suggest you do the same!

Jun 7, 2011

Magento: Adding a New Product

 

 

eLearning Series

by Magento: Adding a New Product – Part 1 To start log into your Magento Admin Panel and go to Catalog, Manage Products (See Below). Adding Product to Magento If you already have some products on your website you will now see a list of 20 most recent products. To add a new product you’ll want to click the “Add Product” button on the top right side of the screen. Now you can add custom types of products. However for this guide, we’re just going to be adding a simple product. So you will want to have “Attribute Set: Default” and “Product Type: Simple Product,” now just hit continue. Magento General Product Page This will bring you to the Product Edit page. Now we can start adding information about our product. Remember that any field with a * next to it is required, and you must have something in these fields before you can save (so it’s best to fill these in first). Here is a guide to what each field does and some recommendations of what you should include. Name: The name of the product. This will show up on your Magento store as the header of the product page and anywhere else where the product’s name occurs.
SKU: Product’s SKU, this can be numbers or letters, the SKU in Magento will need to match the SKUs in any other system you have (such as your CRM or Fulfillment Center).
Weight: The weight of the product (in just numbers) if your unsure just enter a 1 because this field is required. Usually this field is not very important unless you are using the weight of your products to determine S&H charges for your customers.
Status: Can be either Enabled or Disabled. This simply means that if the product is Disabled, it will not appear on the website (an easy way of taking down a product without deleting it).
Tax Class: This specifies if the product will have any tax added onto its price for the customer upon checkout. Usually it is best to select “Taxable Goods” if you are unsure.
URL key: This will be the product’s URL, Magento will generate this for you automatically if you leave the field blank (which is recommended for SEO purposes). If you need the product to be at a specific URL however, you can do this yourself. For example, if you want your product to show up at this URL www.mystore.com/my-product-name.html, then you will want to put “my-product-name” in this field.
Visibility: This determines how a customer can come across your product on your website. If you want people to be able to both search and find your product in categories then you’ll want this set at “Catalog, Search”. If you don’t want this product to be found unless you give someone a direct link to the product, then you can set it to “Not Visible Individually.”
Manufacturer: This would be the Brand or Maker of the product. You can add additional choices by going to Catalog, Attributes, Manage Attributes.
Color: If you want your product to show up with a different color theme, you can change that here. If you leave it blank, everything will show up with your default styling.
In feed: If you are displaying your products in a RSS feed you can change this to yes.
Magento General Product Page
Next up you’re going to configure your product’s pricing! So click on Prices on the left hand column. Price: This will be your product’s default price, in USD.
Cost: This is used for reporting purposes. The cost you enter in here will be subtracted from the Price to provide Magento with the “Profit” column in all reports.
Tier Price: Tier pricing can use used to change the price of your product for specific stores, customers and quantities. The “Price” here will be added onto the default price of the product. You can also use a negative sign before the price to discount the product.
Special Price: You can enter a special price to show that an product is on sale. Entering a lower price here than in the Price field will show up on your website below the regular price, with the regular price crossed out.
Special Price From and To: This field enables you to set dates for when the special price will be available. Once those dates are over, the products price will return to the default Price.
Is product available for purchase with Google Checkout? Selecting ‘Yes’ makes your product available on Google Checkout. Finally, click on Meta Information on the left. This is the information that search engines like Google will look at.
Meta Title: This will be the title of your product’s webpage. It is usually best to include the product’s name, brand, color, and any other features that might be relevant to this product.
Meta Keywords: Your product’s keywords. This has become less essential now that fewer search engines actually use meta keywords in their algorithms.
Meta Descriptions: Your product’s general description. This is what should appear below your product’s Title in search results. Now it’s time to time to make your product look good on your website. To start find them image of your product that you would like to use on your computer. It is always best to make sure that this image is “optimized” for the web. Having an image that is too large (more than 300kb) will cause your website to load slowly and hurt conversions, but having a blurry or tiny image is just as bad! In general I like using images that are about 300x300px in size. If you need to show more detail in your image you can always multiple product images, just make sure your large image is not set as the Base Image in Magento. Now that you’ve chosen a nice image just go to Browse Files, find your image and then hit the Upload Files button. Once your images are uploaded you can choose which images are your Thumbnail, Small Image and Base Image. If you select all these for the same image Magento will automatically re-size the image to match. You should also Label your image with your product’s name. Now that your done with the basics, hit Save and Continue Edit. As long as you enabled your product you can also now see your new product on your website. As always go look at your product and make sure that everything is showing up correctly. Coming soon! Magento: Adding a New Product – Part 2