Image Handler 2 is a great addition to any Zen Cart install. Gone are the rather naïve, really old school "resized by the browser from much bigger images" images. instead, sensible, correctly proportioned and re-sized images are put in place.
A simple method for pulling Allowed Values for a CCK Select List field:
$sql = 'SELECT p.`partno` FROM {nrg_custom_monitor_part_numbers} p ORDER BY p.`partno`'; $result = db_query($sql); while($row = db_fetch_array($result)){ $rows[$row['partno']] = $row['partno']; } return $rows;
To fill an array from results of a database query you normally do something like this:
function get_monitor_models() { $sql = "SELECT title FROM {node} n WHERE n.type='dell_monitor_model' ORDER BY n.title"; $result = db_query($sql); $monitor_models = array(); while ($monitor_model = db_fetch_array($result)) { $monitor_models[] = $monitor_model; } return $monitor_models; }
I was looking for a solution to a Drupal Ubercart issue I was having, when I came across this gem:
This is a simple one - go to admin -> Comfiguration -> Images. Set the following:
Product Image - No Image Status: 0
Like most settings, the default header text "Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution." is in more than one location, although this time it is in the same file. Copy /includes/languages/english/index.php to /includes/languages/english/<your template>/index.php and edit lines 53 & 57.
To disable the IP address of the visitor from the bottom of the page, go to admin -> Configuration -> Layout Settings and set the following:
Footer - Show IP Address status: 0
Having signed up for a Reseller account over at Terra Networks, I found out that the Ensim Control Panel (or Parallels control Panel as it is now known as) automatically uses http://<sitename>/admin and http://<sitename>/user for it's administration URLs. This is a bit of a pain as they are the same as the Drupal URLs!
Sometimes you may need to add products which have no base price, but are priced by their attributes (e.g. takeaway dishes priced by the main ingredient). To do so, go to admin -> Catelog -> Categories/Products -> new product. Set the following:
Depending on the site and client, you may wish to remove the Add to Cart links from the product lists when browsing categories. You need to make two changes in admin -> Configuration -> Product Listing:
Display Product Add to Cart Button: 0 Display Multiple Products Qty Box Status and Set Button Location: 0