ZZZZZZZZZ The internet and other bits

15Apr/090

Add a percentage based fee to the shipping total in Zen-Cart’s UPS shipping module

The default UPS shipping module for zen-cart allows the store owner to add a flat rate "shipping and handling fee" to orders.  I wanted to add a percentage to the shipping total instead of a flat rate for every order.

Here is a short snippet which worked worked for me.

Edit includes/modules/shipping/ups.php

Find the line

  // EOF: UPS USPS
    $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes)

and replace it with:

  // EOF: UPS USPS
  // calculate order total less free shipping
        $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
        $percentage_added = $cost * .15;

        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => (($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes) + $percentage_added );

Update the percentage to whatever you need in this case I'm using 15%, see the .15

This should also be applicable to other shipping modules.

Tagged as: , No Comments
8Apr/090

Color scheme generators and tools

Here are a few useful tools for working with colors:

Pixie screen shot Pixie keystrokes

Pixie is a useful tool for finding out the color code of anything you mouse over. The application allows you to copy the current color's HTML code to the clipboard with CTRL + ALT + C. It also has a 'magnifier' ( CTRL + ALT + Z ) and a 'color mixer' ( CTRL + ALT + X ).  Get the pixie color picker here

Color scheme generators

http://colorschemedesigner.com/

Paste in code copied from Pixie and get color schemes, see analogic, complimentary, tertiary  colors and more.

Color Scheme Generator

kuler is a a neat utility for generating color schemes and features many inspirational color schemes.

There are many other color utilities out there, these are a few I enjoy using.