woocommerce pending payment

In the stage of processing orders, there are many order statuses such as woocommerce pending payment,processing, on hold, completed, canceled,returned,failed.In the scope of this article, we will focus on the pending status of the orders, how it works as well as the method to process it.

Woocommerce is one of the plugins after combining with WordPress becoming the source code which has the biggest market share. Till now, there are 49,226,906 download times which account for 28% of download times of all the online stores.

Come back to the order management issue, woocommerce pending payment often occurs when you incorrectly configure the payment or in case of using manual payment method such as COD, bank transfer. Because these payment methods do not include notifications as well as return any information to the web, the system cannot automatically change the order status.

With these manual payment methods, it requires manual management operations. After receiving payments from the banks or COD staff, the shop owners will change the order status manually. Then you will deliver goods to your customers if they are physical goods such as clothes, books, equipment, toys, etc. Or the system will send files to the customers or allow them to download files if they are digital products.

You follow the guidance on how to change the order status. You click on Status item and select the orders in Pending payment method to switch to another status.

woocommerce pending payment

Through the article woocommerce pending payment, we see that no matter how modern your stores are, you should be flexible to serve different customers by manually operating as the case above. Therefore, you should prepare professional order edit tool to reduce the time and labor cost. If you use Prestashop, I recommend that you should use Order edit module. You can get access to this link ( https://addons.prestashop.com/en/order-management/23748-order-edit.html ) to try the demo before applying it to your project.

 

How to create recaptcha validation before submit in php

Welcome you to the article “ recaptcha validation before submit ”. The guidance of this article is on PHP source code. Besides, after reading this article, you could download the source code of this article. You can use it without minding.

recaptcha validation before submit

Introduction

We need to use recaptcha validation before submit because it helps make sure that there is a human wanting to submit information. And they are people to whom we need to reply. In addition, captcha can be used to avoid being spammed or DDOS attack.

Preparation

In this article, the first thing we need is an editor software such as notepad ++ or phpdesigner as I am using. You can use any tool that is suitable for you.

The second thing is a Google account. It is your Gmail and password.

Besides, you also need hosting. Previously, you can use localhost. But recently, Google API does not support localhost anymore. There will be a notification as below. You can try to see if your computer allows to use localhost.

recaptcha validation before submit

Implementation

Create php source code

To save time, I will provide you with the source code of the article. You just need to copy and edit according to your need,

Create index.php file to which you add the code

<html lang="en">
<head>
<title>recaptcha validation before submit</title>
<scriptsrc='https://www.google.com/recaptcha/api.js'></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head>
<body>
 
<div class="container">
<div class="row">
<div class="col-xs-8">
<div class="panel panel-primary">
<div class="panel-heading"><strong>Precaptcha validation before submit</strong></div>
<div class="panel-body">
<form action="do_process.php" class="form-horizontal" method="POST">
 
<div class="form-group">
<label class="col-xs-4 control-label">Full Name:</label>
<div class="col-xs-6">
<input type="text" class="live-form" name="name" placeholder="Full Name" required="" />
</div>
</div>
 
<div class="form-group">
<label class="col-xs-4 control-label">Your valid Email:</label>
<div class="col-xs-6">
<input type="text" class="live-form" name="email" placeholder="Your Email" required="" />
</div>
</div>
<div class="form-group">
<label class="col-xs-4 control-label">comments:</label>
<div class="col-xs-6">
<textarea type="text" class="live-form" name="comments" placeholder="Your comments" required=""></textarea>
</div>
</div>
<div class="form-group">
<label class="col-xs-4 control-label">Simple Captcha:</label>
<div class="col-xs-6">
<div class="g-recaptcha" data-sitekey="6LflqWkUAAAAACBi3OmE825ELQ9ZkeINwRsEITpa"></div>
</div>
<div class="form-group">
<div class="col-xs-6 col-xs-offset-6" class="live-center">
<br/>
<input class="btnbtn-success" type="submit" name="submit" value="Submit">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
You should pay attention to this code <div class="g-recaptcha" data-sitekey="6LflqWkUAAAAACBi3OmE825ELQ9ZkeINwRsEITpa"></div>
You should replace the sitekey with your code. To get this code, you should view the sitekey and secret key.
<?php
if($_SERVER["REQUEST_METHOD"] === "POST")
{ 
$google_recpachscrkey = "6LflqWkUAAAAAMEt_pgOdo9IucoBDTTq77K8Anlq";
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$google_recpachscrkey."&response=".$_POST['g-recaptcha-response']);
$response = json_decode($response, true);
if($response["success"] === true){
echo "USER Form Submit Successfully.";
}else{
echo "You Simple are a robot";
}
}

Please pay attention to this code $google_recpachscrkey=””, please view steps on how to create site key and secret key to add information to.
Create site key and secret key
Firstly, you get access to this link https://www.google.com/recaptcha/admin#list, then you log in your Google account.
Label: here you enter the title of the website for more convenient administration if you have many projects.
Choose the type of reCAPTCHA: you choose reCAPTCHA v2
Domain: you input the domain. If you have lots of domains, you should write each domain in one line, please delete prefix http:// and www.

Then you click on Accept the recaptcha Terms of Service checkbox

recaptcha validation before submit

The next page will include lots of information as well as user guide. But in this article, you just need to pay your biggest attention to the site key and secret key. You should copy and add this information to the part above.

recaptcha validation before submit

You have read the article recaptcha validation before submit. Now you can know one more data validation before processing. You can add/delete fields in php form. I have used Custom field module and found it very interesting. You can add unlimited fields to the registration page or checkout page pretashop. Of course, the module supports all types of data including recaptcha. If you are interested in the module, you can refer to this link https://addons.prestashop.com/en/registration-ordering-process/27422-custom-fields-registration-form-and-checkout.html Thanks for following the article.

Export ebay listings to csv file

To export ebay listings to csv file means to export products to csv files. The files can be used for different purposes. This article will show you the positive effects of csv files as well as the process of importing products.

You have sold products online on Ebay for several years. Your number of products is huge. You want to expand your market by developing new e-commerce pages to show and sell products online. But importing product information one by one is impossible because the number of products is too huge. Editing or adding new products may cause unworthy errors. It is the reason why importing product is interested by many people.

To export ebay listings to csv file, you get to the product list, choose all the products you want to export. In Action, you click on Export to file as below

export ebay listings to csv file

Then CSV file will automatically be downloaded to your computer. You can edit the CSV file by Office software or google office. You could edit the product name, image, and price before importing to your website.

Now, if your website use source codes such as Shopify, Magento, Prestashop, Woocommerce, you just need to take the csv file and import to the website. You should pay attention to the csv file structure comparing with the sample csv file structure. But if you use Prestashop source code, I suggest that you should use Import product module. When using this module, you do not have to pay attention to the csv file structure. You can use any csv, xml files. You can get to here to import the files that you export ebay listings to csv file with the demo back office. If your problem is solved, please let us know. If not, please leave a comment or contact us, we will support for free.

Create full width drop down menu

In the previous article, we created a mega menu together. This one will guide you on creating a simpler menu which is full width drop down menu. We do not create html item or image as before. Instead, we just generate traditional and simple mega menus.

full width drop down menu

Preparation

As other guides we showed you before, the article “ full width drop down menu ” is not an exception, you should prepare editor software such as notepad++. Also, a browser should be installed on your computer such as IE, Firefox, Chrome, etc.

Implementation

Open the editor software and create a file with the name index.html. You add the following contents to this file and save it.

<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Tutorials</a>
<ul>
<li><a href="#">Photoshop</a></li>
<li><a href="#">Illustrator</a></li>
<li><a href="#">Web Design</a>
<ul>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Articles</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">User Experience</a></li>
</ul>
</li>
<li><a href="#">Inspiration</a></li>
</ul>
</nav>

Next, create a style.css file and add the following contents to, and save it.


nav {
  text-align:center;
  width: 100%;
  background: #bebebe;
  padding: 0;
  margin: 0;
  height: 60px;
  position:relative;
}
nav ul {
  background: #bebebe;
  list-style:none;
  padding:0 20px;
  margin: 0;
  height: 60px;
}
nav ul li {
  display: inline-block;
}
nav ul li a {
  color:#333333;
  display:block;
  padding:0px 40px;
  text-decoration:none;
  float: left;
  height: 60px;
   line-height: 60px;
}
nav ul li:hover {
  background: #333333;
}
nav ul li:hover > a{
    color:#FFFFFF;
}
nav ul li:hover > ul {
  display:block;
}
nav ul ul {
  background: #BEBEBE;
  padding:0;
  text-align: center;
  display:none;
    width: 100%;
  position: absolute;
  top: 60px;
  left: 0px;
}

Now you check again by opening index.html file with browser. If you follow the guide, the result will be as the figure above.

So, we have just finished the article which is about creating a full width drop down menu. If you have any feedback, please leave a comment. If you could not still do this, please feel free to contact us. Besides, you could download the source code via the link below

Custom fields Prestashop module

Custom fields Prestashop is the module that allows you to add extra fields to a registration form, and checkout page. The module supports all input types, which helps you to create forms with various fields meeting your needs.

Custom fields Prestashop

DRAG AND DROP SUPPORT

In addition, it will be easier than ever for form creation because custom fields module supports for drag and drop. According to statistics, a huge number of users enjoy using drag and drop due to its friendly, visual user interface and time saving.

EASY TO ADD FIELDS TO REGISTRATION FORM

You can add extra fields to a registration page by using drag and drop in the Pretashop registration form of the module’s back office. After registering, customers are able to edit their information and data in item “my account”. In terms of admin, they can change all data about their customers in the back office. Especially, you can choose the place where to locate fields in the registration page.

ADD EXTRA FIELDS TO SHIPPING STEP OF THE CHECKOUT PAGE

In checkout page, you are able to add extra fields to shipping step. This process’s purpose is to collect customer information that is used in the delivery processin order to make sure the most convenient delivery for both store owners, delivery units, and customers.

ADD EXTRA FIELDS TO PAYMENT STEP OF THE CHECKOUT PAGE

Being similar to shipping step, custom fields Prestashop module also supports to create form and display fields in payment step, serving store and shop owners who enjoy editing form themselves.

If you are owninga shop website built on Prestashop platform but you feel that the default registration part of the system still has not met your needs yet. Or you want to edit, add extra fields to checkout step, shipping step, etc. I believe you should consider using this module. Please visit here  . Or if you have any question, do not hesitate to contact us. We are willing to support you.

How to create PHP contact form script with captcha

In the two previous posts, we have successfully created a simple contact form with validation for fields. It can’t be denied that a lot of spammers and programmed spambots will attack your website from flooding your form, that’s the reason why your contact form needs a CAPTCHA function to prevent those spam emails. By using captcha function, a customer needs to enter correct provided characters into the captcha box so that they can submit his request to the server. In this article, I will guide you how to create the PHP contact form script with captcha.

PHP contact form script with captcha

We will create contact-us.php file instead of HTML file. You need to put this .php file into the project folder.

Source code of PHP contact form script with captcha:


<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html" />
<meta name="author" content="TRAN DINH HONG" />
<title>php code to send email from contact form</title>
<link type="text/css" rel="stylesheet" href="style/style.css" />
</head>
 
<body>
<?php
session_start();
 
include("php/simple-php-captcha/simple-php-captcha.php");
// Step 1 - Enter your email address below.
$to = 'you@domain.com';
 
if(isset($_POST['emailSent'])) {
 
$subject = $_POST['subject'];
 
// Step 2 - If you don't want a "captcha" verification, remove that IF.
if (strtolower($_POST["captcha"]) == strtolower($_SESSION['captcha']['code'])) {
 
$name = $_POST['name'];
$email = $_POST['email'];
 
// Step 3 - Configure the fields list that you want to receive on the email.
$fields = array(
0 => array(
'text' => 'Name',
'val' => $_POST['name']
),
1 => array(
'text' => 'Email address',
'val' => $_POST['email']
),
2 => array(
'text' => 'Message',
'val' => $_POST['message']
),
3 => array(
'text' => 'Checkboxes',
'val' => implode($_POST['checkboxes'], ", ")
),
4 => array(
'text' => 'Radios',
'val' => $_POST['radios']
)
);
 
$message = "";
 
foreach($fields as $field) {
$message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "<br>\n";
}
 
$mail = new PHPMailer;
$mail->From = $email;
$mail->FromName = $_POST['name'];
$mail->AddAddress($to);
$mail->AddReplyTo($email, $name);
 
$mail->IsHTML(true);
 
$mail->CharSet = 'UTF-8';
 
$mail->Subject = $subject;
$mail->Body    = $message;
 

// Step 5 - If you don't want to attach any files, remove that code below

if (isset($_FILES['attachment']) && $_FILES['attachment']['error'] == UPLOAD_ERR_OK) {
$mail->AddAttachment($_FILES['attachment']['tmp_name'], $_FILES['attachment']['name']);
}
 
if($mail->Send()) {
$arrResult = array('response'=> 'success');
} else {
$arrResult = array('response'=> 'error', 'error'=> $mail->ErrorInfo);
}
 
} else {
 
$arrResult['response'] = 'captchaError';
 
}
 
}
?>
 
<div class="contact-wapper">
<h2 class="title"><strong>Contact</strong> Us</h2>

<form id="contactForm" action="<?php echo basename($_SERVER['PHP_SELF']); ?>#contact-sent" method="POST" >

<div class="row">

<div class="form-group">

<div class="col-md-6">

<label>Your name *</label>

<input type="text" value="" msg-error="Please enter your name here."  maxlength="100" class="form-control" name="name" id="name" required="" aria-required="true">

</div>

<div class="col-md-6">

<label>Your email address *</label>

<input type="email" value="" msg-error="Please enter your email address here."  maxlength="100" class="form-control" name="email" id="email" required="" aria-required="true">

</div>

</div>

</div>

<div class="row">

<div class="form-group">

<div class="col-md-12">

<label>Subject</label>

<input type="text" value="" msg-error="Please enter your subject  here."  maxlength="100" class="form-control" name="subject" id="subject" required="" aria-required="true">

</div>

</div>

</div>

<div class="row">

<div class="form-group">

<div class="col-md-12">

<label>Message *</label>

<textarea maxlength="5000" rows="10" msg-error="Please enter your message  here." class="form-control" name="message" id="message"  required="" aria-required="true"></textarea>

</div>

</div>

</div>

<div class="row">

<div class="col-md-12">

<label>Capcha code*</label>

</div>

</div>

<div class="row">

<div class="form-group capcha-s">

<div class="col-md-4">

<div class="captcha form-control">

<div class="captcha-image">

<?php

$_SESSION['captcha'] = simple_php_captcha(array(

'min_length' => 6,

'max_length' => 6,

'min_font_size' => 22,

'max_font_size' => 22,

'angle_max' => 3

));
$_SESSION['captchaCode'] = $_SESSION['captcha']['code'];
echo '<img id="captcha-image" src="' . "php/simple-php-captcha/simple-php-captcha.php/" . $_SESSION['captcha']['image_src'] . '" alt="CAPTCHA code">';
?>
</div>
<div class="captcha-refresh">
<a href="#" id="refreshCaptcha"><i class="fa fa-refresh"></i></a>
</div>
</div>
</div>
<div class="col-md-8">
<input type="text" value="" maxlength="6" data-msg-captcha="Wrong verification code." data-msg-required="Please enter the verification code." placeholder="Type capcha code." class="form-control input-lg captcha-input" name="captcha" id="captcha" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input type="submit" value="Send Message" class="btn btn-primary btn-lg mb-xlg" />
</div>
</div>
</form>
</div>
</body>
</html>

Please take note about this important code line: “include(“php/simple-php-captcha/simple-php-captcha.php”);”. This means we need to use the PHP captcha library to automatically generate captcha code for each customer if we develop the PHP contact form script with captcha.

In this article, we talk about the basic things that help you understand how it works. In reality, you can base on this article to learn how to add a library to create the captcha function. Because the contents of the library are so long and complicated that users who start to learn about form find it difficult to understand, we will talk about it in another article.

You shouldn’t follow the post if you are using a framework like WordPress, Prestashop or Magento. Because the frameworks has awsome plugins, modules for creating form. For example, If you need custom Prestashop contact form, you could use module Form Builder Pro.

There are many types of captcha that can be used. We will discuss one captcha type in this article. Besides, another interesting way is using Google captcha. Basically, we need to register to get API of Google then add this API to the form settings in order o be able to use.

you can download Source code : PHP-contact form-script-with-captcha

If you’ve any question or recommendation, please do not hesitate to let us know.

 

Enjoy this blog? Please spread the word :)