Skip to content

Commit a7d981a

Browse files
apescharTsankoBg
andauthored
Update sidebar script (#2)
* Update sidebar script * Use dashboard domain * Update domain names * Change WWK_DOMAIN back to APP_DOMAIN * Fix release file naming Co-authored-by: tsanko <tsankohadzhiev@gmail.com>
1 parent a8b61a7 commit a7d981a

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

bin/package

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mkdir -p dist
99

1010
pathspec="README.txt upload"
1111
version="$(git describe --tags --match 'v*')"
12-
out="$PWD/dist/opencart3-webwinkelkeur-$version.zip"
12+
out="$PWD/dist/opencart3-webwinkelkeur-$version.ocmod.zip"
1313

1414
echo "Packaging version $version" >&2
1515

upload/catalog/controller/extension/module/webwinkelkeur.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ private function getScript() {
112112
}
113113

114114
return
115-
'<script>_webwinkelkeur_id=' . (int) $this->settings['shop_id'] . '</script>' .
116-
'<script async src="https://' . $this->msg['APP_DOMAIN'] . '/js/sidebar.js"></script>';
115+
sprintf("<script>(function(url,id){var script=document.createElement('script');script.async=true;script.src=url+'/sidebar.js?id='+id+'&c='+cachebuster(10,id);var ref=document.getElementsByTagName('script')[0];ref.parentNode.insertBefore(script,ref);function cachebuster(refreshMinutes,id){var now=Date.now();var interval=refreshMinutes*60e3;var shift=(Math.sin(id)||0)*interval;return Math.floor((now+shift)/interval);}})('https://%s',%d);</script>", $this->msg['DASHBOARD_DOMAIN'], (int) $this->settings['shop_id']);
117116

118117
return $o;
119118
}

upload/catalog/model/extension/module/webwinkelkeur.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function sendInvites($debug = false) {
8282
$post['order_data'] = json_encode($this->getOrderData($order));
8383
}
8484

85-
$url = 'https://' . $msg['API_DOMAIN'] . '/api/1.0/invitations.json?' . http_build_query($parameters);
85+
$url = 'https://' . $msg['DASHBOARD_DOMAIN'] . '/api/1.0/invitations.json?' . http_build_query($parameters);
8686
$retriever = new Peschar_URLRetriever();
8787
$response = $retriever->retrieve($url, $post);
8888
if($this->isInviteSent($response)) {

upload/system/library/webwinkelkeur-messages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
'INVITE_GENERIC_ERROR' => 'De Webwinkelkeur-server kon niet worden bereikt.',
3333

3434
// catalog
35-
'API_DOMAIN' => 'dashboard.webwinkelkeur.nl',
35+
'DASHBOARD_DOMAIN' => 'dashboard.webwinkelkeur.nl',
3636
'APP_DOMAIN' => 'www.webwinkelkeur.nl'
3737
);

0 commit comments

Comments
 (0)