Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update_prices_product_slider_m_f(product_id, minimumvalue) {
- input_val = $('#slider_m_f .product_'+product_id+' .plus-minus').val();
- if (input_val > minimumvalue) {
- input_val = minimumvalue;
- $('#slider_m_f .product_'+product_id+' .plus-minus').val(minimumvalue);
- }
- <?php if ($recalc_price) { ?>
- quantity = parseInt(input_val);
- <?php } else { ?>
- quantity = 1;
- <?php } ?>
- data = $('#slider_m_f .product_'+product_id+' .options input[type=\'text\'], #slider_m_f .product_'+product_id+' .options input[type=\'hidden\'], #slider_m_f .product_'+product_id+' .options input[type=\'radio\']:checked, #slider_m_f .product_'+product_id+' .options input[type=\'checkbox\']:checked, #slider_m_f .product_'+product_id+' .options select');
- $.ajax({
- type: 'post',
- url: 'index.php?route=product/product/update_prices',
- data: data.serialize() + '&product_id=' + product_id + '&quantity=' + quantity,
- dataType: 'json',
- success: function(json) {
- <?php if ($img_slider) { ?>
- $('#slider_m_f .product_'+product_id+' .image .owl-item:first-child img').attr('src', json['opt_image']);
- <?php } else { ?>
- $('#slider_m_f .product_'+product_id+' .image img').attr('src', json['opt_image']);
- <?php } ?>
- <?php if ($description_options['zamena_description'] && $description_options['model']) { ?>
- $('#slider_m_f .product_'+product_id+' .pr_model_'+product_id).html(json['opt_model']);
- <?php } ?>
- var start_quantity = parseFloat($('#slider_m_f .pr_quantity_'+product_id).html().replace(/\s*/g,''));
- var end_quantity = json['option_quantity'];
- $({val:start_quantity}).animate({val:end_quantity}, {
- duration: 500,
- easing: 'swing',
- step: function(val) {
- $('#slider_m_f .pr_quantity_'+product_id).html(number_format(val, product_id));
- }
- });
- <?php if ($description_options['zamena_description'] && $description_options['weight']) { ?>
- var start_weight = parseFloat($('#slider_m_f .pr_weight_'+product_id).attr('data-weight'));
- var weight = json['weight'];
- $({val:start_weight}).animate({val:weight}, {
- duration: 500,
- easing: 'swing',
- step: function(val) {
- $('#slider_m_f .pr_weight_'+product_id).html(weight_format(val, product_id));
- }
- });
- $('#slider_m_f .pr_weight_'+product_id).attr('data-weight', json['weight']);
- <?php } ?>
- <?php if ($stikers_status) { ?>
- var start_price = parseFloat($('#slider_m_f .special_no_format'+product_id).html().replace(/\s*/g,''));
- var price = json['price_n'];
- $({val:start_price}).animate({val:price}, {
- duration: 500,
- easing: 'swing',
- step: function(val) {
- $('#slider_m_f .special_no_format'+product_id).html(price_format(val));
- }
- });
- <?php } ?>
- var start_special = parseFloat($('#slider_m_f .price_no_format'+product_id).html().replace(/\s*/g,''));
- var special = json['special_n'];
- $({val:start_special}).animate({val:special}, {
- duration: 500,
- easing: 'swing',
- step: function(val) {
- $('#slider_m_f .price_no_format'+product_id).html(price_format(val));
- }
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement