Skills on Display Orders of Zen-Cart.

Especially at the end of every month, we need to know how many orders we have. Here are 2 method you may like when you use Zen-Cart.

First, if you need to know certain latest new orders, say 2000, how to do then, you can use the following mysql command:
SELECT * FROM `orders` order by orders_id desc limit 0,2000;  //show latest orders;

Second is we can use the following mysql code to show all the products with a month, say display all products within March, 2012:

SELECT date_purchased, SUM(order_total) FROM `orders` where date_purchased between “2012-03-01” and “2012-03-30”;

For some phpmyadmin or mysql version, we need to use the followng code:

SELECT date_purchased, SUM(order_total) FROM orders where date_purchased between “2012-03-01” and “2012-03-31”;
If we need to know all orders in a year, say 2011, how to then? Simple:

SELECT date_purchased, SUM(order_total) FROM `orders` where date_purchased between “2011-01-01” and “2011-12-31”;

Here we can use SUM(order_total) to caculate total value within a period.

Show orders, not include unpaid and canceled orders within a month:

SELECT date_purchased, SUM(order_total) FROM orders where date_purchased between “2012-08-01” and “2012-08-31” and  order_status <> “1”  and order_status <> “9”

Posted in MySQL, Zen Cart. Comments Off on Skills on Display Orders of Zen-Cart. »

Skills on How to Show different Adsense Ads at WordPress

More and more people love to use wordpress to setup blogs and place adsense ads, and many people still love the use the theme of Classic, by Dave Shea. Can we show different adsense code at the same place, but different pages then? For example, we want to show 2 adsense block at the main body of detailed pages, but only show 1 adsense block at other page’s main body.
(more…)

Posted in Php Code, Php Skills, Php Study, WordPress. Comments Off on Skills on How to Show different Adsense Ads at WordPress »

How to change left width 2-columns skin of x-cart v4.5?

For our personal needs, we may need to change the left width of 2-columns skin of x-cart. At present, most users are using X-cart Gold V4.5.
Go to skin/2-columns/css, and open altskin.css, change:
#left-bar {
width: 207px;
margin-left: 0;
}
(more…)

Posted in X-Cart. Comments Off on How to change left width 2-columns skin of x-cart v4.5? »

How to Change php.ini of Dreamhost Web Hosting?

We usually edit .htaccess to achieve our special demands when we use the web hosting from dreamhost.com. But sometimes we have to modify php.ini to get better results, for example, we often meet the following error when we import posts to wordpress, especially we import more than 7MB files.

We usually have 3 methods to resolve such issures:
1, modify .htaccess;
2, modify wp-config.php;
I have tried these 2 methods for my dreamhost web hosting, failed.

The last one is using Custom PHP.INI auto-installer”, download it from sxi.sabrextreme.com/dh-phpini, upzip the file, and upload dh-phpini.php to your domain’s folder and open it in a browser. An editable php.ini will be created in the domain’s cgi-bin folder in a minute.

The author has thougt very carefully, after you run the code, dh-phpini.php will be deleted automatically.

Now you can edit php.ini under cgi-bin folder, for example, you can modify upload_max_filesize = 20M
to upload_max_filesize = 100M.

Posted in Web Hosting. Comments Off on How to Change php.ini of Dreamhost Web Hosting? »

Show Latest Testimonals at Zen-Cart Homepage

Sometimes we like to show several latest customers testimonals at zen-cart based shopping cart homepage. How to do then? Here are my method, let me share the code with you.

Go go to includes/modules, and open left_column.php, add the following code: <code><? $sql = “select  * from pres_testimonials where status = 1 order by id DESC limit 3”; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { echo “<strong>”.$row[name].”</strong>”; echo $row[detail]; (more…)

Posted in Zen Cart. Comments Off on Show Latest Testimonals at Zen-Cart Homepage »

How to Add Extra Text at X-cart Product Name?

There are several places need to modify to add extra text at X-cart Product Name.

1. For Products at X-cart Homepage and Detailed Category Page:
Go to /2-columns/customer/main/products_t.tpl, and change
{$current_category.category} {$product.product|amp}
to:
{if $main eq "catalog" && $current_category.category eq ""}
Cheap Eyeglasses {$product.product|amp}
{elseif $main eq "catalog" && $current_category.category ne ""}
{$current_category.category} {$product.product|amp}
{/if}

(more…)

Posted in X-Cart. Comments Off on How to Add Extra Text at X-cart Product Name? »

How to Remove the Website Field of WordPress From the Comment Form?

We found so many spammers try to leave their url in the field of Website, and use Name as their keywords. How to prevent the spammers doing so then? For example, how to prevent them to leave thir url? Let me share my tips with you. (more…)

Posted in WordPress. Comments Off on How to Remove the Website Field of WordPress From the Comment Form? »

Enable ajax to Deal with Time Out Issues

If you have thousands categories and you do not enable ajax, you will often meet time out issues, such as:
Fatal error: Maximum execution time of 30 seconds exceeded in ****include/functions.php on line XXX

How to deal with this then? Here let me share my tip with you. (more…)

Posted in PHP Link Directory. Comments Off on Enable ajax to Deal with Time Out Issues »

How to change x-cart v4.4.4 Admin Title?

When we visit our X-Cart shopping cart admin panel, the defaul words between and is X-CART. Powerful PHP shopping cart software. How can we change these words to meet our needs then?

There are 2 methods: (more…)

Posted in X-Cart. Comments Off on How to change x-cart v4.4.4 Admin Title? »

Chang X-cart Detailed Product Page Product Thumbnail Place

As we know, at x-cart 2 colomns template, product thumbnail of detailed product page is at the left.

How can we change the Product Thumbnai to center, and at the same time, remove the default left space?

Remove the Detailed Product Page Product Thumbnail Place:
1. open skin/common_files/customer/main/product.tpl, delete the following code: (more…)

Posted in X-Cart. Comments Off on Chang X-cart Detailed Product Page Product Thumbnail Place »
King Php Science Designed by:KingPhp.com Welcome, you are from: 216.244.66.200