latest from the cornerpiece blog

website design & development funding

NEESPRBusiness LinkWe are extremely please to announce that cornerpiece are now listed on the North East England Service Provider Register (NEESPR). Not only that, but on the basis of our references from previous clients, we have been awarded a 5 Star Rating!. Thanks guys for your kind words.

what does that have to do with funding?

Well Business Link, who can help both new startups and existing companies obtain funding of up to 70% of project costs (depending on the purpose of the project), can only refer clients to service providers that are listed on the NEESPR. Being listed now means that we can work together with both Business Link and our clients to obtain funding for branding and corporate identity, web design & development, e-commerce and e-marketing projects. In addition, we will also be referred to new clients who have gone to Business Link directly. Check out our funding page for more information.

1st October 2009 by Geoff Ford in cornerpiece news

zen cart: how to add new product fields

I posted an article on the zen cart forums earlier this year which has proved quite popular with developers wishing to create additional product fields to expand on or separate their product information. As it seems to have been some use to others I thought I would share it with you here.

After searching through the zen cart forums for help on how to add new product fields, I came across a thread started by crazy_chris which shows how to add a new field to the existing products table. Later in that thread zskiman shows how to add fields into a separate table, which is a great idea to future proof your efforts for later upgrades etc. My intention here is to share what I have learned from both these posts and add my own input which I think simplifies the end usage of your new fields.

Any changes to existing code or completely new code are shown in red (watch out for , too).

So lets gets started...

  1. Create a new table to hold your additional fields and give it a name i.e. products_extra_stuff and add the products_id field (so we can relate our new table to the existing products table) and whatever fields you wish to add i.e. products_colour

  2. Open includes/database_tables.php and add your new table to the list of definitions i.e.define('TABLE_PRODUCTS_EXTRA_STUFF', DB_PREFIX . 'products_extra_stuff');

  3. Open admin/includes/modules/product/preview_info.php and change the following lines:

    (line 26 for me)
    p.products_sort_order, pdex.products_colour
    where p.products_id = pd.products_id and p.products_id = pdex.products_id

  4. Open admin/includes/modules/product/collect_info.php and change the following lines :

    (line 12 for me)
    $parameters = array('products_name' => '',
    'products_description' => '',

    'master_categories_id' => '',
    'products_colour' => ''


    (now line 60 for me after the above edit)
    p.products_price_sorter, p.master_categories_id, pdex.products_colour
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .

    where p.products_id = '" . (int)$_GET['pID'] . "'
    and p.products_id = pd.products_id and p.products_id = pdex.products_id

  5. In the same file (collect_info.php) insert your form fields to collect your new data along with the rest:

    (line 305 for me as I wanted to insert just below product name)
    <!-- BOF - Additional field added -->
    <td class="main"><?php echo 'Colour '; ?></td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '13') . '&nbsp;' .
    zen_draw_input_field('products_colour', $pInfo->products_colour, zen_set_field_length(TABLE_PRODUCTS_EXTRA_STUFF, 'products_colour')); ?></td>
    <!-- EOF - Additional field added -->

  6. Open admin/includes/modules/update_product.php and add the following lines to process both new products and the editing of existing ones:

    (line 153 for me)
    ////////////// MY ADDED FIELDS ////////////////////
    $sql_data_array = array('products_colour' => zen_db_prepare_input($_POST['products_colour']));

    if ($action == 'insert_product') {
    $insert_sql_data = array('products_id' => $products_id);

    $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

    zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array);
    } elseif ($action == 'update_product') {
    zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");

  7. In order to make the data from your new field(s) available to add to the product page open inludes/modules/pages/product_info/main_template_vars.php and change the following lines:

    (line 55 for me)
    p.products_discount_type, p.products_discount_type_from, p.products_sort_order,
    p.products_price_sorter, pdex.products_colour
    where p.products_status = '1'
    and p.products_id = '" . (int)$_GET['products_id'] . "'
    and pd.products_id = p.products_id and p.products_id = pdex.products_id

    (line 101 for me amongst products name, model and description)
    $products_colour = $product_info->fields['products_colour'];

  8. To display the data from your new field(s) open includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php and add something similar to the following:

    (place wherever you wish your new field to be displayed)
    <!--bof Product Colour -->
    if ($products_colour != '') {
    <div id="productColour" class="productGeneral"><strong>Colour: </strong><?php echo $products_colour; ?></div>
    <!--eof Product Colour -->
  9. We also need to ensure the extra fields are deleted from the products_extra_stuff table when we delete a product. Open admin/includes/functions/general.php and search for 'function zen_remove_product' (line 1203 for me)
  10. At the end of that function and just after the following code:

    $db->Execute("delete from " .
    where products_id = '" . (int)$product_id . "'");

    (line 1276 for me)

    Add the following on a new line:

    $db->Execute("delete from " .
    where products_id = '" . (int)$product_id . "'");

    Make sure you add this before the closing '}' of the function (line 1279 for me before the edit).
  11. And finally, if you already have products in your products table, we need to create a matching record for each in the new table. If you miss this step you will find that when you edit existing products and add a value to your new field, it won't be saved! You can only skip this step if you don't have any products in your products table yet i.e. a new installation.

    In phpmyadmin or mysql command line, enter one of the following queries:

    For a default value:
    INSERT products_extra_stuff (products_id, products_colour) SELECT products_id, 'your default value here' FROM products

    For no default value:
    INSERT products_extra_stuff (products_id, products_colour) SELECT products_id, '' FROM products

If you made it through that little lot then you should now be the proud owner of at least one new product field. Look out for more zen cart tips from cornerpiece in the future.

25th August 2009 by Geoff Ford in web design & development news

zen cart security patch

Zen CartThe recent discovery of a security vulnerability in Zen Cart has prompted the release of a patch from the Zen Cart community to fix the issue. Although an attacker must know the location of your admin folder (note: it is always recommended to change the name/location of your admin folder to one of your own preference), security through obscurity does not provide sufficient security on it's own.

It is recommended that all webmasters of Zen Cart websites download and install the patch. Check out the Zen Cart forums for more information.

6th July 2009 by Geoff Ford in web design & development news

printing services now available

printing servicesSorry for the lack of blog posts since the launch of the new website but we have been extremely busy. We hope to add regular posts in the near future full of tips and tricks.

One thing that came to light over the last few busy months was that there was a need to offer printing services to our clients. More often than not we design all the artwork for our clients websites and in many cases the company logo. Previously clients had to research and source printers, then request the artwork from ourselves to send to the printers, and then chase up the different printers themselves. It was therefore an easy decision to offer our own printing services to simplify the whole process for our clients.

Via our print partners (these are printers we have already worked with and know we can trust to produce a high quality finished product) cornerpiece can now offer a variety of printing services for everything from business cards and stationary to banners, signage and vehicle graphics!

That's one thing less for you to worry about.

2nd July 2009 by Geoff Ford in cornerpiece news

welcome to the new cornerpiece website & blog

new websiteWelcome to the shiny brand new cornerpiece website. We have tried to give a complete picture of the web design and development services we offer here at cornerpiece from e-commerce, content management and blog design to search engine optimisation and social media optimisation.

Check out our portfolio for examples of our work on previous projects and for testimonials from our clients.

With the inclusion of this blog, we also hope to keep you up to date with all the latest news and happenings at cornerpiece and also anything significant within the world of web design and development.

Please contact us if you have any feedback or suggestions for the new website, or if you have any questions regarding our services.

31st March 2009 by Geoff Ford in cornerpiece news