Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
- document.observe("dom:loaded", function() {
- var customValidation = false;
- var priceFormat = <?php echo $this->helper('tax')->getPriceFormat(); ?>;
- $$('.validate-custom-configurable').each(function(el){
- el.observe('click',function(event){
- var total_amount = optionsPrice.productPrice;
- $$('label.label-radio-configurable input').each(function(elmn){
- if ( elmn.checked == true ) {
- total_amount = total_amount + parseFloat(elmn.parentNode.id);
- }
- });
- $$('.price').each(function(priceobj) {
- priceobj.update(formatCurrency(parseFloat(total_amount), priceFormat)).innerHTML;
- });
- });
- });
- Validation.addAllThese([
- ['validate-custom-configurable', 'This is a required field.', function(v) {
- $$('.validate-custom-configurable').each(function(el){
- if (el.checked) {
- customValidation = true;
- }
- });
- return customValidation;
- }]
- ]);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement