diff --git a/templates/product_simulator.php b/templates/product_simulator.php index 1fdcafd..8986539 100644 --- a/templates/product_simulator.php +++ b/templates/product_simulator.php @@ -45,6 +45,18 @@ function checkSimulatorContent() { return simulatorLoaded; } + function moveToPrice() + { + if ('' === 'sdk.simulator.types.SELECTABLE_TEXT_CUSTOM') { + var simnode = document.querySelector(findPositionSelector()); + + var detailnode = document.getElementsByClassName('woocommerce-product-details__short-description'); + detailnode = detailnode['0']; + + detailnode.parentNode.insertBefore(simnode,detailnode) + } + } + function checkAttempts() { window.attempts = window.attempts + 1; return (window.attempts > 4) @@ -53,7 +65,6 @@ function checkAttempts() { function prependSeparator() { var node = document.querySelector(findPositionSelector()); - var textnode = document.createTextNode(); var spannode = document.createElement("span"); spannode.style.cssText = 'margin-right:5px'; @@ -73,8 +84,6 @@ function loadSimulatorPagantis() return finishInterval(); } - var price = ''; - var country = ''; var locale = ''; var sdk = pgSDK; @@ -96,7 +105,7 @@ function loadSimulatorPagantis() thousandSeparator: '', decimalSeparator: '' }, - numInstalments : '', + numInstalments : '', skin : , position: }; @@ -107,6 +116,7 @@ function loadSimulatorPagantis() if (typeof sdk != 'undefined') { window.WCSimulatorId = sdk.simulator.init(simulator_options); + moveToPrice(); return false; } } @@ -126,4 +136,4 @@ function loadSimulatorPagantis() echo $promotedMessage; } ?> -
+