Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Jan 13, 2020
1 parent 27c0b6f commit 4dd8b02
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 30 deletions.
39 changes: 33 additions & 6 deletions README.md
Expand Up @@ -17,11 +17,38 @@



## Download the white-label template for your Microweber site
## Set the template

1. Download Microweber White Label Template from https://github.com/microwebertemplates/whitelabel
2. Upload the content of zip in /public_html/userfiles/templates/whitelabel/ . You must to create the directory “whitelabel”.
3. Open your main site URL and proceed to install as you need to select SQLite DB, Microweber White Label Template and Install Default content
4. Set WHMCS url on your website
1. Go to Setup -> General Settings
2. Set the template to "Mw-sitebuilder"
3. Visit your website

![whmcs_plugin.png](modules/addons/microweber_addon/order/assets/set_mw_whmcs_module.png "")

![whmcs_plugin.png](modules/addons/microweber_addon/order/assets/set_mw_whmcs_module_template.png "")




# Setup your server

* If you have __*cPanel & WHM*__ you can install the plugin from here [cPanel Plugin](https://github.com/microweber-dev/cpanel-plugin)
* If you have __*Plesk*__ you can install the plugin from here [Plesk Plugin](https://github.com/microweber-dev/plesk-plugin)
* If you don't have cPanel or Plesk you can use the Cloud Connect setup from here [Cloud Connect](./modules/servers/microweber_cloudconnect/README.md)





## How to edit the order process

If you wish to edit the order process and customize the designs, you can do it in the following way,

1. All order forms are located in `modules/addons/microweber_addon/order/` folder
2. Copy the folder `whitelabel` and rename it to something else for example `mybrand`
3. Open the file `templates/mw-sitebuilder/header.tpl` and change the embed code parameter of the style attribute for. For example `<script src="{$WEB_ROOT}/modules/addons/microweber_addon/order/embed.js?style=whitelabel&target=top"></script>` will become or example `<script src="{$WEB_ROOT}/modules/addons/microweber_addon/order/embed.js?style=mybrand&target=top"></script>`
4. Edit your text and style on your order forms from the folder `modules/addons/microweber_addon/order/mybrand`


# Troubleshooting

If you have any problems please post them in the issues section.
6 changes: 6 additions & 0 deletions modules/addons/microweber_addon/microweber_addon.php
Expand Up @@ -108,6 +108,12 @@ function microweber_addon_clientarea($vars)
}

if ($resp) {


header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Credentials: true');
echo json_encode($resp, JSON_PRETTY_PRINT);
exit;

Expand Down
4 changes: 4 additions & 0 deletions modules/addons/microweber_addon/order/.htaccess
@@ -1 +1,5 @@
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header set Access-Control-Allow-Credentials "true"


Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions modules/addons/microweber_addon/order/embed.js
Expand Up @@ -57,18 +57,18 @@
if (typeof windowhash === 'string' && windowhash.indexOf('frameurl=') > -1) {
var hash = windowhash.split('frameurl=')[1];
var hash = decodeURI(atob(hash))
iframe.src = hash;
// iframe.src = hash;
} else {
iframe.src = path + '/index.php?' + $params;
iframe.src = path + '/index.php?' + $params;
}

//alert(iframe.src);
script.parentNode.insertBefore(iframe, script.nextSibling);

addEventListener('message', function (e) {

if (typeof e.data === 'string' && e.data.indexOf('frameLocation:') > -1) {
var hash = e.data.split('frameLocation:')[1];
window.location.hash = 'frameurl=' + (btoa(encodeURI(hash)))
// window.location.hash = 'frameurl=' + (btoa(encodeURI(hash)))
}
if (typeof e.data === 'string' && e.data.indexOf('documentHeight:') > -1) {
var height = e.data.split('documentHeight:')[1];
Expand Down
5 changes: 3 additions & 2 deletions modules/addons/microweber_addon/order/test.html
Expand Up @@ -9,11 +9,12 @@




<script src="https://members.microweber.com/modules/addons/microweber_addon/order/embed.js?param=test&otherparam=22" crossorigin="anonymous"></script>
<script src="http://whmcs.dev.microweber.com/modules/addons/microweber_addon/order/embed.js?style=whitelabel&target=top"></script>


</BODY>


</HTML>


22 changes: 6 additions & 16 deletions modules/addons/microweber_addon/src/views/embed_codes.php
@@ -1,32 +1,22 @@

<a href="javascript: void(0)" onclick="$('#mwembedcodepreholder').toggle();">Show embed code</a>

<div id="mwembedcodepreholder" style="display: none">

<pre>
&#x3C;script src=&#x22;<?php print $config['SystemURL'] ?>/modules/addons/microweber_addon/order/embed.js&#x22; id=&#x22;domain-search-iframe-js&#x22;&#x3E;&#x3C;/script&#x3E;
You can use this embed code on any website to show domain search field.

<pre >
&#x3C;script src=&#x22;<?php print $config['SystemURL'] ?>/modules/addons/microweber_addon/order/embed.js?style=whitelabel&target=top&#x22; id=&#x22;domain-search-iframe-js&#x22;&#x3E;&#x3C;/script&#x3E;
</pre>

</div>




Embed embed



<script>



</script>



<code>
<?php

print_r($config);
?>


</code>
6 changes: 5 additions & 1 deletion modules/addons/microweber_addon/src/views/index.php
Expand Up @@ -281,6 +281,11 @@

</div>


<?php include_once "embed_codes.php"; ?>



</div>


Expand All @@ -292,7 +297,6 @@
<?php //print_r($enabled_templates) ?>
<!-- </pre>-->

<?php //include_once "embed_codes.php"; ?>

</div>

Expand Down
14 changes: 13 additions & 1 deletion modules/servers/microweber_cloudconnect/README.md
@@ -1 +1,13 @@
# WHMCS Cloud Connect
# WHMCS Cloud Connect

1. Go to `Setup -> Product Services -> Servers` and add new server
2. On hostname enter the hostname of your Microweber server provider. For example: `members.microweber.com`
3. In `Server Details` select `Microweber Cloud Connect` as a server type
![Microweber Cloud Connect](assets/cloud_connect.png "")
4. Enter you access hash and click "Test Connection"
5. Go to your `Setup -> Product Services` and Add or edit plan. From the plan module choose `Microweber Cloud Connect` from the Module Settings ![Microweber Cloud Connect](assets/server_setup.png "")





Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4dd8b02

Please sign in to comment.