Category Archives: Programming

Not receive order notification in CS-Cart

Tested the CS-Cart check out function, everything went well when I placed a order myself. And I also received an email from the system with the order information. But the email I used as the orders department did not receive the order notification from CS-Cart.

I spent (and wasted) a lot of time to do the trouble shooting on the issue above. Even I contacted the host provider to see if the email system blocked the emails generated from the CS-Cart code. But the solution actually was simply as the below.

Go to the back-end admin control panel of CS-Cart, click the “Orders” top menu item and then “Order Statuses“. On the new page, click “Edit” or click the “Open” status directly, and check the “Notify orders department” on the next Open Status page.

That is it.

How to enable ratings/comments on all products in CS-Cart

I compared a lot of shopping cart systems, and finally settled down with CS-Cart. If I have time (I wish) I would like to write down some of my comparison of these e-commerce system (Free Open Source ones and paid one). But even with CS-Cart which is not perfect, I had to do some extra work to get it work in the way we need. Today I just wanted to share one of tips I found to do something CS-Cart doesn’t have by default.

In CS-Cart, the review/comments addon has not been enabled by default. So you either do it one by one, or do it in a mass editing way as the below. Continue reading

How to set Microsoft Excel cell background color in VBA

Recently I have been working on a VBA project, so I will post some skills or tips I learned and used on Excel VBA program. Today I will share how to change the cell background color in the VBA module.

The property of background color is , and the color is used as Index format. So to setup a cell (row ID: 1, column ID: 12) in Red background color is the below:

Worksheets(1).Cells(1,12).Interior.ColorIndex = 3 ‘change the background color to RED

And you can find more color index in the rest of my post. Continue reading

A good WordPress plug-in recommended

bestwebsoftI should have written this post earlier since I have been using this plug-in for a while. But I didn’t realize its helpful result till recently I checked my comments section in my blogs.

As a lot of bloggers/WordPress Owners on the Internet, I put the comment spammers at the top of our hate list. I had to spend a lot of time to clean up these junk comments (with ads, links) even my WordPress installed the Akismet plug-in by default.

Things changed after I searched and installed a good CAPTCHA plugin from Bestwebsoft’s developer.  The following is what the plug-in description says about itself.

Plugin Captcha intended to prove that the visitor is a human being and not a spam robot. Plugin asks the visitor to answer a math question.

Well, I didn’t test and use other WordPress CAPTCHA plug-ins, so I couldn’t have a good comparison on it. And only thing here I have to say: it works, and works well for me. In the past month, I only had one or two junk comments on all my blogs compared to a few hundreds before without it.

If you are interested, and want to give it a try too. Search BWS CAPTCHA plugin in WordPress plug-in installation directory; or browse its website http://bestwebsoft.com/plugin/. Good luck.

How to get rid of newsletter required error in PrestaShop customer account registration

PrestaShopI used Prestashop for one of my friends e-commerce website. I tested, and everything was okay. But we didn’t like the Required message for the Newsletter checkbox while we tried to register a new account during the checkout.

So we tried to remove the required field. As usual, I searched the Internet for the solutions first. But a lot of search results talking about how to add new required fields for PrestaShop, like the phone number, etc. This needs to hack the Address.php class file. But I didn’t see any answers to my original question: just get rid of the Newsletter required message. Even I did, I would not have considered to do so by hacking the eCommerce system’s core files.

Then I looked up in the modules section, and I tried the different “newsletter” related modules. But unfortunately I still could not find a solution.

Finally, before I almost give up and decided to hack the core files, I found the place to make the change. Here is the how-to:

1, Log into the admin back-up.

2, select the Customers option from the Customers top navigation menu;

3, Click “+Set required fields for this section” button, and you will see “Newsletter” field overthere.

4, Un-check “newsletter” and click “Save” button below to apply your change.

And you are done, didn’t realize it was so easy and it was hidden there.

How to display multiple count(*) values in one row with Group By based on different conditions

sql-injection-database

It has been a while for me to write SQL query due to the heavy involvement with budgetary meetings and other managerial errands. So when the developer asked me the help on the query today, it took me a longer period to finally figure out.

Challenge:
Let us assume this scenario : we have a table with all applications submitted, along with the approval status (“Approved”, “Denied” and “Pending”) and process date/time.  Now, we need to display a report with the requested company information and how many applications submitted, approved, and denied they had in a particular time period.

It simply starts with the Count(*) and Group By Requested Company ID in the SQL. Continue reading

How to setup a schedule task to export Oracle table data to CSV file

OracleThe flight information was not updated as expected, so I need to re-write the script to dump the flight data from one of our Oracle database table into a CSV file, which can then be used to replace another Text file to update the flight information display devices.

A very important requirement for this data file: The column name should be on the first line.

Thought about a couple of other ways, like as complicated as creating a VB.net page to do so; or as simple as using Oracle database job scheduling. Finally I settled down to use SQL*Plus query and DOS batch file combined with Windows Task Scheduler. Here are the details I implemented. Continue reading

Crystal Report issue in ASP.NET: Maximum report processing jobs limit configured has been reach…

Some Crystal Reports developed in the asp.net site stopped working, and turn on the debug, found the following error message:

System.Runtime.InteropServices.COMException (0x80041016): The maximum report processing jobs limit configured by your system administrator has been reached.

Anyone knows how to fix this issue? What I did to do a work-around was resetting the IIS and get the website back to normal. But I am afraid that this problem will come back if the Crystal Report asp.net class could not be Garage Clean correctly. Please let me know if you have a solution, thanks.

[Resolved] BC30560: ​’mycontrol_​ascx’ is ambiguous in the namespace ‘_ASP’

Just got back to the office and had to update a lot of asp.net web pages. Some of them share the same content, so I created a couple of User Control files (ascx) and shared them in some aspx files. They didn’t have any problem on my development machine, but repeatedly had the following compile error when I uploaded to the testing and production servers.

BC30560: ​’mycontrol_​ascx’ is ambiguous in the namespace ‘_ASP’

Tried some fixes but still had the same error, like

  1. Stop the WWW services, then delete all asp.net temporary folders and files under the directory of “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”;
  2. Deleted the asp.net files, and re-uploaded again;
  3. Changed the debug to false in the section <compilation debug=”false”> in web.config file;

Finally, I found out that since I am using Visual Studio 2010 to create the new Web User Control for asp.net 2.0, the file automatically uses the classname in my ascx file.
<%@ Control Language="VB" ClassName="WebUserControl1" %>

 Then I updated the <%@ %> as the following, and it works. Finally!
<%@ Control Language="VB" AutoEventWireup="false"  %>

How to fix Save error prompt when changing data type of a table in MS SQL 2008

Today just tried to do a quick database table change in MS SQL 2008 R2, but got the Save (Not Permitted) error prompt as the below.

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.

Continue reading

Add watermarks to photos quickly with Photoshop droplet in Windows

A droplet is an executable file generated by Photoshop that allows you to apply a set of actions just by dragging and dropping files or folders on to it. This is a great time saver when you have to apply the same action to a lot of files! If you do this manually, you’ll spend a lot of precious time. Let’s say you have to resize 100 jpeg’s, or apply the same effect (adding watermarks) to 500 more jpegs, or even better, resize, apply the same effect and save them as gif’s. No problem! You create a droplet in Photoshop and the job couldn’t be easier! Continue reading