November 2006

ZenCart Orders Total Weight Query

by damonp on November 29, 2006

in Snippets,SQL

SELECT op.products_quantity * SUM( products_weight )
FROM products p
JOIN orders_products op
WHERE p.products_id
IN (
SELECT products_id
FROM orders_products
WHERE orders_id = 'ORDER_ID'
)
AND op.orders_id = 'ORDER_ID'

Replace ORDER_ID with the orders_id in question.

Requires MySQL 4.1 or better for subselect support

Popularity: 1%

{ 2 comments }

ZenCart Inventory Report

by damonp on November 29, 2006

in Ecommerce,PHP,Software

Here’s a simple admin report for ZenCart that will generate an inventory report with per product totals and a report total. The report may be paginated or generated over the whole catalog.

The report was created by modifying the ZenCart default Products Viewed report. It was created from the ZenCart v1.2x source but has been installed on v1.3x versions. This is the first release, so any problems please comment below.

In future updates, I would like to allow for CSV export as well as reporting by category.

To install, simply unzip and upload to your main ZenCart install directory.


ZenCart Inventory Report

View all releaseas

Popularity: 3%

{ 7 comments }

Virtual IPs Under OSX

14 November 2006

To add a virtual loopback address: sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.0.0

Read the full article →

iTerm and Growl

13 November 2006

Recent versions of iTerm support Growl notifications. iTerm shows how to initiate Growl events from the command line with: make; echo $’\e]9;make done\007′ The example shows how to get an alert after a long make. I know I would never remember that command so I wrote a little Bash user defined function to do the [...]

Read the full article →

Chkrootkit Grep

9 November 2006

chkrootkit bindshell | grep "INFECTED\|Vulnerable"

Read the full article →

ZenCart Reports Search Function

9 November 2006

The ZenCart default reports are sufficient for most uses, but with many products pages of results are a pain to look through. Adding a search is pretty simple. The example below adds a search to the products purchased report: Add the search box and form: admin/stats_products_purchased.php Line ~#64 BEFORE: </table></td> </tr> <tr> <td><table border="0" width="100%" [...]

Read the full article →

Grep OR Operator

9 November 2006

I always forget this… php -i | grep "Zend\|Cube"

Read the full article →

RPM Remove Shortcut

6 November 2006

rpm -e `rpm -q appname`

Read the full article →