Fontis Ecommerce Blog: Commerce Advice and Insights

Extending the Magento web services API

by Peter Spiller in Magento

First of all, you need to find the Magento core file that provides the API method you want to extend. These are generally in model files called Api.php or under directories called Api. For example, I recently needed to look up customer orders by their IDs, as opposed to their increment IDs (aka their order numbers, such as '#100000003'). After some searching, I found the file that contains the relevant code at app/code/core/Mage/Sales/Model/Order/Api.php, in the _initOrder() method:

Read More

Direct SQL queries in Magento

by Chris Norton in Magento

This quick guide will explain how to properly access the Magento database using custom defined read and write connections following best practice, ensuring maintainability and better performance while future proofing your code.

Read More

Displaying Magento custom product attributes on the frontend

by Denis Margetic in Magento

The simplest way to display custom attributes is to enable them on product view pages, where they normally show up as a table. Design files can be edited to display custom product attributes elsewhere on the product view page. When a Magento product object gets loaded in a template file, any custom attributes that have been added to products are also accessible. The method used to retrieve the values depends on the type of attribute. For drop-down attributes you can use the following code:

Read More

Australia Day Extension Release

by Chris Norton in Announcements

In addition to the feed generators, there are some incremental improvements to the rest of the extension, most notably in the BPAY and direct deposit functionality, which now have their own order statuses to help administrators determine at a glance which payment method was used to place an order.

We hope these changes will continue to provide Australian online retailers with commonly desired functionality for running a Magento website in Australia. We've had great feedback on the extension so far, and are keen to hear any comments or suggestions that members of the community may have for future versions.

Read More

Using jQuery with Magento

by Tom Greenaway in Magento

Installing jQuery

jQuery can be downloaded from jquery.com and to install it you need to copy the file to the following directory:

skin/frontend/default/your_theme/js

To include jQuery you need to edit layout/page.xml where you need to add the following to the head block:

<action method="addItem"><type>skin_js</type><name>js/jquery.js</name></action>

Normally, this would be all you need to do, however because Magento also includes Prototype, there is a subtlety we need to deal with. jQuery uses '$' as shorthand for accessing the jQuery library. But Prototype also uses '$' to access itself. This causes a conflict in the global JavaScript namespace of the web browser. Fortunately jQuery provides a solution, the jQuery.noConflict(); function defines a new shorthand for jQuery, such as:

Read More

How to set up a Magento store for Australia

by Chris Norton in Magento

Looking for instructions for Magento 2? Take a look at the new post How to set up a Magento 2 store for Australia.

Running Magento stores in Australia differs very little from any other country, but there are a few things that you need to do for compliance with ATO requirements and to ensure that Magento calculates taxes correctly. The following is an outline of the necessary configuration and settings you may need to consider when setting up Magento for an Australian store.

Read More

Fontis reCAPTCHA 2.0

by Denis Margetic in Announcements

What's New

In addition to the usual bug fixes, we have added some great new features, such as:

  • New backend interface
  • reCAPTCHA on Product review form
  • New Magento-based reCAPTCHA theme
  • Multiple language support
  • Controller overriding redeveloped to minimise conflicts between different extensions

New backend interface

In the new version all reCAPTCHA related settings have been grouped into a single configuration area, which can be found in the Recaptcha section under a new Fontis Extensions tab. The screenshot below shows what settings can be adjusted.

Read More

Add product custom options

by Chris Norton in Magento

This quick guide will explain how to properly access the Magento database using custom defined read and write connections following best practice, ensuring maintainability and better performance while future proofing your code.

Read More

Alternative Magento category tree structure

by Denis Margetic in Magento

The underlying issue is that the 'Default Category' is not easily accessible in code. For example, the default top navigation in Magento uses the getStoreCategories() method to access all categories. But that method starts by returning the 'Default Category' child categories and never returns the 'Default Category' itself. A solution to this is to add a subcategory, such as 'Products', under the 'Default Category' so that we can effectively treat the 'Products' category as the root of the category tree. Adding a 'Products' category means that any subsequent categories need to be subcategories of the 'Products' category. With this change the top level navigation will only show the 'Products' category. A sample category tree is shown below.

Read More