Skip to content

Instantly share code, notes, and snippets.

@tomhat
Last active April 3, 2020 02:57
Show Gist options
  • Save tomhat/96ebec8f506d2a97d135568a5bf5ff8e to your computer and use it in GitHub Desktop.
Save tomhat/96ebec8f506d2a97d135568a5bf5ff8e to your computer and use it in GitHub Desktop.
Mlritz 完了画面で商品タグから特定サイトへリダイレクトするシェル
(function(){
var TARGET_URL = 'https://example.com/items/';
var SUFFIX = '/?type=thanks';
var tagUID = [%comodity_tag_uid_list%];
for(var i = 0,len = tagUID.length;i < len;i++){
if( tagUID[i] == 1 ){
var itemID = '%productid%';
if( itemID.indexOf('-') >= 0 ){
itemID = itemID.substring(0,itemID.indexOf('-'));
}
location.href=TARGET_URL+itemID+SUFFIX;
return ;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment