Access to China

Access to China

Access to China

Start trading in the Chinese markets

Ranging from consumers, wholesalers, agents, and factories, from raw materials to the products in the hands of the consumer. Access to China, a UK based company, has been operating in the Chinese markets for over 20 years with over 100 years of experience among our staff.

Over the last ten years, China has moved most of its trading online. Given the size of the country and cities and 1.4 billion people, the Internet has allowed the country to grow its internal markets. This has allowed consumer prices to be driven down and quality to be greatly increased. Given these and many other benefits, the adoption of Internet technology has been fast in China.

This adoption of new technology does not stop with the internet; green technology adoption is growing very fast. Green tech is seen in China as cheaper, fastest and functionality richer. The Chinese government are driving the development due to the high pollution level in China.

Green technology our focus for 2024. Today, China is the world's largest producer and user of Green technology.

 

Largest online market
Largest online market
Largest online market
Largest online market
Largest online market
Largest online market

Access to the world's largest market

Overseas social media is not available in China. Having your website seen and found is critical to successful business relationship building in China.

Many regions and countries worldwide speak Mandarin, i.e., Taiwan, Singapore, Malaysia, California, Hong Kong, Vietnam and many more. Adding Mandarin language to your SEO data can open your website to trading worldwide beyond China. The Chinese market goes way beyond the 1.4 billion people living in China.

Given the importance of being seen on the internet in China and Chinese markets worldwide, Access to China focus of our business is getting your business, products and services seen online in China.

Chinese green technology
Chinese green technology
Chinese green technology
Chinese green technology
Chinese green technology
Chinese green technology

Chinese green technology

Green Technology is key to most businesses’ growth in the next five years. Chinese Green Technology has been developing rapidly, given consumers and government demands to reduce China's high pollution levels.

Green technology is key to most businesses’ growth in the next five years.

The development of Green Technology is starting to give greater efficiencies, reduce costs, and increase productivity, i.e., electric vehicles; greatly reduced operating costs, greatly improved performance, and improved safety.

We believe Green Technology should give you more, not less.

 

Sourcing from China
Sourcing from China
Sourcing from China
Sourcing from China
Sourcing from China
Sourcing from China

Sourcing products and services from China

For the last 40 years, China has built up its manufacturing base to be one of the most successful in the world.

In recent years, the growth of the Chinese domestic consumer market has increased imports from overseas of high-quality products. In turn, this has driven up the quality of locally produced products. Today, China is moving towards better quality products.

Lower-quality products are moving to other Asian countries.

The global issues, starting with the virus in early 2020 and continuing today with conflicts around the world, resulted in a rethinking of supply chains. The repatriation of manufacturing back to your country using China's production know-how is an option for consideration.

 

Chinese information
Chinese information
Chinese information
Chinese information
Chinese information

Chinese trading information and recommendation

Access to China information and recommendations for your consideration to support your Chinese trading ambitions. In our trading in China for over 20+ years, running and operating Chinese businesses, we have gathered lots of information and recommendations.

  • Short video presentations (coming February 2024)
  • Internet in China information
  • Papers and reports
  • Useful links

We are happy to share this information and are always interested in adding to the pool of information. Any ideas, requests or information, very well.

 

WHMCS V 8.10 sell service with a customer existing Subdomain

 

WHMCS is a website software package that sells IT services.

https://www.whmcs.com

We use this software to support our online and hosting service in China.

https://webtest.accesstochina.com

From time to time, we find we need to add features to the WHMCS software to enable us to sell services or information not currently supported by the WHMCS " out-of-the-box” software.

The good news is that WHMCS has many development tools to support making changes as required.

Below are my notes on how to allow services to be sold with a customer's existing subdomain.

I assume you understand the WHMCS development manual, PHP, PHP templates (TPL) and WHCS hooks.

Background

When selling a service, you often add a domain name; e.g., cloud VPS service typically requires a domain/subdomain to locate the service. Example of a domain sold with a service;

 whmcs example1 800

 

WHMCS supports the following domain sources;

    • New domain purchased from ISP with WHMCS have many integrated suppliers
    • Domain you have already purchased
    • Domain transferred into your ISP domain supplier account
    • Customers own domain
    • Subdomain to one existing domain, e.g., customer-sub-domain.b2b66.icu (b2b66.icu is a domain own my business). It is not a subdomain owned by the customer's domain.

 

WHMCS currently does not support customers using their subdomain.

Changes needed WHMCS

Four files need creating/changing.

    • Based on using WHMCS standard template:
      • twenty-one -> orderform -> configureproductdomain.tpl
    • javascript
      • twenty-one -> orderform -> standard_cart -> js -> scripts.min.js
    • Two new hooks
      • ShoppingCartValidateDomain
      • ShoppingCartViewCartOutput

Recommended steps

Please note that these are the steps I took to make changes. I am publishing them as a guide, and they should be tested in a backup development system. Each install of WHMCS can be different based on the version and modules installed.  

If you do not have development services, I recommend not installing these changes in your production system. You can request a development license key from WHMCS, create a copy of your production system, and check they work in your service environment.

1. Create a complete backup of your WHMCS system

2. Make a copy of the twenty-one orderform start_cart directory

    • templates/orderforms/standart_cart -> templates/orderforms/standard_cart2
    • In WHMCS system setting -> general settings -> ordering (tab) select new template name (in this case, standard_cart2). In doing this, you can return to the original template if needed)

3. Create a new field in the template configureproductdomain.tpl for the subdomain;

whmcs example2 800

 

    • Search the template for “{if $owndomainenabled}”. This will give the section of coding needing a change.
    • Add a new input field for the subdomain. Do not call the field “subdomain”. WHMCS already uses this name. I used “subd” and “owndomainsubd”;

                <div>

  <input type="text" id="owndomainsubd" value="{$subd}" placeholder="Subdomain" class="form-control" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="Subdomain" />

</div>

<input type="text" id="owndomainsld" value="{$sld}" placeholder="Domain" class="form-control" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.enterDomain'}" />

 

    • Review and adjust as required and update the CSS if needed

4. Update the scripts.min.js to make the new data available to Hook

    • We recommend that you reformat the scripts.min.js file into a readable format. I copied the JS code into the JavaScript Beautifier. There are many tools on the Internet for reformatting coding.
    • In the routine, add line “subd”

 jQuery(".domain-selection-options .option").removeClass("option-selected"), jQuery(this).parents(".option").addClass("option-selected"), jQuery(".domain-input-group").hide(), jQuery("#domain" + jQuery(this).val()).show()

    }), jQuery("#frmProductDomain").submit(function(e)  e.preventDefault();

        var t = jQuery(this).find('button[type="submit"]'),

          e = jQuery("#DomainSearchResults"),

            n = jQuery("#spotlightTlds"),

            o = jQuery("#domainSuggestions"),

            f = jQuery("#btnDomainContinue"),

            i = jQuery(".domain-selection-options input:checked").val(),

            a = jQuery("#" + i + "sld"),

            r = a.val(),

            s = "",

            subd = jQuery("#owndomainsubd").val(),

            d = jQuery("#frmProductDomainPid").val(),

            l = "",

            m = jQuery("#idnLanguageSelector");

    • Second change to the JS, again adding “subd”;

 jQuery(".domain-selection-options .option").removeClass("option-selected"), jQuery(this).parents(".option").addClass("option-selected"), jQuery(".domain-input-group").hide(), jQuery("#domain" + jQuery(this).val()).show()

    }), jQuery("#frmProductDomain").submit(function(e) {

        e.preventDefault();

        var t = jQuery(this).find('button[type="submit"]'),

            e = jQuery("#DomainSearchResults"),

            n = jQuery("#spotlightTlds"),

            o = jQuery("#domainSuggestions"),

            f = jQuery("#btnDomainContinue"),

            i = jQuery(".domain-selection-options input:checked").val(),

            a = jQuery("#" + i + "sld"),

            r = a.val(),

            s = "",

        subd = jQuery("#owndomainsubd").val(),

            d = jQuery("#frmProductDomainPid").val(),

            l = "",

            m = jQuery("#idnLanguageSelector");

    • Save the JS file and check that the template is still functioning as before. The subdomain will not be processed until the hooks are created. It is good to check that the changes have not added new bugs to the system.

5. Create ShoppingCartValidateDomain hook

    • Create a PHP file in /includes/hooks/ directory e.g. subdomainvalidate.php

<?php

add_hook('ShoppingCartValidateDomain', 1, function($vars) {    

/// Clear session values

                $_SESSION['subd'] = '';

                $_SESSION['newdomain'] = '';    

//            logActivity('POST Data: ' . var_export($_POST, true));

               

/// set domain  

                $newdomain = isset($_POST['domain']) ? $_POST['domain'] : '';

                logActivity('ShoppingCartValidateDomain - New Domain: ' . $newdomain);

                $_SESSION['newdomain'] = $newdomain;           

/// set subdomain          

                $subd = isset($_POST['subd']) ? $_POST['subd'] : '';

//            logActivity('ShoppingCartValidateDomain - Subdomain: ' . $subd);

                $_SESSION['subd'] = $subd;        

//            logActivity('Session Data: ' . print_r($_SESSION, true), 0);                              

});

    • The hook is only performed when validating a domain name.
    • This script collects the data from the template and creates session values for the next hook.
    • The logActivity is helpful if you need to debug.

6. Create ShoppingCartViewCartOutput hook

    • Create a PHP file in /includes/hooks/ directory e.g. viewcartoutput.php

<?php

if (isset($_SESSION['cart']['products']) && isset($_SESSION['subd']) && !empty($_SESSION['subd'])) {

                foreach ($_SESSION['cart']['products'] as $key => $product) {

                               if (isset($product['domain']) && $product['domain'] === $_SESSION['newdomain']) {

               $_SESSION['cart']['products'][$key]['domain'] = $_SESSION['subd'] . '.' . $product['domain'];

               } } }         });

    • The hook will perform each time the cart is open
    • It will add the subdomain name to the correct domain name and not all domain names in the cart.
    • Below is an example of the output

whmcs exampe3 800

 

Last modified: Version 1.1 - 25 January 2025