WordPress custom form save to database

The phrase WordPress custom form save to database is interested by lots of people. Almost simple contact forms are sent to the admin email address. But in fact, the data needed to be saved to the database. This article will guide you on how to do this in the simplest way.

To be easy for WordPress newbies, we will prioritize to use a plugin. Of course, you can write code yourself. However, for the suitability for every people, we will do the simplest things as below.

Preparation 

  • WordPress: Absolutely, you need to have one website with WordPress already installed or used on your computer.
  • Contact form 7: You must have been so familiar with it due to its popularity
  • Contact Form 7 Database: This is the plugin used to save data to the database when users submit information.

Implementation wordpress custom form save to database

In order to complete the process that wordpress custom form save to database, the first things to do is log in to the WordPress admin. You hover to Plugins and click on Add new.

In the search box, you enter contact form 7. Then you install the plugin and make it active as below

We so the similar thing with the plugin “contact form 7 database

Now, we will create a contact form by building fields. Contact form 7 is a very good form builder plugin which supports many types of input field such as text, image, file, checkbox, etc.

You can use the default form of contact form 7 to make a simple trial.

On all forms, there exist shortcodes. You just need to copy the shortcodes and paste on the post or page you want forms to be displayed.

This article will help you add this code to the contact page

After entering the information already, you click on Submit. If you use localhost but you have not installed sending email on the localhost, the system will show error. Don’t worry! After submitting, data has been saved to the database. We will get to the back end to check.

The plugin admin will display as below

You click to view the detailed contents.

Here is the content in the example

We have finished the article wordpress custom form save to database. If you have any question, please leave a comment.

If you use Prestashop, you could use form builder module. This module supports you to drag and drop professionally. You just have to drag and drop the fields you want to display and save them. It supports responsive to be compatible with all devices. If you do not know how to use it, there are available guidance document as well as support team so that you can use it without minding.

How to cancel an order on PayPal

How to cancel an order on PayPal is the question many people who use Paypal to order often ask. There are many reasons why the buyers want to cancel their orders. But they do not know how to do this. This article will help solve this problem.

How to cancel an order on PayPal

 

You may cancel your order when you realize that this product does not match with you. Or you have spent so much so far and you do not want to spend anymore. Or you just want to cancel the order. Below are the ways you can apply.

Cancel the payment

If you do not transfer PayPal payment to the store, they will not deliver goods to you. Usually, when you transder money via PayPal without confirmation, you have a right to cancel the payment by doing the following steps

  • Log in to your PayPal account.
  • Then Click Transactions at the top of the page.
  • Click the unclaimed payment you want to cancel.
  • Then Click Cancel Payment next to the unclaimed payment.
  • Click Cancel Payment to confirm

However, you can apply this way only the payment has not been confirmed. Maybe the email in which you transfer money does not exist in PayPal or the account has not been authenticated. If your account is valid, money will be sent in a short time, you cannot cancel the payment.

Contact the store

If you have transferred money but the goods have not been delivered. You no longer want to pay for this order. You can contact store owners to apologize request for a refund. In some cases, they will accept the refund happily.

In case of goods having been delivered to you already, you should view the regulation of product exchange. It depends on the regulation of each company.

Open a dispute

This is a rarely faced case, but you need to do this to protect your right. In case that you cannot negotiate successfully, you can absolutely open a dispute. PayPal allows you to do this in 180 days from the date money is transferred.

We have run through the article how to cancel an order on paypal. I believe that you now have your own solution. However, many online purchasing newbies may face the problem. Hope that you could share this article with others to read. If you have any innovative solution, please leave a comment below. We are so grateful for your action.

 

 

 

How to create woocommerce purchase note

woocommerce purchase note is messages that customers send to the store when purchasing. The messages could be notes of address, or reminders to remind admin the date of goods delivery. This article will help you understand what purchase note on woocommerce is as well as how it works, where the data display, and how to eliminate it when unnecessary.

woocommerce purchase note

Display purchase note

In order to see the note contents from customers, you get to Order of Woocommerce. When getting to each order, you will see the content as the figure below

woocommerce purchase note

Change the purchase note placeholder

You can replace the default placeholder of Woocommerce purchase note with the syntax of the following command. You should remember that it only works when being added to function.phpin the theme folder file.

add_filter( 'woocommerce_checkout_fields', 'ht_woocommerce_checkout_fields' );
/**
* Change Order Notes Placeholder Text - WooCommerce
*
*/
functionht_woocommerce_checkout_fields( $fields ) {
$fields['order']['order_comments']['placeholder'] = 'Your custom placeholder';
return $fields;
}

Now, the checkout page in the front end will display like that

woocommerce purchase note

Remove woocommerce purchase note

woocommerce purchase note is seen not to be a required field. You can enter it or not. Therefore, there are two ways of hiding this field

The first way is using css to hide it.

.woocommerce-additional-fields {display:none}

You add this code to css. file. Press F5 button to check.

woocommerce purchase note

 

The second way is safer. If you accidentally add a field with the same class as the class in the figure above, this field will be hidden by chance. Therefore, you should add it to function.php file, then add the below code

add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );

After the article Woocommerce purchase note, you must have known to use it properly depending on the project that you are developing requires purchase note or not. I have worked on many projects so I see that there are many custom requirements in orders. For instance, customers want to add/delete a field, change the order of data displayed, and retrieve users’ data to deliver to the back end for the admin to check. If you are using woocommerce, you should read our next articles. We will have more articles about customer checkout page as well as order. But if you are using Prestashop, I suggest that you should use Order edit module. Because this module helps arrange, edit, and add new orders easily.

 

woocommerce csv import variable products

woocommerce csv import variable products are interested by many people because some logins do not support to import products including variables. However, lots of shops and suppliers sell products including variables. This article will help you.

Create Your Variations CSV

Firstly, you create a csv file which includes product information such as name, image, etc. to save in database. To make sure that you use a correct file and avoid errors, you should use the sample file of woocommerce or plugin.

In Product item, you see Export as below.

Woocommerce csv import variable products

In the next window, you click on Generate CSV as below

Woocommerce csv import variable products

 

If you are using plugins, there will more options forcsv files by selecting export fields to the file as below. The advantage, in this case, is that only necessary fields are exported, which makes the csv file simpler and more convenient for future editing.

Woocommerce csv import variable products

To us, woocommerce csv import variable products will be perfect and work smoothly if you have a well-prepared file with the right format. Our experience is that you import one or two products perfectly. Then you export these data to the csv file to make a sample file other products. In order not to waste too much time on editing the csv file, you should try importing several products. If everything works well, you can start importing products in bulk.

Configure woocommerce csv import variable products

After having a correct csv file which matches with the sample csv file, we start to import products.

Step 1: Upload CSV file as below. We search for the file we have prepared. Then click on Continue

Woocommerce csv import variable products

In addition, you can also click on “Show advanced option” to configure more highly. There is one option which you can use to update products. For example, you want to increase the price or other information of products from another csv file, you just need to click on Update existing products as below.

Woocommerce csv import variable products

Step 2: In this step, you view the information on the left side and edit information on the right side. If your products include variables, you should pay attention to fields such as Attribute name, Attribute value as below.

Woocommerce csv import variable products

After selecting and configuring the above fields, you click on Continue button. The process of importing products starts. Now, you just need to wait for products imported in bulk. You must be surprised when realizing that it takes only from five to seven minutes to import thousands of new products or update existing products. Comparing with importing manually, it is unimaginable.

Woocommerce csv import variable products

Thanks for reading this article about import variable products in woocommerce. All source codes such as Shopify, Magento, Prestashop support to import products by default. However, import product modules and apps have more high-up features. If this article is helpful for you, please share it with others. If you have any comment, please leave a comment below or contact us.

 

 

products not showing in woocommerce

products not showing in woocommerce is a commonly case you may face when you start e-commerce on this platform. There are many causes of this problem which sometimes are extremely silly. In this article, I will mention causes that you do not see.

Due to the developer

You are the developer editing the code of the woocommerce web page. If you face this case, you should check the code. Please make sure that you do not use command die() in php or comments. Also, you should check if css and javascript codes have effects on your site. You can check by moving on to another default active theme or on the backup theme. If the products do not show up, you should have known what the problem is.

Due to cache

This case is rare but it does not mean you will not face it. There are server cache and browser cache. If the cause is server cache, you should contact the hosting and server service supplier and require them to enable the cache so that you can work. If the problem is due to browser cache, you can clear it or use incognito browsers to solve it.

products not showing in woocommerce

You have not published products

You should check if your products are in public status. If they are in another status, they cannot be displayed.

My croatian translation of products is not showing in woocommerce

You may face the case if you use plugins supporting translation such as wpml. The products can be inputted manually or by using import product module.

products not showing in woocommerce

When you face this problem, keep calm, disable each plugin and check again. Maybe plugins conflict together.

Besides, the problem may be caused by the errors in database. If you use wpml, please do as the following guidance.

Firstly, back up your web page including codes and database

  • In back office, get in “WPML > Support
  • Click on “troubleshooting”
  • In “General Cleanup”, click on the following buttons:
  • “Cleanup General” button (if it exists in your setup)
  • “Fix element_type collation” button
  • “Set language information” button

Hope that you can solve your problem. If not, you should contact wpml for support.

You have run through the problem related to products not showing in woocommerce. You must have had your own solution. If you have any idea, please leave a comment below.

woocommerce shipping address not showing in check out page

woocommerce shipping address not showing in check out page is a popular case we often face in wordpress. It happens when you purchase and go to payment step but there is no place to add a delivery address as well as delivery method.

By default, woocommerce just provides customers with only one payment address. Therefore, in checkout page, you do as below if you want to add another address:

Firstly, you get into back office, hover mouse cursor to Woocommerce, and click on Settings

woocommerce shipping address not showing in check out page

Then you click on Shopping as below

woocommerce shipping address not showing in check out page

In Shipping Zones, click on Add shipping zone button in the picture below

woocommerce shipping address not showing in check out page

You input Zone name, and Zone regions according to your needs. Click on Add shipping method to continue

woocommerce shipping address not showing in check out page 

The screen will display as below, you select an appropriate method and click on Add shipping method

woocommerce shipping address not showing in check out page 

You could see the image below, click on Edit to edit information related to this method

woocommerce shipping address not showing in check out page 

You input all required information such as delivery method, and the amount of delivery payment. The amount will be included in the amount of the invoice. Click on Save changes button to save the information.

woocommerce shipping address not showing in check out page 

The problem woocommerce shipping address not showing in check out page has not been solved, you need to do one more step.

Click on Shipping option and select Default to customer shipping address as below

woocommerce shipping address not showing in check out page 

Now you come back to the checkout page to enjoy the fruit. You can add another shipping address

woocommerce shipping address not showing in check out page 

If you get into trouble with woocommerce shipping address not showing in check out page, I believe that you have found the solution after this article. If not, do not hesitate to contact us. If your friends face the same problem, please share this article with them. We and your friends are so grateful for your kindness.

woocommerce customize checkout fields

“ woocommerce customize checkout fields ” is commonly used by users to improve their websites. As far as we know, wordpress in common and open source codes supporting e-commerce in general support users in all around the world. If you want to be different, you need to edit them.

In each nation, or in each region, buyers will have a distinctive purchase and payment habit. It is due to customers’ custom and local law. Therefore, “ woocommerce customize checkout fields ” is always a problem with newbies.

You should notice that the guidance in this article has been tested and used on WooCommerce 3.0 or the later ones. With the older versions, you should not follow this guidance because it may create bugs on your web page. If you want to have a trial, you can work on a backup site in order not to have influences on your web page as well as your revenues.

Add custom checkout fields woocommerce

The below code will help add more fields to the checkout page. For example, you want to add fields to know how old your customers are, which gender they are. Of course, they are just examples. You can add custom fields properly in the context of the real project.

The checkout page interface will have two more fields as below:

woocommerce customize checkout fields

Here is the code content, please copy it and paste in function.php file

// Add a new checkout field
functionht_filter_checkout_fields($fields){
$fields['extra_fields'] = array(
'old_field' =>array(
'type' => 'text',
'required'      => true,
'label' => __( 'How old are you' )
),
'gender_field' =>array(
'type' => 'select',
'options' => array( 'Female' => __( 'Female' ), 'Male' => __( 'Male' ) ),
'required'      => true,
'label' => __( 'What is your gender' )
)
);
return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'ht_filter_checkout_fields' );
// display the extra field on the checkout form
functionht_extra_checkout_fields(){
$checkout = WC()->checkout(); ?>
<div class="extra-fields">
<h3><?php _e( 'Additional Fields' ); ?></h3>
<?php
// because of this foreach, everything added to the array in the previous function will display automagically
foreach ( $checkout->checkout_fields['extra_fields'] as $key => $field ) : 
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
endforeach; 
?>
</div>
<?php }
add_action( 'woocommerce_checkout_after_customer_details' ,'ht_extra_checkout_fields' );
 

Display the extra data on order received page and my-account order review
After carrying out the payment successfully, you get access to order receive page and thank you page

woocommerce customize checkout fields
In order to have the above result, you need to add this code to function file

// display the extra data on order recieved page and my-account order review
functionht_display_order_data( $order_id ){
$order = wc_get_order( $order_id ); ?>
<h2><?php _e( 'Additional Info' ); ?></h2>
<table class="shop_tableshop_table_responsiveadditional_info">
<tbody>
<tr>
<th><?php _e( 'Old Field:' ); ?></th>
<td><?php echo $order->get_meta( '_old_field' ); ?></td>
</tr>
<tr>
<th><?php _e( 'Gender Field:' ); ?></th>
<td><?php echo $order->get_meta( '_gender_field' ); ?></td>
</tr>
</tbody>
</table>
<?php }
add_action( 'woocommerce_thankyou', 'ht_display_order_data', 20 );
add_action( 'woocommerce_view_order', 'ht_display_order_data', 20 );

Display data in backoffice

woocommerce customize checkout fields

woocommerce customize checkout fields will save received data in the back office if you use the code below

// display the extra data in the order admin panel
functionht_display_order_data_in_admin( $order ){  ?>
<div class="order_data_column">
<h4><?php _e( 'Extra Details', 'woocommerce' ); ?></h4>
<?php
echo '<p><strong>' . __( 'Old field' ) . ':</strong>' . $order->get_meta( '_old_field' ) . '</p>';
echo '<p><strong>' . __( 'Gender field' ) . ':</strong>' . $order->get_meta( '_gender_field' ) . '</p>'; ?>
</div>
<?php }
add_action( 'woocommerce_admin_order_data_after_order_details', 'ht_display_order_data_in_admin' );

After the article about woocommerce customize checkout fields ,you must have your own idea. If you want to delete fields, please refer to the previous article which includes detailed guidance on how to delete fields on the checkout page. Or if you do not want to use Prestashop source code, I share with you Custom field module. When using this module, you do not need to know about code. You only need to drag and drop, and design your own site. Besides, you can try using it on the demo site before deciding to have one. This is the module link if you interested   https://addons.prestashop.com/en/registration-ordering-process/27422-custom-fields-registration-form-and-checkout.html

woocommerce remove additional information checkout

woocommerce remove additional information checkout is the way helping us remove unnecessary information on the checkout page. By default, the system has some required fields customers must fill in when carrying out the payment. However, depending on your purposes, you can add or delete fields properly. This article will help you solve the above problem.

If you are a woocommerce newbie, I suggest that you should study the document about it. The document which helps save much time in the future is quite detailed. Right now, we will go straight to the main point woocommerce remove additional information checkout.

woocommerce remove additional information checkout

In order to edit things in the front end of woocommerce, you can install plugin, or find code of woocommerce plugin to edit. However, the safest as well as the most effective way is that you insert code to function file.php. This way ensures that your plugin will not be edited, which facilitates update the system as well as the plugin.

Delete Company and Phone field.

In theme folder of your current website, you move to function.php file and copy the code below and paste in the final part of the file. You could view the comment in code to understand the purpose of each code.

functionwc_ht_remove_checkout_field( $fields) {
  unset( $fields['billing']['billing_company'] );  //  Removes the Company Field.
  unset( $fields['billing']['billing_phone'] );   //  Removes the Phone Field.
 return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

Remove ‘order notes’ from checkout

function wc_ht_remove_checkout_field( $fields) { 
unset($fields['order']['order_comments']); // remove order comment fields 
return$fields; }
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

Remove billing details from WooCommerce checkout

functionwc_ht_remove_checkout_field( $fields) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['order']['order_comments']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_email']);
unset($fields['billing']['billing_city']);
return$fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

Remove shipping fields from WooCommerce checkout

functionwc_ht_remove_checkout_field( $fields) {
// remove shipping fields
unset($fields['shipping']['shipping_first_name']);
unset($fields['shipping']['shipping_last_name']);
unset($fields['shipping']['shipping_company']);
unset($fields['shipping']['shipping_address_1']);
unset($fields['shipping']['shipping_address_2']);
unset($fields['shipping']['shipping_city']);
unset($fields['shipping']['shipping_postcode']);
unset($fields['shipping']['shipping_country']);
unset($fields['shipping']['shipping_state']);
return$fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

 

how to pay an invoice on paypal

If you search for the question “ how to pay an invoice on paypal ”, I immediately believe that you use this payment method unusually when online purchasing. Nowadays, many e-commerce websites support payment on Paypal. You only need to have money in this account, you could stay at home and buy products online. These products will be delivered to your home.

pay an invoice on paypal

Payment on Paypal is quite simple. On the website’s interface, you go to checkout, there will be options in which you can choose to pay on Paypal.

how to pay an invoice on paypal

Next, another window shows up for you to login PayPal

how to pay an invoice on paypal

After login, if your Paypal balance has enough money to cover the payment, “Pay now” button will show up. In case that the account does not have enough money, the system will deduct money from your visa card.

how to pay an invoice on paypal

You just need to click on Continue, the system will automatically deduct the amount of money from the bank account linked to your Paypal.

how to pay an invoice on paypal

 

Besides, you also can create an invoice on Paypal easily.

 

Firstly, you log in your Paypal account. In Tools, you click on Invoicing

how to pay an invoice on paypal

In the next window, you click on Create invoice

In My templates, you click on the dropdown and choose the suitable template.

In Your Business Information, you click on Edit to update information such as logo, name, email, telephone number, etc.

In Bill to, input email or name of customers

In Description, you input product information such as product name, quantity, price per unit, tax rate, and total amount.

Now, there are several operations as below:

In Preview, after you click on preview, you will see how your invoice looks like. If you feel it is okay, you continue to click on Send to transfer money.

If you are creating your invoice on Paypal, because of some reasons, you cannot continue creating, please click on Save as a draft. You can open it and continue working in the future.

how to pay an invoice on paypal

This is an invoice template on Paypal

how to pay an invoice on paypal

The questionthat how to pay an invoice on paypal is easy to answer, it is right? You just need to own a paypal account, you can do this. If someone has the same question, please share this article with them. Thanks for your kindness.

What is the best font for invoice ?

What is the best font for invoice ? This is the question that lots of people are interested in. Different people have different answers. So, in this article, we will find the most appropriate and right answer for you.

No matter which answer you choose, it is right. Because each person has his own thought. The difference is due to the difference in regions, nations, and languages. It is also caused by the difference in ages and hobbies.

What is the best font for invoice

About fonts going with the operating system, classic-style people enjoy using Georgia font while modern-style ones prefer using Calibri or Corbel font. However, according to some interviewees, they feel that using Time New Roman to input contents will be faster.

In the 60s or 70s, people use serif font such as Time font in books. However, after this period, sans-serif font, for example,Helvetica, is preferred. Therefore, people live and work in this period like this font because it is easier to read.

The people who like reading newspaper prefer texts using Time New Roman font, and size 12pt. Maybe it is the reason why The Time newspaper of London delegates another unit to design a font to be used in their newspapers. In 2004, US State Department announces that all documents must use Time New Roman font, and size 14pt.

In short, “ what is the best font for invoice ? ” is a no-right-answer question. It depends on age, time, nation, religion, and region of the users. It is like the question that which color I should paint for my kitchen. If he likes yellow, he will say yellow. However, he has not known that the painted color must depend on the style, windows, furniture, and the space of the kitchen. So the answer for the question type is just relatively right.

Now, you must have had your own answer. But if you still have any problem with “ what is the best font for invoice ? ”, please try Prestashop invoice template. Using this module, you can edit your custom font if you do not want to use the default fonts. You absolutely can preview to see which font matches with the theme you are using to be suitable for your customers’ ages, and market segments.