Work

Displaying Stock Quantities

Fred's picture

Although you might think that the following locations under admin -> configuration set the display of stock quantities, you'd be wrong:

product listing -> Display Product Quantity
new listing -> Display Product Quantity
featured listing -> Display Product Quantity
all listing -> Display Product Quantity

Not quite sure what the above actually affect yet (they must affect something, surely!) Go to admin -> catalog -> product types -> product general and change the setting for:

Changing Meta Tags

Fred's picture

To change the meta tags (including the title) edit the file at:

/includes/languages/english/meta-tags.php

Time and Date functions

Fred's picture

Drupal stores time information (such as created date, modified date, etc) in unix date format as int(11).
Using a simple statement:

SELECT n.`created` FROM node n

1225678626

FROM_UNIXTIME()

Formats the data as date & time:

SELECT FROM_UNIXTIME(n.created) FROM node n

2008-11-03 02:17:04

DATE()

Just the date:

SELECT DATE(FROM_UNIXTIME(n.created))  FROM node n

2008-11-03

Theming CCK Input Forms

Fred's picture

Theming CCK forms initially appears to be a bit of a black art, but is very simple. The simplest method is to add:

function phptemplate_node_form($form) {
  if(file_exists(path_to_theme().'/'.$form['type']['#value'].'_form.tpl.php')) {
    return _phptemplate_callback($form['type']['#value'].'_form', array('user' => $user, 'form' => $form));
  }
}

to either your theme's template.php, or to a custom module for greater portability. Then create a content_type_form.tpl.php in your theme folder.

Quick and Simple Tips

Fred's picture

The code design of Zen Cart is sometimes baffling, sometimes plain ugly and other times just plain WTF?! Even the most seemingly obvious task takes longer as there is no central location for themeing and for something that touts itself as "not for programmers", there is a hell of a lot of editing of obscure code files scattered throught the installation.
Here I have tried to note down some of the more common, or at least common to me, items I need to keep track of.

Zen Cart

Fred's picture

Zen Cart is a very popular shopping cart system forked from oscommerce. While the Zen Cart homepage claims that it is easy to install, configure and use, sometimes the method of changing options and features can be a little confusing. Whatever you do, don't get me started on their theming - it's not pretty.

The quest for a proper Search feature for The Missing List

Fred's picture

While Drupal is a fantastic piece of software, there is one area in which it is truly terrible - searching. The built-in search is barely able to search Title and Body fields, let alone CCK or custom fields. Ohh, and if you are looking for Bournemouth for example, Bourne, bourne*, etc wont work. You have to use the full word you are looking for.

Syndicate content