How to Add or Edit Coupons in Opencart

In this article, I explain how to add coupons in Opencart. In addition I have written about managing coupons in opencart and editing them. So here begins our simple tutorial on managing coupons in Opencart.

Step 1:- Access the dashboard – Login to your admin area of opencart

Step 2:- From the “Sales” menu, access “coupons” submenu

Now you have reached the main coupon administration area of Opencart. Here you will see all the coupons you have created so far in order.A screenshot of the coupons management page is shown below.

How to add or edit coupons in opencart

How to add new coupons in Opencart

Step 1:- Click on the “Insert” button in coupons management page. This will lead you to the coupon addition page which is as shown below.

How to add or edit coupons in opencart

Each of the parameters in the coupon addition page is explained below.

Coupon Name – A proper name should be given for each coupon. This will help you to promote the coupons among your customers. The coupon name should be very relevant to the offer you are giving. If you are giving 10% discount for Halloween, then give then name as HALLOWEEN OFFER.

Coupon Code – This is the actual code that opencart validates at checkout. The code must be unique & should not collide with a code you have created before. In the case of our example, we can give HALLO10 as code. HALLO represents halloween & 10 represents the offer percentage.

Type – You can choose two types of offer execution. One is percentage, where the index you enter in this field will be taken as discount percentage. If you select “percentage”  as type and enter 10 as the index in this field, then our coupon code HALLO10 will be a 10% discount coupon. If you select Fixed Amount and input 50 in the field, then our code HALLO10 will be a 50 Dollar (or the currency set in your opencart) discount.

Total Amount – is for setting an eligibility for availing the discount coupon. If you input 1000 in this field, then our coupon HALLO10 will be valid only if the purchase amount is greater than or equal to 1000 US Dollar (or the set currency in opencart).

Customer Login – You can select “yes” if you want the coupon offer available only for a customer with a registered account. If you set “no”, even guests will be able avail the offer. If you want everyone to enjoy the coupon offer, you can set “NO”. If you want to give coupon offers to registered customers only, set “yes”

Free Shipping – You can select “yes” if you plan to give free shipping as part of the coupon offer. Select “No” if you don’t want to give free shipping as part of your coupon offer.

Note:– Refer the screenshot below to see the rest of “coupon addition page”

How to add or edit coupons in opencart

Category – is actually an offer limiter. You can limit your coupon offer to a specific category alone. For example, you can set HALLO10 offer limited only to all products in “mobile phones” category. You can even go deep & select a sub category alone. This means you can limit the offer to Apple phones alone. You can choose a combination of sub categories & categories as well. This means the HALLO10 offer can be limited to Apple phones & Samsung phones or you can limit it to two major categories like Mobile Phones & Cameras.

Products – is another special offer filter. This feature can be used if you want to set the offer for a particular product alone or a couple of products together. Here you can limit the offer to Apple Iphone 4S alone or you can set the offer to a selected 2 or more products.

Note:- Products are listed in the text area based on the selected categories. This is in fact a second level offer filter of categories.

Date Start – Set the starting date coupon.

Date Ends – Set the ending date of coupon

Note:- The coupon code will be active in between the start & end date. Coupon code will be disabled outside this date range.

Uses per Coupon:- This index input in this field determines the maximum number of usage for a coupon code. If we set 500 here, the coupon code HALLO10 can be used 500 times. If we leave this field blank, the coupon code HALLO10 can be used infinite number of times.

Uses per Customer:- If you want a customer to use the coupon code ( HALLO10 in our example ) for infinite number of purchases during the offer valid period, leave this field blank. If you want a customer to use the coupon code only for a single purchase, set this field to 1. Similarly you can input other index values as well.

Note:- If you set “uses per coupon” as 500 and “uses per customer” as 2, then an interesting thing can happen. 250 customers can consume the 500 available coupons. Similarly if “uses per coupon” is 500 and “uses per customer” is 5, then just 100 customers can consume 500 coupons. Well, it is just a probability which may not happen in reality. But think a little while you set these two numbers.

Status:- Set the status to “Enabled” for the coupon to be active. Set the status to “Disabled” to deactivate or suspend the coupon temporarily.

Okay! You have done 99% of adding a new coupon. Now hit the “Save” button given at the top portion.

How to Edit Coupons in Opencart

The process of editing coupons in opencart is exactly the same as adding coupons in opencart. So reach the main page of coupons management (Sales–> Coupons). Select the coupon name you want to alter & hit the “Edit” link given towards the right.

How to add or edit coupons in opencart

How to Delete Coupons in Opencart

Reach the main page of coupons management (Sales–> Coupons). Select the coupon you want to delete using the check box given on left side. Now simply hit the delete button. If you want to delete more than one coupon at a time, select all the check boxes of coupons you want to delete and hit delete.

14 features that make Yii, the best php framework.

yii

 

Yii, for no doubt is the best php framework currently in the industry. What makes yii special?  Have a look at these 14 exceptional features.

1. Fast

Check out the differences in how many RPS ( Requests per second)  other frameworks can process compared to yii. Check out the drastic difference when we enable the APC extension in php.

framework comparison

Yii is very much known for its speed. Applications developed in yii loads very fast. It is  light weighted  and the code is very much optimized . The lazy loading technique improves the speed of Yii. It neither loads a class until its used   nor creates  an object until its accessed for the first time.

Have  a detailed look at Yii performance .

2. CRUD Feature

Yii got the CRUD  feature. This literally saves heaps of time and makes our process much easier. For instance, If we are building a user creation form, we just need to create the User table and the required fields in the database. And using Gii(link)((a powerful tool of Yii to generate models and controllers) we can easily generate the User model and its CRUD.Thats all and we got the user create,update,delete and manage system all in two or three clicks

 

3. Database tables as objects (so that we don’t need to query all time).

We can create model instances. The database modification with these model instances helps you to avoid complex queries and make  your tasks easy. The CDBCriteria  of Yii helps to process very complex database queries easily.

Yii applications can be switched to different databases without any difficulties. Yii got a query builder, and it generates the query. This prevents sql injection and other attacks.
The  ORM approach turns tables into classes and rows into objects.

3.1 Relations

Relations are one of  highlight features of Yii. You can define the relation between multiple tables say One to One, One to Many etc so that we access the related data in a single object avoiding all the comple JOIN (Inner,Outer ) queries of SQL.

Consider two tables User and Profile. User table contains the authentication details and Profile table contains the personal details of the user. We have defined a Has One relation (User have one profile) in the User model .

'userprofile'=>array(self::HAS_ONE, 'Profile', 'userID')

We’ve set a relation named “userprofile” and we  can access the related profile data through,

$user->userprofile->phonenumber

where phonenumber is the profile user phone number in the profile table.

4. Easy Form Validation.

Working with form and its validation is one of the essential stuff for any website. Using Yii, you can connect your forms with the models (database tables). You can set validation rules for the model. For instance consider a User model (the user database table for user registration ) and there is a field username in it.

array('username','required');

We can set Yii validation rule for the username. And then we create a new object of the User model class and creates a form field for username in the user registration page.

echo $form->textField($user,'username');

where $user is the User model instance and ‘username’ is the database field for user name. We’ve created a “required” validation rule for the user name so it gets handled automatically.Once the from is submitted with empty user name field, the error will show up automatically.

5. Great  support for Jquery and ajax.

There are lots of widgets in Yii which have ajax  and jquery support. It do have the jquery dialog, date picker and all so that we just need to call the widgets. We can also send ajax requests easily using the inbuilt ajax buttons in yii.

6. Inbuilt Authentication and Authorization

Authentication

Yii has a default login system, in which we can authorize our user. We just need to connect our User model into it. It got all the essential features required, say session,cookies,error handling etc. We can also manipulate the login system easily

Authorization

Yii got inbuilt role based access controls through which we can create roles to the users. We can limit the access to different sections based on the roles.

if(Yii::app()->user->checkAccess('createUser'))
{
// Create the user
}

Here we’ve created a task called “createUser” and if the user have permission to the task(creating a user) , he can create a user.

Yii also got accessRules through which we can easily block or allow, logged in,logged out or other users to an action.

7. Theming

Yii applications got theme directory inside so that we can set the theme for the application. Also we can switch easily to different themes inside the config file.This helps the designers to implement designs very easily.

8. Web Services(API Support).

Yii helps easy generation of web services. We can create an action and define a webservice action to it (just 1 line code). And if we try to access the action as a url what we see would be a bulk of xml contents.

9. Caching

Caching helps to improve the performance and speed of your website. Yii helps you to integrate different caching components on different scenarios.This reduces the time required for page load to a great extent.

10. Error Handling

Yii provides great support for error handling. Yii have handleError and handleExcpetion methods which handles all the php warnings and notices.Through Yii, we can raise exceptions (there are lots of built in exceptions) . For example, if a user is requesting an invalid page, we can handle it buy just adding,

throw new CHttpException(404,'The specified page cannot be found.');

And this will raise the 404 error which is what we require in such a scenario.

11. Security

Yii is highly secured. Three major types of attacks to a website are.
1. Cross-site Scripting (XSS)

A typical example is the attack in a poorly made up forum. User can enter malicious javascript code to the forum and it will appear in the forum page. Yii checks for the javascript and malicious codes entered and is capable of blocking those malicious codes form being entered into the website. CHtmlPurifier(inside Yii) does this purpose.

2.Cross-site Request Forgery(CSRF)
These type of attacks are mainly responsible for money loss(mainly from banks) . Yii makes the $_GET requests to retrieve data only, not to change anything in the server.

3.Cookie attacks
Yii got a cookie validation method , which blocks cookies from being modified.

12. Extensions

Yii do have lots of extensions. some what like plugins for wordpress. This makes the complicated development and 3rd party api handling very easy for yii. The twitter bootstrap extension is one of the most rated yii extension. This helps you to integrate twitter bootstrap for your application easily.

Yii Extensions

13. Testing

Yii do have Unit testing and functional testing feature, which helps you in testing and improving your code quality.

14. Great Documentation

Yii do have one of the best documentation system compared to all other frameworks. Each and every single method is documented clearly and thoroughly.

Have a look at the Complete Yii Documentation.

Make your wordpress development easier with Advanced Custom Fields Plugin

WordPress is getting undeniable day by day. Its getting powerful, lots of new features are added up.  Easy customization and flexibility are the highlights of wordpress.

WordPress meta fields are one of the best features of wordpress. It makes your developments very easy. Its very flexible too.

What is  the use of wordpress meta fields?

I am briefly explaining wordpress meta fields for peoples who doesn’t know much about it, I’ll explain it with a simple scenario. Just Imagine that you are having a real estate website in wordpress. You have created a custom post type properties for the listings.

  • What if you need a special column for price in the wordpress properties post type admin?
  • What if you want to save the price in  a special row in database?
  • What if you want to display the price alone in the Properties  view page?

WordPress meta fields make this possible, there are two major functions in wordpress.

1. add_post_meta

add_post_meta($post_id, $meta_key, $meta_value);

Meta field is connected to the post id in the database table. A specific meta key and its value is set for a specific post in wordpress (with respect to the post id)

In our case regarding the property and price.

$meta_key will be “price” and $meta_value will be the amount say 500.  This will be saved in the database.

2. get_post_meta

$meta_values = get_post_meta( $post_id, $key);

We can retrieve the set meta values using get_post_meta. In our example we can retrieve the meta key price and its meta value so that we can display it in the property listing or view page. Different price will be given for different  properties(post id).

Advantages of Advanced custom fields.

So how does Advanced custom fields help us? It helps us implementing the meta fields easily. Advanced custom fields  plugin will create the required meta fields (text field, drop down,select or other html form fields) in our wordpress post admin so that we doesn’t need to call the wordpress add_meta_box function(it creates a meta box inside the wordpress post admin, and we should to create the input text fields and all inside it ). Here is were ACF saves our time.

The custom fields can be set for posts,pages,post types in the Advanced Custom Fields plugin settings and it will be shown up inside the post or page admin. The values saved can be retrieved using the get_post_meta function. Have a look at the below screen shots which shows the implementation of ACF plugin.

1. Advanced Custom Fields Settings (Creating Fields in admin)

advanced custom fields - settings

2. Advanced Custom Fields Rules ( Defining where should we set the custom fields(posts,pages etc).

advanced custom fields - rules

3. How Advanced Custom Fields  is displayed in the post/page admin?

advanced custom fields - post admin

Download Advanced Custom Fields Plugin

How Content Writers can Make Money with Online Writing Jobs

The internet has created a wide range of opportunities to find and choose different types of professions. “Content Writing” is one such profession which would not have been this lucrative without web and internet. Every business needs content writers to perform different types of tasks. In the web based business industry “content writers” are used to create original articles to publish in websites. These articles will attract visitors from search engines & other sources. Websites use these visitors to make revenues by selling their products/services. Similarly content writers are hired to create content for brochures, presentations, seminars, marketing materials, sales copies, newsletters and many other goodies. In this article we analyze how content writers can make money by taking online writing jobs through marketplaces, through self made websites, through social media communities & many more.

How content writers can make money by taking online writing jobs
Image Source

What is Content Writing ?

In simple words, the job of a content writer is to develop an original, well researched article about a particular topic in the specified language. The basic skills needed are a passion for writing, good command over the language and its vocabulary, ability to do independent research about the given topic, do analysis from different perspectives and come up with an original conclusion. The skills can vary with different types of jobs. For example:- An entertainment web portal may demand for your skills in making the article spicy rather than analytic skills. On the other hand a financial web portal may put weight on your skills to analyse a company and it’s performance over a period of time. The skills in demand usually vary with nature of topics and business.

Some Examples of “Content Writing” by Journalists and Freelancers

I have added a couple of links below, which are ideal examples of the types of content in demand. I have added only 3 links, just to show you some examples. The actual demand for articles can vary. However the article below will give you a brief idea about the nature of job.

1. Article from LifeHacker :- 5 best document scanners for going paperless 

2. Article from TechCrunch:- How VC’s plan for the Future

3. Home Furnishing Article from EHow:- How to Furnish a Small Bedroom 

How to take the first step ?

From my experience, I have seen 3 types of people who make decent income as content writers. Some of them treat it as a full time profession, for some others its part time profession and finally a third category sees it as a hobby which they do it in their free time. You can opt to be in any of these three category but before that lets get to some basics.

What type of a writer you want to become ?

If we classify writers into 3 categories, then there are the following types.

1) Specialized writers – who are very well versed in a particular subject/industry and they write about their particular field only. This type of writers usually focus on a particular area say finance, technology, education based on their knowledge & expertise. They usually hold deep knowledge in their respective areas and they are capable of bringing authentic articles about their subject.

Such Writers has the followings Pros & Cons:

Pros of being a specialized writer are:-

  1. They can charge a premium rate for their article, say anywhere between 100 to 500 USD for a single project they work on, depending on the depth of research and time required.
  2. They usually don’t need to search for work as they will be in high demand. Usually media companies (print & online) will be in hunt for such expert writers. If you are one such expert, its just a matter of networking with some media professionals of your field to get your projects.
  3. Their wont be much competition for these writers as they specialize in a particular area.
  4. They gets the opportunity to build a personal brand using their work. Later this “personal brand identity” will help them to leverage it by publishing an e-book, a printed edition etc.

Cons of being a specialized writer are:-

  1.  You can’t easily enter into this category. You need years of experience in a particular area to develop original,authentic articles. So beginners won’t be able to make it here very soon. As a beginner, you need to focus on improving your knowledge in your chosen area.
  2.  A beginner in “content writing” needs to work towards building his own identity as a “specialized writer” before he can make a decent amount. This takes months of work to build a unique identity as a specialized writer. Once you manage to do this successfully, you can leverage it.

2) General Writers – are more like general journalists who can write about many topics in general. Such writers don’t usually write articles that require deep analysis. They focus on writing general type articles like reviews of a new phone, reviews of a new movie/music, news regarding a start-up,  covering news about the technology and business in general etc.

3) Ghost Writers – who write contents for other peoples,websites or businesses without revealing their identity. In this case, the writer won’t get any credit for their article and work. The rights and credit will be owned by the one who gives you the project. All that the writer gets here is payment for his work.

How Content Writers can get new projects & make money ?

1) Branding yourself through a website – In any case, you get the best payment when you establish yourself as a brand/authority and markets yourself among targeted customers. For a content writer, an ideal way of building a brand is through his/her own website. Start a website, give it a unique design, start populating the website with original articles about your area of expertise. This will help you to brand yourself as an authentic, premium status content writer. Once you establish yourself, you can charge premium rates for your projects. I will show two example cases of successful branding by 2 content writers. Micky Stuivenberg is one such premium content writer from Australia with 20+ years of experience. She has a well established website through which she markets herself. Micky charges an hourly rate of 100 USD per hour which is pretty fair. Heather Griffiths is another premium content writer from United Kingdom. She also markets herself through website & charges a premium rate. You can explore her website to know more details about her areas of work.

Note:- This kind of branding is ideal for “specialized writers” who have years of experience about a subject. However other writers can also opt this method with long term goal & focus in mind. The earlier you start, the earlier you reap benefits.

2) Using Marketplaces to get new projects – Freelance marketplaces are great places to get new projects. You can start your own service provider account in freelance marketplace websites like Elance, ODesk etc. I have written a detailed article about the topic, which you can read here:- Marketplaces for Content Writers to Make Money.

3) Contact Blog owners & website owners – Blog owners & website owners are big purchasers of content. These guys are always in need of quality content, either to publish in their website or to do Search Engine Optimization activities. If you can contact blog owners & website owners directly, you will definitely get projects. You can contact a website owner through the contact form available in his/her blog. If there is no contact form, try looking for a contact e-mail in About Us page, Facebook page, Twitter, LinkedIn or Google+. What matters is contacting the website/blog owner and asking for content writing projects.Be ready to show your portfolio & be professional.

4) Using communities in Social Media – There are lots of communities for “content writers” in social medias like Facebook. I will show a couple of examples here. Facebook has an active page named “Content Writers Needed” which is maintained by a Slogan marketplace company – SloganWar. They publish works/projects in their page’s news feed for which you can apply.  Similarly there are groups of content writers in Facebook where business owners/individuals post requirements. Similarly there are communities/groups in LinkedIn in which you can join & participate to get new projects.

5) Start your own websites/blogs – Content writers are used by websites to produce content. Website owners use the content produced by writers to publish in their websites. These published articles will drive traffic to the websites & they will make money by selling advertisement. Website owners usually make money in 3 ways – 1) Advertisement using Online Ad networks 2) Affiliate Marketing 3) Selling a product(s) directly in the website. My point here is, why not content writers can start his/her own website & make money using these methods ? It’s not very easy though! If you have a long term goal of earning a life through content creation, you can definitely consider starting a website/blog and make money out of it. If you don’t have any idea about starting a website or a blog, I have a detailed article which may be of help for you:- How to Start a Website/Blog & Make Money – The Ultimate Guide.

6) E-mail/Call Web Design Companies & SEO Companies – The biggest takers of “content writers” are web design agencies, SEO/Online Marketing companies, Digital media companies & Print solutions providers. These companies are always in need of high quality content for their clients. If you can contact the right persons/managers in these companies & make a relationship with them, you will get more projects. Usually these companies don’t employ full time professionals for content writing jobs. They outsource it to their part time professionals (who all are freelancers). To get more projects from companies, try e-mailing them with your bio & portfolio. You can also contact companies directly via phone to talk to the responsible manager.

7) Jobs Board for Blogging Partners – There are different job boards which publishes long term writing opportunities. You can find opportunity to become blogging partner in such job boards. A blogging partner usually gets a revenue share of the total income generated. In some cases, blogging partners are paid one time for each article. Problogger Board – is one such jobs board where you can find lots of writing jobs.

8) Applying to Content Creation Companies – is another great option which can ensure continuous & long term projects. Content CrossRoads is one such content creation company. As a writer you can apply for jobs with them. There are many similar content creation companies all over the world & you can find them using Google searches. If you are interested in content companies located in a particular country only, filter your search results by adding country name to the query words.

9) Ad Revenue Sharing Websites – is a great option to make income part time. ShoutMeLoud is one such a blog which allows revenue sharing for its guest authors. There are a hundreds+ other websites which offers revenue sharing programs. All you need to do is find one by one.