19 Event.observe(window,
'load', recalculateTax);
20 Event.observe(window,
'load', registerTaxRecalcs);
22 function registerTaxRecalcs() {
23 if (typeof dynamicTaxes ==
'undefined') {
27 for (var i = 0; i < dynamicTaxes.length; i++) {
28 Event.observe($(dynamicTaxes[i]),
'change', recalculateTax);
30 Event.observe($(
'tax_class_id'),
'change', recalculateTax);
33 var priceFormat = <?= $this->helper(
'Magento\Tax\Helper\Data')->getPriceFormat(
$block->getStore()) ?>;
34 var taxRates = <?=
$block->getAllRatesByProductClassJson() ?>;
36 function recalculateTax() {
37 if (typeof dynamicTaxes ==
'undefined') {
41 for (var i = 0; i < dynamicTaxes.length; i++) {
42 var code = dynamicTaxes[i];
43 var span = $(
'dynamic-tax-' + code);
52 taxClass = $(
'tax_class_id').options[$(
'tax_class_id').selectedIndex].value,
53 value = taxRates[
'value_' + taxClass];
55 if (
value != undefined) {
61 spanValue =
' ' + formatCurrency(input.value / (100 + rate) * rate, priceFormat);
63 span.innerHTML = spanValue;
68 function bindActiveProductTab(event,
ui) {
69 var anchor =
jQuery(
ui.newTab).find(
'a');
70 if (anchor && anchor.name && $(
'store_switcher')) {
71 $(
'store_switcher').switchParams =
'active_tab/' + anchor.name +
'/';
75 jQuery(document).on(
'tabsactivate', bindActiveProductTab);
78 <?php
if ($tabsBlock =
$block->getLayout()->getBlock(
'product_tabs')): ?>
80 if (
jQuery(
'#<?= /* @escapeNotVerified */ $tabsBlock->getId() ?>').length &&
jQuery(
'#<?= /* @escapeNotVerified */ $tabsBlock->getId() ?>').is(
':mage-tabs')) {
81 var activeAnchor =
jQuery(
'#<?= /* @escapeNotVerified */ $tabsBlock->getId() ?>').tabs(
'activeAnchor');
82 if (activeAnchor && $(
'store_switcher')) {
83 $(
'store_switcher').switchParams =
'active_tab/' + activeAnchor.prop(
'name') +
'/';
89 window.recalculateTax = recalculateTax;
90 window.bindActiveProductTab = bindActiveProductTab;
91 window.registerTaxRecalcs = registerTaxRecalcs;
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
jQuery('.store-switcher .dropdown-menu li a').each(function()