• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Elias Interactive

We Grow Beautiful Websites

  • Blog
  • Show Search
Hide Search

Development

Sorting Data from Custom Fields in WordPress

Luke Whitson · Nov 17, 2009 · 9 Comments

With the redesign of the Ei Site, we wanted to take advantage of certain features native to WordPress, one of which was Custom Fields.

Having a custom web design based on the needs of your particular business and customers optimizes conversion rates of site visitors, a key aspect of growing your business and brand presence online

We wanted a simple way to display our client list using Custom Fields. Using built-in WordPress functions, it is pretty simple to pull information from Custom Fields. With Custom Field structure like this:

Name: client
Value: Name|Work_Done|Description|URL

You can use the get_post_meta() function to loop through all of the ‘client’ fields and pull the value for each and display to your page.

ORIGINAL CODE:

<?php
	$allOptions = get_post_meta($post->ID, 'client', false);
	if($allOptions) {

		foreach ($allOptions as $option) {
			$fullValue = explode ("|", $option);
			$name = $fullValue[0];
			$work = $fullValue[1];
			$text = $fullValue[2];
			$url = $fullValue[3];
		}

	}
?>

The problem comes if you want to control the way the output is displayed. The get_post_meta() function does not provide a SORT property. So in order to control the order of display, we simply added an additional component to the VALUE field, a ‘sort order’.

Name: client
Value: Sort|Name|Work_Done|Description|URL

Rather than just display the information in the initial foreach() loop, we stored the data into a new array, based on the SORT item for use later.

NEW CODE:

<?php
	$client_array = array();
	$allOptions = get_post_meta($post->ID, 'client', false);
	if($allOptions) {
		foreach ($allOptions as $option) {
			$fullValue = explode ("|", $option);
			$order = $fullValue[0];
			$client_array[$order] = $option;
		}
	}
	rsort($client_array, SORT_NUMERIC);
?>

With the data now stored in an sorted array, we can now loop through the new array and display the information in any order we want.

Scene7 Integration With Magento eCommerce

Lee Taylor · Jul 6, 2009 · 15 Comments

What: Straightforward overview on our approach for integrating Scene 7 with Magento eCommerce.

At ecombusinesshub offers a detailed look at dropshipping. You’ll learn what it is, how it works, and how to set up a dropshipping business.

Why: Because Magento rocks and Scene 7 rocks. Together, they can create an inspiring user experience!

Who: For the business who desires real interactivity, and for developers who desire to implement Scene 7 capabilities with Magento.

We recently were approach by a company who knew about Scene 7’s capabilities and they wanted their Magento store to do the following:

1. Replace all product and category images with Scene 7 composited images

2. Allow the user to “build” a custom product based off of product options, and reflect the user selections in the product image

3. Create a unique user experience in their Magento store and have a better understanding of the self service definition

Why could this be useful? Well, take a few minutes to learn more about what Scene 7 and Magento integration can do together. Soon, when the project is completed – we’ll have some examples to share.

What was our process in approaching this? Let me give a high-level outline our take on integrating the two systems.

First off, we looked at how we can utilize Scene 7 url’s instead of native Magento URLs. So we decided to override the catalog image helper so we could add custom functions to composite the appropriate URLs to build the image via a specified URL string.

Secondly, we interfaced this custom helper with the Scene 7 backend and some Javascript to build the desired product images. We did this by creating a function inside of the new helper to be able to do all URL string manipulation based off of product options changed by the user on the frontend.

Thirdly, we went through and determined every theme file that needed modifying to use the function that built the Scene 7 URLs and reflect the composited image.

As an overview, we took the following approach:

1. Created the right images in Scene 7 to use in correlation with Magento.

2. Created product options in Magento

3. Overlaid JS to the product options to be used as variables within our Helper function

4. Manipulated the URL string and returned the composited URL to build the product image (based off of the user-selected product options)

The site has yet to go live, though keep in touch with Elias updates and you will see the finished product.

New Mangeto Store Launch: Keramikos Kitchen

Eric Clark · Apr 20, 2009 · 4 Comments

We’re proud to announce our most recent Magento store launch for keramikoskitchen.com! They manufacture and sell high quality ceramic knives and needed an online store to introduce a new sales channel that compliments their home shows. Keramikos hired us to design and develop their new custom Magento store. Check it out and let us know what you think!

Keramikos Kitchen Magento Store
Keramikos Kitchen Magento Store

What Magento screencast would you like to see?

Eric Clark · Dec 15, 2008 · 11 Comments

We see a need for not just additional screencasts that communicate about Magento via visible media…but we want to produce screencasts that will cover Magento from every usability angle. Whether you’re an admin user, a designer, developer, or marketing guru – we want to create videos that make your life easier when working with Magento.

So, what screencasts would you like to see? Drop us a comment and let us know…

Route29.com – Client Showcase

Eric Clark · Oct 26, 2008 · 2 Comments

We recently completed a Magento project for Route29.com. They sell candy online using a Magento store and were in need of our development services on a tight timeframe. We were responsible for building out the design they supplied and some customization to meet their unique needs. Visit their site, check out our work…

Route29 Magento Store
Route29 Magento Store

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar

From the blog

Magento SVN Usage – Best Practices

How to Create Reusable Apple Mail Templates [video]

I’d rather buy from Harry Potter

The Ecommerce Solution You’ll Find Refreshing (drumroll)

Liberating Constraints

More Posts

Connect with us

  • Facebook
  • RSS
  • Twitter
Affiliate Disclaimer

© 2025 · Elias Interactive · Built on the Genesis Framework

  • Blog
  • Affiliate Disclaimer
  • Home