Created
December 25, 2020 14:53
-
-
Save ig0r74/ea152efc09c1b41c85808f0ff3cd5c07 to your computer and use it in GitHub Desktop.
MODX MiniShop2 стоимость товаров total_cost без скидки msOnGetStatusCart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
switch ($modx->event->name) { | |
case 'msOnGetStatusCart': | |
$values = & $modx->event->returnedValues; | |
$values['status'] = $status; | |
$values['status']['real_total_cost'] = $status['total_cost'] + $status['total_discount']; | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
if (window.miniShop2) { | |
miniShop2.Callbacks.add('Cart.change.response.success', 'stik_cart_change_ok', function(response) { | |
$('.real_total_cost').text(miniShop2.Utils.formatPrice(response.data.real_total_cost)); | |
}); | |
miniShop2.Callbacks.add('Cart.remove.response.success', 'stik_cart_remove_ok', function(response) { | |
$('.real_total_cost').text(miniShop2.Utils.formatPrice(response.data.real_total_cost)); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment