How to Update your Payment Method on CartFlows Store?

How to Update your Payment Method on CartFlows Store?

Updating your payment method on CartFlows store can be done in a quick few steps –

Step 1: Login to your account on CartFlows store.

Step 2: Click on the Subscriptions option from the Sidebar

Step 3: You will see a list of your active Subscriptions. Now click on the View option of the CartFlows – Annual license.

Step 4: Click on the Add Payment option as shown below

Step 5: Enter your relevant payment details and save them by clicking on Add Payment Method.

VAT Field of WooCommerce EU/UK VAT Compliance (Premium) plugin is not displaying.

VAT Field of WooCommerce EU/UK VAT Compliance (Premium) plugin is not displaying.

If you are using the 「WooCommerce EU/UK VAT Compliance (Premium)」 by 「David Anderson」 to add the VAT field on the checkout page and it is not displaying then this article will help you to display that field on the CartFlows Checkout field.

The VAT field is used to add the VAT number or the VAT amount on the checkout page on the WooCommerce Platform.

This VAT field is not required to all of the stores or countries but only required by the European countries and any other to force the country』s rules and regulations for better compliance.

While using 「WooCommerce EU/UK VAT Compliance (Premium)」, configure it completely and check that the VAT field is getting displayed on the default checkout of WooCommerce.

If that field is not displayed on the default checkout page of WooCommerce then it will not be displayed on the CartFlows Checkout page. So, to make it work with CartFlows, it is mandatory that the VAT field should be displayed on the default WooCommerce Checkout page.

The 「WooCommerce EU/UK VAT Compliance (Premium)」 plugin adds an input field on the checkout page. The label of that field will be the same which you have set from that plugin』s setting.

If that field is displayed on the default checkout page of WooCommerce and not on the CartFlows page, then this is because CartFlows modifies the checkout fields including the billing and shipping fields with our own custom field editor and as per the design of the checkout page.

These modifications are made using the default WooCommerce』s actions and filters. Due to these modifications, the priorities of those fields are changed and thus any other custom field added by the third-party plugin may or may not be displayed on the CartFlows Checkout page.

To display this field, the plugin 「WooCommerce EU/UK VAT Compliance (Premium)「 has provided a filter to change the location of that field. So that we can decide where else we have to display the field, such as after billing fields, or after shipping fields, or even after the checkout form, etc etc.

Below is the code using which you can easily display the VAT field on the CartFlows checkout page.

add_filter( 'wc_eu_vat_number_position', 'eu_change_vat_number_position', 10, 1 );

/**
* Function to change the position of VAT field only for the CartFlows checkout page.
*
* @param $current_page current visited page
* @return $current_page current page.
*/
function eu_change_vat_number_position( $position ){

/* Get global post object */
global $post;

/* Get current post type */
$post_type = get_post_type();

/* Check the current type of the page */
$is_checkout = get_post_meta( $post->ID, 'wcf-step-type', true );

/* Change position only of the CartFlows checkout page */
if( 'cartflows_step' == $post_type && 'checkout' === $is_checkout){
$position = 'woocommerce_after_order_notes';
}

return $position;

}

Note: Add the above filter to your child theme』s functions.php, here』s an article to help you Add Custom code.

How to Allow Cache Plugins to Cache the CartFlows Pages?

How to Allow Cache Plugins to Cache the CartFlows Pages?

You might be thinking that why does the CartFlows Pages are not getting cached. Well, the only reason is that from the beginning of the CartFlows development, we have added Do not Cache constant on the CartFlows pages so as to restrict them to be cached from the Cache plugins and avoid unnecessary issues.

DONOTCACHEPAGEDONOTCACHEOBJECTDONOTCACHEDB

Some cache plugins look for these constants. If one of these constants is found then those cache plugins do not cache the page i:e it is excluded automatically.

If you want to cache the CartFlows pages and remove these constants and allow your cache plugins to cache the pages then you can disable this feature on your website and for the same, we have provided the following filter –

/*
* How to add the custom code.
*
* Please follow below instructions:
* 1. Copy the below code.
* 2. Open your child theme's functions.php file.
* 3. Paste the copied code at the very bottom of it & save the file OR upload it on your server/hosting.
*/

add_filter( 'cartflows_do_not_cache_step', 'cache_CartFlows_pages' );

function cache_CartFlows_pages( $post_id ) {

// If you want to remove more pages from the cache then add those page's id in the array.

if( in_array( $post_id , array( 'add_your_landing_page_ids_comma_separated_id_more_than_one' ) ) ){
return false; // Cache the Pages.
}

return true; // Do Not cache.
}

Note: Add the above filter to your child theme』s functions.php, here』s an article to help you Add Custom code.

How to Resolve 「Cannot Activate API Key. Key Already Activated with the same Instance ID」 Error Message?

How to Resolve 「Cannot Activate API Key. Key Already Activated with the same Instance ID」 Error Message?

Are you facing the 「Cannot Activate API Key. The API Key has Already been Activated with the same Unique Instance ID Sent with This Request」 error message while activating the CartFlows Pro API License and wondering what is the reason and searching for the solution at the same time.

Well, I bet you are on the right article. Let』s see then.

This message will be displayed on the plugins page in the license activation popup window while activating the license. There are only a couple of cases in which you will get this error message.

Below we have explained the cases in which this error may occur –

First: If the site is cloned/migrated:

If the website is cloned or migrated from one hosting/domain to another there might be a chance that the instance for the license activation is not set or not updated while migration. Here, an old instance ID is stored on the migrated/new website and when you try to activate the license, the same I:e old Instance ID is sent which was related to the parent domain. This results in showing the message.

Second: Plugin Upload/Delete/Remove

If the CartFlows Pro plugin is deleted or removed from the website without deactivating the license first and then when you re-upload the CartFlows Pro plugin and tries to activate the License.

Third: Cache

If any cache is set on your website then the instance ID that is generated automatically while activating the CartFlow Pro plugin does not get stored in the database while activating the license for the first time and not in the cache as well.

As there is the same instance ID is sent while sending a license activation API request, The API validator checks all the parameters and checks the same instance is attached to any activated domain. If the instance ID is attached to the domain and the request is from another domain then it returns this same instance ID error message. 

To solve this problem and activate the CartFlows Pro license on your website you can follow below simple steps.

Step 1: Log in to your account at my.cartflows.com

Step 2: Go to API/License section/tab

Step 3: You will see an entry for the current website on which you had activated the license.

Step 4: Delete that entry from the account of that domain/website.

Step 5: Login to your wp-admin account on your website.

Step 6: Clear all the cache on your site including your browser's cache. This must include the Local & Server-Side cache too.

Step 7: Go to plugins menu on your website.

Step 8: Deactivate any Cache plugin [ For sometime ]

Step 9: Deactivate the CartFlows Pro plugin. [ For sometime ]

Step 10: Re-activate the CartFlows Pro plugin.

Step 11: Click on the activate license button

Step 12: Add your license/API key.

Step 13: Click on activate button. 

Note: Always clear the cache and deactivate the Cache plugin before activating the CartFlows Pro』s license/API key on your website.

How and Where to Add the Custom JS, CSS & PHP Codes?

How and Where to Add the Custom JS, CSS & PHP Codes?

In this article, you will get to know on how to add the custom JavaScript, CSS & PHP code on your website to achieve your custom requirements –

Note: We recommend to add the Custom PHP code or any JavaScript related code to the child theme』s functions.php file. 

If you have a question about What is Child Theme and how to create it and where to add it. Then the following article will help you on How to Create a WordPress Child theme.

Next, in order to add any custom code to its proper location for proper working, you need to identify among the type of code that you have received.

How to Identify the Javascript code?

Usually, the Javascript code is always enclosed in the opening & closing of scripts tags. i:e . For example https://www.w3schools.com/tags/tag_script.asp

How to identify the CSS code?

The CSS code is simple to identify as this code does not contain any dynamic variables. Usually, the CSS code is enclosed in the opening & closing of scripts tags. I:e . But in most cases, the CSS code is provided without the style tags. Such as .div{ display: none: }.  You can refer to this article for more information: https://www.w3schools.com/html/html_css.asp

How to identify the PHP code?

Usually it is known to the developer who has written the code, but if you are a store owner and don』t know the type of code then either ask your developer or ask the concerned member who has provided the code for the type of the code. Usually, the PHP code is enclosed in the PHP script that starts with . For more information visit: https://www.w3schools.com/php/php_syntax.asp

Below are the steps to add the various steps that will help you to add the below types of code on your website –

Add custom JavaScript codeAdd custom CSSAdd custom PHP code

Let's go though all of them with detailed steps: 

1. How and where to add the custom javascript code?

There are two ways to add the Custom Javascript code on the CartFlows pages as mentioned below –

To add the Custom JavaScript on the CartFlows pages we have provided the Custom Script Tab in the backend setting of each page of the CartFlows. You have to add the created/received custom JS in this field and that will be automatically added on the head section of that CartFlows page only in which you have added the script.

Now, if you want to add the script to all your website pages at the same time, then this Custom Script Tab will not help. This will need more access to be added on all the pages. This requirement is possible to add the custom script from the PHP code from your child theme』s functions.php.

You can directly add the JS code in the head section of the page using the wp_head action but if you want to add your custom JS file then you need to use the wp_enqueue_script action. This action is used to register and add a new JS fine on the website.

Following are some more information on wp_head & wp_enqueue_script action hooks: 

wp_head()wp_enqueue_script()

2. How and where to add the custom CSS code?

There are two ways to add the CSS code to your website. The first way is by adding the CSS through your theme』s customizer from the Additional CSS tab section.

The CSS added from this section will be added globally on your website means it will add the CSS on all the pages of your website.

The second way to add the custom CSS to your website is by creating a child theme and add the CSS code in the child theme』s style.css file. We recommend that if you want to do any customizations then you can do it from the child theme so as to avoid the data loss when you update the parent theme.

3. How to and where to add the custom PHP code.

The simple way to add the custom PHP code on your website is by using the code snippets plugins. These types of plugin provide great flexibility to non-techie users to add any Custom Code on their website more effectively. 

But If you want to add the custom PHP code without using any extra plugin then we suggest to add it by creating a child theme. 

Once the Child Theme is created then it will have the functions.php file and where you have to add your custom PHP code.

All the themes of your website will be located at your_website』s_root_folder/wp-contents/themes/all_your_themes_folders directory. Now, you have to add the created child theme, in the themes directory of your website.

Note: It is recommended adding the Custom Code to the child theme』s functions.php file, in order to avoid any data loss while updating the Parent Theme.

How to Delete the Plugin』s Data While Un-Installing the Plugin

How to Delete the Plugin』s Data While Un-Installing the Plugin

We have introduced a new option which will help to delete the CartFlows & CartFlows Pro』s data while deleting/uninstalling the plugin. We have introduced this option in the 1.6.11 version of the CatFlows.

This setting will be useful to remove unwanted data and setting options from the database while removing the plugin completely.

This setting will delete the CartFlows option』s data and CartFlows Global Setting and will not delete the already created flows from the database. You have to delete it manually first and then delete/uninstall the plugin by enabling the delete data option to remove all the CartFlows data.

This setting is located on the setting page of the CartFlows under other settings tab.

Below are the very few and simple steps to enable this option.

Step 1: Go to CartFlows -> Settings -> Other Setting Tab

Step 2: Click on the checkbox to enable the Delete Plugin Data option.

Step 3: An alert will be displayed to confirm the action.

Step 4: Enter 「DELETE」 in capital letters to confirm the action.

Step 5: Click the Save Setting button to save the changes.

How to Enable the Theme』s Scripts & Styles without Changing the Page Template?

How to Enable the Theme』s Scripts & Styles without Changing the Page Template?

You may be looking for an answer as to why are your CartFlows pages do not display your theme』s Header & Footer?

Well, there's the following reason behind it –

From the beginning, when the CartFlows plugin was released, we intentionally didn't load the theme』s Header & Footer on the CartFlows pages to avoid any unnecessary conflict with the CartFlows pages. And to ensure more flexibility in design as well as in the creation of distraction-free funnel pages.

Note: If you want to add your theme's header & footer on the CartFlows pages then you need to change the page template to default. Refer to this article.

But you must be thinking why you need to change the page template if you want to add the theme』s headers and footer on the CartFlows pages. Well, that is the default way and the correct way to add the theme』s header footer. 

But in some cases, your page is displaying the header & footer in distorted format i:e without the CSS while you are not using the 「Default」 page template so, you want to either remove it or display in proper format then, you can use the following filter to load the theme』s styles & scripts.

This filters can also be used in those cases, where you just want to load the theme's styles & scripts on the CartFlows pages.

/**
* Filter to load theme's styles & scripts.
*
* @param bool $remove_styles true/false
* @return bool $remove_styles true/false
*/

add_filter( 'cartflows_remove_theme_styles', 'wcf_load_theme_files', 10, 1 );
add_filter( 'cartflows_remove_theme_scripts', 'wcf_load_theme_files', 10, 1 );

function wcf_load_theme_files( $remove_styles ){

$remove_styles = false;

return $remove_styles;
}

Note: Add the above filter to your child theme』s functions.php, here』s an article to help you Add Custom code.

How to Enable Paypal Reference Transactions?

How to Enable Paypal Reference Transactions?

Before, when using One-Click Upsell for WooCommerce with CartFlows, it is required that you enable PayPal reference transactions for it to work. But now, you can already offer WooCommerce One-Click Upsells even without enabling it. Learn more about this here.

Although enabling PayPal reference transactions is not required, but if you are offering Upsell / Downsell from CartFlows here are the steps on how you can get this enabled for one-click Upsell –

Step 1. Log into your PayPal account. Note that you should have a business account.

Step 2. Go to: https://www.paypal.com/smarthelp/contact-us

Step 3. Scroll down to the button and you will find the option to Call the support.

Step 4. You'll be redirected to a page with the dialing instructions.

Step 5. Choose the Technical Support and request for enabling PayPal reference transactions.

Step 6. After enabling PayPal Reference Transactions from PayPal account you have to enable reference transactions from the CartFlows settings as well.

Related Articles –

How Does Paypal/Stripe Work in the Case of CartFlows?

How Does Paypal/Stripe Work in the Case of Cartflows?

How Does Paypal/Stripe Work in the Case of Cartflows?

CartFlows supports Supports PayPal Standard & PayPal Express Checkout & Stripe.

I. PayPal Standard :

Below are the things that are necessary to accept the payments

Enable PayPal Standard CheckboxEnable PayPal sandbox checkbox if you want to enter the test payment disable it when you want to accept the live paymentEnable logging Checkbox to record any error if occurredEnable IPN email notificationsIf you are enabling the 「IPN email notifications」 then you must have to enter the 「PayPal identity token「Set Payment action to the 「Capture」 optionEnter API credentialsEnter Sandbox API credentials for sandbox if the testing mode is enabledEnter Live API credentials want to accept the live payment

For more info: https://docs.woocommerce.com/document/paypal-standard/

II. PayPal Express Checkout:

Below are the things that are necessary to accept the payments

Enable PayPal Checkout CheckboxSet the Environment to live/sandboxAdd the sandbox/live API Credentials to accept the paymentIn the 「Advanced Settings「, Section enable the Debug LogGo to CartFlows -> Setting -> Enable the Reference Transactions. ( What are Reference Transactions? )

For more info: https://docs.woocommerce.com/document/paypal-express-checkout/

III. Stripe:

Below are the things that are necessary to accept the payments

Enable Stripe checkboxEnable Test mode if you want to test the payment.Add Live/Test Publishable KeyAdd Live/Test Secret Key

For more info: https://docs.woocommerce.com/document/stripe/

Frequently Asked Questions about the Working of PayPal/Stripe!

Does the user have to activate auto-redirect on PayPal account after payment so that it should be redirected to the upsell?

No, not compulsory.

Does the user have to add the identity token to the WooCommerce's PayPal settings?

Yes, if the IPN email notification is enabled.

What are Reference Transactions?

Reference Transactions allow you to set a Billing Agreement between a merchant and customer at the time of checkout. This Billing Agreement with the customer allows you to charge the customer at a later time.

Why Reference Transactions?

To run true 「One Click」 Upsell, CartFlows uses Reference Transactions to enable One Click Upsells after checkout. It utilizes a Billing agreement between you and your customer and charges the customer if the offer is accepted.

Can I run upsells if the reference transaction is off in my PayPal account?

Yes! You can run up-sells even if reference transactions are off. The only change in flow that it would need, one additional confirmation from PayPal to process the payment. So it』s two-click up-sells. To understand the difference in detail

How to start the process of enabling Reference Transactions?

You can also contact PayPal via email.Log into your PayPal account.Go to the Email Contact Form.Choose topic: My Account.Choose sub-topic: Changing/Updating Account Information.Copy and paste the message below, inserting your PayPal email address and name.

Hello Team,I am "Your Name", I want to enable Reference Transactions on my PayPal account. This is the email: enter@your_email.com.I need this feature to sell post-purchase upsells or one-click upsells via WooCommerce.Let me know the process.Kind regards,Your Name

Wait for their reply.

Note: The process can vary from one country to another but you can speed up the process by calling PayPal customer care directly.

How to Pass Variable as Query Parameters to URL?

How to Pass Variable as Query Parameters to URL?

Why is it Required?

We have an option in the backend for the Optin step to enable this functionality that will pass the fields values to the next page from the URL parameters.

By passing the variables from the URL you can create a custom code to display the personalized message or use it for certain scenarios wherein you can send the data to your CRM System using the custom code.

How to use this feature?

Enabling this option is super easy. Below are the steps that you can follow –

Step 1: Goto CartFlows -> Flows -> Your Flow

Step 2: Click Edit Button on Optin Step

Step 3: Navigate to the Optin Setting metabox -> Settings tab -> Enable the Pass Fields as URL Parameters option.

Step 4: Add the field name which you want to send in the URL as a Parameter

On enabling this setting, you will see the first_name added by default, you can pass the value as per your requirement and see it mapped to the URL and can be used as per your requirement.

If you want to send multiple fields in the URL then you can add them in a comma separated format. Such as, first_name, last_name, email.

Using this parameter you can send the custom fields as well if they are created from the CartFlows custom field editor which is available in the Pro version of the CartFlows on the optin page.

Note: The optin page field name starts with the 「billing_」 key such as billing_first_name, billing_last_name. So, you have to add the field name without the 「billing_」 prefix.