Главная / Мои проекты / ЗдравТовар / Изменение страницы заказа Simple для UniShop

Изменение страницы заказа Simple для UniShop

Upd. 05.09.2016

Ниже идет откровенная бредятина и косорукие попытки переделать страницу заказа Simple в дизайне UniShop… Я не осилил =) Если кто-то смог и поделится — буду благодарен. info[a]redseo.ru 

Итак.

Задача: переверстать страницу оформления заказа Simple в соответствии со страницей заказа темы UniShop.

Для начала добавим в файл контроллера Simple подключение стиля темы

\catalog\controller\checkout\simplecheckout.php
public function index($args = null) {
    $this->loadLibrary('simple/simplecheckout');

// подключаем стили unishop
$this->document->addStyle('catalog/view/theme/unishop/stylesheet/checkout.css');
$this->load->language('checkout/cart');
$data['lang'] = array_merge($data, $this->language->load('unishop/unishop'));
// end

Добавим в хэдер класс для h1

\catalog\view\theme\unishop\template\common\simple_header.tpl
<div id="content" class="<?php echo $class; ?>"><?php echo $content_top; ?>
  <!-- <h1><?php echo $heading_title; ?></h1> -->
  <h1 class="heading"><span><?php echo $heading_title; ?></span></h1>

Изменяем основной шаблон страницы оформления заказа Simple

\catalog\view\theme\unishop\template\checkout\simplecheckout.tpl

Добавим нужные стили и скрипты

<style>
    #menu_wrap {display:none !important}
    #cart.fly{position:relative;top:auto;right:auto;margin-top:0;}
    #cart > .btn {border-radius:100% !important;}
    #cart .dropdown-menu {display:none !important}
</style>

Скрипты

Скрипты

<!-- unishop -->
<script type="text/javascript" src="catalog/view/theme/unishop/js/jquery.maskedinput.min.js"></script>
<script type="text/javascript"><!--
    var error = true;

    $('body').on('click', '#confirm_checkout', function() {
        
        var data = $('.checkout_form input[type=\'text\'], .checkout_form input[type=\'date\'], .checkout_form input[type=\'datetime-local\'], .checkout_form input[type=\'time\'], .checkout_form input[type=\'password\'], .checkout_form input[type=\'hidden\'], .checkout_form input[type=\'checkbox\']:checked, .checkout_form input[type=\'radio\']:checked, .checkout_form textarea, .checkout_form select').serialize();
        data += '&_shipping_method='+ $('.checkout_form input[name=\'shipping_method\']:checked').prop('title') + '&_payment_method=' + $('.checkout_form input[name=\'payment_method\']:checked').prop('title');
        
        $.ajax({
            url: 'index.php?route=checkout/unicheckout/validate',
            type: 'post',
            data: data,
            dataType: 'json',
            beforeSend: function() {
                $('#confirm_checkout').button('loading');
            },  
            complete: function() {
                $('#confirm_checkout').button('reset');
            },          
            success: function(json) {
                $('.alert, .text-danger').remove();
                            
                if (json['redirect']) {
                    location = json['redirect'];                
                } else if (json['error']) {
                    error = true;
                    if (json['error']['warning']) {
                        $('.error').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                    }
                    
                    for (i in json['error']) {
                        //$('[name="' + i + '"]').after('<div class="text-danger">' + json['error'][i] + '</div>');
                        $('#unicheckout').append('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' +json['error'][i]+ ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                    }
                } else  {
                    error = false;
                    $('[name=\'payment_method\']:checked').trigger('click');
                }    
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
            }
        }); 
    });

    $('select[name=\'country_id\']').on('change', function() {
        $.ajax({
            url: 'index.php?route=checkout/unicheckout/country&country_id=' + this.value,
            dataType: 'json',
            beforeSend: function() {
                $('select[name=\'country_id\']').after(' <i class="fa fa-spinner fa-spin"></i>');
            },
            complete: function() {
                $('.fa-spinner').remove();
            },          
            success: function(json) {
                if (json['postcode_required'] == '1') {
                    $('input[name=\'postcode\']').parent().parent().addClass('required');
                } else {
                    $('input[name=\'postcode\']').parent().parent().removeClass('required');
                }
                            
                html = '<option value=""><?php echo $text_select; ?></option>';
                
                if (json['zone'] && json['zone'] != '') {
                    for (i = 0; i < json['zone'].length; i++) {
                        html += '<option value="' + json['zone'][i]['zone_id'] + '"';
                        
                        if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
                            html += ' selected="selected"';
                        }
        
                        html += '>' + json['zone'][i]['name'] + '</option>';
                    }
                } else {
                    html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
                }
                
                $('select[name=\'zone_id\']').html(html).val("");
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
            }
        });
    });


    $('select[name=\'shipping_country_id\']').on('change', function() {
        $.ajax({
            url: 'index.php?route=checkout/unicheckout/country&country_id=' + this.value,
            dataType: 'json',
            beforeSend: function() {
                $('select[name=\'country_id\']').after(' <i class="fa fa-spinner fa-spin"></i>');
            },
            complete: function() {
                $('.fa-spinner').remove();
            },          
            success: function(json) {
                if (json['postcode_required'] == '1') {
                    $('input[name=\'postcode\']').parent().parent().addClass('required');
                } else {
                    $('input[name=\'postcode\']').parent().parent().removeClass('required');
                }
                            
                html = '<option value=""><?php echo $text_select; ?></option>';
                
                if (json['zone'] && json['zone'] != '') {
                    for (i = 0; i < json['zone'].length; i++) {
                        html += '<option value="' + json['zone'][i]['zone_id'] + '"';
                        
                        if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
                            html += ' selected="selected"';
                        }
        
                        html += '>' + json['zone'][i]['name'] + '</option>';
                    }
                } else {
                    html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
                }
                
                $('select[name=\'shipping_zone_id\']').html(html).val("");
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
            }
        });
    });

    $('select[name=\'country_id\'], select[name=\'zone_id\'], select[name=\'shipping_country_id\'], select[name=\'shipping_zone_id\'], input[type=\'radio\'][name=\'payment_address\'], input[type=\'radio\'][name=\'shipping_address\']').on('change', function() {
        if (this.name == 'contry_id') $("select[name=\'zone_id\']").val("");
        if (this.name == 'shipping_country_id') $("select[name=\'shipping_zone_id\']").val("");
        
        $(".shipping-method").load('index.php?route=checkout/unicheckout/shipping_method', $('.checkout_form input[type=\'text\'], .checkout_form input[type=\'date\'], .checkout_form input[type=\'datetime-local\'], .checkout_form input[type=\'time\'], .checkout_form input[type=\'password\'], .checkout_form input[type=\'hidden\'], .checkout_form input[type=\'checkbox\']:checked, .checkout_form input[type=\'radio\']:checked,input[name=\'shipping_method\']:first, .checkout_form textarea, .checkout_form select'), function() {
            if ($("input[name=\'shipping_method\']:first").length) {
                $("input[name=\'shipping_method\']:first").attr('checked', 'checked').prop('checked', true).click();
            } else {
                $("#unicart").load('index.php?route=checkout/unicheckout/cart', $('.checkout_form input[type=\'text\'], .checkout_form input[type=\'date\'], .checkout_form input[type=\'datetime-local\'], .checkout_form input[type=\'time\'], .checkout_form input[type=\'password\'], .checkout_form input[type=\'hidden\'], .checkout_form input[type=\'checkbox\']:checked, .checkout_form input[type=\'radio\']:checked, .checkout_form textarea, .checkout_form select'));  
            }
        });

        $(".payment-method").load('index.php?route=checkout/unicheckout/payment_method', $('.checkout_form input[type=\'text\'], .checkout_form input[type=\'date\'], .checkout_form input[type=\'datetime-local\'], .checkout_form input[type=\'time\'], .checkout_form input[type=\'password\'], .checkout_form input[type=\'hidden\'], .checkout_form input[type=\'checkbox\']:checked, .checkout_form input[type=\'radio\']:checked,input[name=\'shipping_method\']:first, .checkout_form textarea, .checkout_form select'), function() {
            //$("[name=\'payment_method\']").removeAttr("checked").prop('checked', false);
        });
    });    


    $('body').on('click', 'input[name=\'shipping_method\'], input[name=\'payment_method\']', function() {
       update_checkout();
    }); 

    $('body').on('change', '.payment_address input', function() {
       update_checkout();
    });  

    $('body').on('click', '[name=\'payment_method\']', function() {
        var data = $('.checkout_form input[type=\'text\'], .checkout_form input[type=\'date\'], .checkout_form input[type=\'datetime-local\'], .checkout_form input[type=\'time\'], .checkout_form input[type=\'password\'], .checkout_form input[type=\'hidden\'], .checkout_form input[type=\'checkbox\']:checked, .checkout_form input[type=\'radio\']:checked, .checkout_form textarea, .checkout_form select').serialize();
        data += '&_shipping_method='+ $('.checkout_form input[name=\'shipping_method\']:checked').prop('title') + '&_payment_method=' + $('.checkout_form input[name=\'payment_method\']:checked').prop('title');

        if (!error) {
            $.ajax({
                url: 'index.php?route=checkout/unicheckout/confirm',
                type: 'post',
                data: data,
                success: function(html) {
                    $('.payment').html(html);
                    if ($('.payment h2, .payment p').size()) {
                        $('.payment').css('display', 'block');
                    } else {
                        $('.payment').css('display', 'none');
                        $('.payment #button-confirm, .payment input[type=\'button\'], .payment input[type=\'submit\'], .payment button').trigger('click');
                        console.log('button-confirm click');
                    }
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                }
            });
        }
    });

    $('select[name=\'country_id\']').trigger('change');

    $(document).ready(function() {
        $('input:radio[name=\'payment_method\']:first').trigger('click');
        //$('#unicart').load('index.php?route=checkout/unicheckout/cart', function() {});
        //console.log($('input:radio[name=\'payment_method\']:first').val())
    });

    $('body').on('focus', '#input-payment-telephone', function(){
        $(this).mask('<?php echo $checkout_phone_mask; ?>');
    });

    $('body').on('click', '#button-coupon', function() {
        $.ajax({
            url: 'index.php?route=total/coupon/coupon',
            type: 'post',
            data: 'coupon=' + encodeURIComponent($('input[name=\'coupon\']').val()),
            dataType: 'json',
            beforeSend: function() {
                $('#button-coupon').button('loading');
            },
            complete: function() {
                $('#button-coupon').button('reset');
            },
            success: function(json) {
                $('.alert').remove();

                if (json['error']) {
                    $('#unicheckout').append('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                }

                if (json['redirect']) {
                    update_checkout();
                }
            }
        });
    });
    $('body').on('click', '#button-reward', function() {
        $.ajax({
            url: 'index.php?route=total/reward/reward',
            type: 'post',
            data: 'reward=' + encodeURIComponent($('input[name=\'reward\']').val()),
            dataType: 'json',
            beforeSend: function() {
                $('#button-reward').button('loading');
            },
            complete: function() {
                $('#button-reward').button('reset');
            },
            success: function(json) {
                $('.alert').remove();

                if (json['error']) {
                    $('#unicheckout').append('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                }

                if (json['redirect']) {
                    update_checkout();
                }
            }
        });
    });
    $('body').on('click', '#button-voucher', function() {
      $.ajax({
        url: 'index.php?route=total/voucher/voucher',
        type: 'post',
        data: 'voucher=' + encodeURIComponent($('input[name=\'voucher\']').val()),
        dataType: 'json',
        beforeSend: function() {
          $('#button-voucher').button('loading');
        },
        complete: function() {
          $('#button-voucher').button('reset');
        },
        success: function(json) {
            $('.alert').remove();

            if (json['error']) {
                $('#unicheckout').append('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
            }

            if (json['redirect']) {
                update_checkout();
            }
        }
      });
    });

    function cart_update(key, quantity) {
        $.ajax({
            url: 'index.php?route=checkout/unicheckout/cart_edit',
            type: 'post',
            data: 'quantity[' + key + ']='+quantity,
            dataType: 'html',
            success: function(data) {
                $('#cart').load('index.php?route=common/cart/info #cart > *');
                update_checkout();
                p_array();
            },
               error: function(xhr, ajaxOptions, thrownError) {
                   alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
               }
        });
    }

    function update_checkout() {
        var data = $('.checkout_form input[type=\'radio\']:checked, .checkout_form select')
        $('#unicart').load('index.php?route=checkout/unicheckout/cart', data, function() {
            update_shipping();
            update_payment();
            $('.total_checkout h3 span span').html($('.total_table td:last').html())
        });
        
    }

    function update_shipping() {
        var data = $('.checkout_form input[type=\'radio\']:checked, .checkout_form select').serialize();
        $.ajax({
            url: 'index.php?route=checkout/unicheckout/shipping_method',
            type: 'post',
            data: data,
            dataType: 'html',
            success: function(html) {
                $('.shipping-method').html(html);
            }
        });
    }

    function update_payment() {
        var data = $('.checkout_form input[type=\'radio\']:checked, .checkout_form select').serialize();
        $.ajax({
            url: 'index.php?route=checkout/unicheckout/payment_method',
            type: 'post',
            data: data,
            dataType: 'html',
            success: function(html) {
                $('.payment-method').html(html);
            }
        });
    }
//-->
</script>
<!-- end unishop -->

<?php include $simple_footer ?>
<?php } ?>
Теперь займемся оформлением блоков заказа
\catalog\controller\checkout\simplecheckout_cart.php
$this->_templateData['products'][] = array(
          'product_id'=> $product['product_id'],
                    'key'       => isset($product['key']) ? $product['key'] : '',

Новый simplecheckout_cart.tpl

Новый simplecheckout_cart.tpl

<div class="simplecheckout-block" id="simplecheckout_cart" <?php echo $hide ? 'data-hide="true"' : '' ?> <?php echo $display_error && $has_error ? 'data-error="true"' : '' ?>>
<?php if ($display_header) { ?>
    <div class="checkout-heading panel-heading"><?php echo $text_cart ?></div>
<?php } ?>
<?php if ($attention) { ?>
    <div class="simplecheckout-warning-block"><?php echo $attention; ?></div>
<?php } ?>
<?php if ($error_warning) { ?>
    <div class="simplecheckout-warning-block"><?php echo $error_warning; ?></div>
<?php } ?>

<div class="row">
            <div class="col-xs-12">
                <div id="unicart">
                    <?php if($products || $vouchers) { ?>
                    <div class="table_wrap">
                    <table class="table table-bordered table-hover table-responsive">
                    <tr>
                        <td class="image text-center"><?php echo $lang['text_image']; ?></td>
                        <td class="text-left"><?php echo $column_name; ?></td>
                        <td class="text-left hidden-xs"><?php echo $column_model; ?></td>
                        <td class="quantity text-left hidden-xs"><?php echo $column_quantity; ?></td>
                        <td class="text-right hidden-xs"><?php echo $column_price; ?></td>
                        <td class="text-right"><?php echo $column_total; ?></td>
                        <td class="delete text-center"></td>
                    </tr>
                    <?php foreach ($products as $product) { ?>
                    <tr>
                        <td class="image text-center"><img src="<?php echo $product['thumb']; ?>" class="img-thumbnail" title="<?php echo $product['name']; ?>" /></td>
                        <td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
                        <?php foreach ($product['option'] as $option) { ?>
                            <br /><small><?php echo $option['name']; ?>: <?php if (isset($option['option_value']) && !empty($option['option_value'])) echo $option['option_value'];else if (isset($option['value'])) echo $option['value']; ?></small>
                        <?php } ?>
                        </td>
                        <td class="text-left hidden-xs"><?php echo $product['model']; ?></td>
                        <td class="quantity text-left hidden-xs">
                            <div class="quantity input-group">
                                <input type="text" name="quantity[<?php echo $product['cart_id']; ?>]" value="<?php echo $product['quantity']; ?>" onchange="cart_update('<?php echo $product['cart_id']; ?>', $(this).val());" size="1" class="form-control" />
                                <span>
                                    <i class="fa fa-plus btn btn-default" onclick="cart_update('<?php echo $product['cart_id']; ?>', parseFloat($(this).parent().prev().val())+1);"></i>
                                    <i class="fa fa-minus btn btn-default" onclick="cart_update('<?php echo $product['cart_id']; ?>', parseFloat($(this).parent().prev().val())-1);"></i>
                                </span>
                            </div>
                        </td>
                      <td class="text-right hidden-xs"><?php echo $product['price']; ?></td>
                      <td class="total text-right"><?php echo $product['total']; ?></td>
                      <td class="delete text-center"><button type="button" onclick="cart.remove('<?php echo $product['cart_id']; ?>', <?php echo $product['product_id']; ?>);" title="<?php echo $button_remove; ?>" class=""><i class="fa fa-times"></i></button></td>
                    </tr>
                    <?php } ?>
                    <?php foreach ($vouchers as $voucher) { ?>
                    <tr>
                        <td class="image text-center"></td>
                        <td class="text-left"><?php echo $voucher['description']; ?></td>
                        <td class="text-left hidden-xs"></td>
                        <td class="text-center hidden-xs">1</td>
                        <td class="text-right hidden-xs"><?php echo $voucher['amount']; ?></td>
                        <td class="text-right"><?php echo $voucher['amount']; ?></td>
                        <td class="delete text-center"><button type="button" onclick="voucher.remove('<?php echo $voucher['key']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class="fa fa-times"></i></button></td>
                    </tr>
                    <?php } ?>
                    </table>
                    </div>

                    <?php if (($coupon || $voucher || $reward) && $products) { ?>
                    <table class="coupon_table">
                    <tr>
                        <td><p><?php echo $lang['text_additional']; ?></p></td>
                    </tr>
                    <?php if ($coupon) { ?>
                    <tr>
                        <td>
                            <div class="coupon input-group">
                                <input type="text" name="coupon" value="" placeholder="<?php echo $lang['text_coupon']; ?>" id="input-coupon" class="form-control" />
                                <span class="input-group-btn">
                                    <button id="button-coupon" data-loading-text="<?php echo $lang['text_loading']; ?>"  class="btn btn-primary"><?php echo $lang['button_apply']; ?></button>
                                </span>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>
                    <?php if ($reward) { ?>
                    <tr>
                        <td>
                            <div class="coupon input-group">
                                <input type="text" name="reward" value="" placeholder="<?php echo $lang['text_reward']; ?>" id="input-reward" class="form-control" />
                                <span class="input-group-btn">
                                    <button id="button-reward" data-loading-text="<?php echo $lang['text_loading']; ?>"  class="btn btn-primary"><?php echo $lang['button_apply']; ?></button>
                                </span>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>
                    <?php if ($voucher) { ?>
                    <tr>
                        <td>
                            <div class="coupon input-group">
                                <input type="text" name="voucher" value="" placeholder="<?php echo $lang['text_voucher']; ?>" id="input-voucher" class="form-control" />
                                <span class="input-group-btn">
                                    <button id="button-voucher" data-loading-text="<?php echo $lang['text_loading']; ?>"  class="btn btn-primary"><?php echo $lang['button_apply']; ?></button>
                                </span>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>
                    </table>
                    <?php } ?>

                    <table class="total_table">
                    <?php if ($weight && preg_replace('/[^\d.]/','',$weight) > 0) { ?>
                    <tr>
                        <td colspan="6" class="text-right  hidden-xs"><?php echo $lang['text_product_weight']; ?></td>
                        <td colspan="3" class="text-right  visible-xs"><?php echo $lang['text_product_weight']; ?></td>
                        <td><?php echo $weight; ?></td>
                    </tr>
                    <?php } ?>
                    <?php foreach ($totals as $total) { ?>
                    <tr>
                      <td colspan="6" class="text-right  hidden-xs"><?php echo $total['title']; ?>:</td>
                      <td colspan="3" class="text-right  visible-xs"><?php echo $total['title']; ?>:</td>
                      <td class="text-right"><?php echo $total['text']; ?></td>
                    </tr>
                    <?php } ?>
                    </table>

                    <?php if($related && isset($products_related)) { ?>
                    <div class="row product_carousel">
                    <h3 class="heading"><span><?php echo $checkout_related_text; ?></span></h3>
                    <div class="products product_related">
                      <?php foreach ($products_related as $product) { ?>
                      <div class="product-layout">
                        <div class="product-thumb transition">
                        <div class="image">
                        <a href="<?php echo $product['href']; ?>">
                            <img src="<?php echo $product['thumb']; ?>" <?php if ($product['quantity'] < 1 && $show_stock_status) { ?>data-status="<?php echo $product['stock_status']; ?>" data-status-id="<?php echo $product['stock_status_id']; ?>"<?php } ?> <?php if($product['additional_image']) { ?>data-additional="<?php echo $product['additional_image'];?>"<?php } ?> alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" />
                        </a>
                        </div>
                          <div class="caption">
                            <h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
                            <?php if ($show_options) { ?>
                                <div id="option_<?php echo $product['product_id']; ?>" class="option">
                                    <?php foreach ($product['options'] as $key => $option) { ?>
                                    <?php if ($key < $show_options_item) { ?>
                                        <?php if ($option['type'] == 'checkbox') { ?>
                                            <div id="input-option<?php echo $option['product_option_id']; ?>">
                                                <?php if ($option['required']) { ?>*<?php } ?> <label><?php echo $option['name']; ?>:</label><br />
                                                <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                                    <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
                                                    <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>">
                                                        <span><?php echo $option_value['name']; ?></span>
                                                        <?php if ($option_value['price']) { ?>
                                                            <span>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)</span>
                                                        <?php } ?>
                                                    </label>
                                                <?php } ?>
                                            </div>
                                        <?php } ?>
                                        <?php if ($option['type'] == 'select' || $option['type'] == 'radio') { ?>
                                            <div id="input-option<?php echo $option['product_option_id']; ?>">
                                                <?php if ($option['required']) { ?>*<?php } ?> <label><?php echo $option['name']; ?>:</label><br />
                                                <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                                    <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
                                                    <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>">
                                                        <span><?php echo $option_value['name']; ?></span>
                                                        <?php if ($option_value['price']) { ?>
                                                            <span>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)</span>
                                                        <?php } ?>
                                                    </label>
                                                <?php } ?>
                                            </div>
                                        <?php } ?>
                                    <?php } ?>
                                    <?php } ?>
                                </div>
                            <?php } ?>
                            <?php if ($product['rating'] >= 0) { ?>
                            <div class="rating">
                              <?php for ($i = 1; $i <= 5; $i++) { ?>
                              <?php if ($product['rating'] < $i) { ?>
                              <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                              <?php } else { ?>
                              <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                              <?php } ?>
                              <?php } ?>
                            </div>
                            <?php } ?>
                            <?php if ($product['price']) { ?>
                            <p class="price">
                              <?php if (!$product['special']) { ?>
                              <?php echo $product['price']; ?>
                              <?php } else { ?>
                              <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span> 
                              <?php } ?>
                              <?php if ($product['tax']) { ?>
                              <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
                              <?php } ?>
                            </p>
                            <?php } ?>
                            <div class="cart">
                            <button type="button" class="button btn btn-default <?php echo $product['product_id']; ?>" data-toggle="tooltip" title="<?php echo $button_cart; ?>" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-basket"></i> <span class="hidden-xs hidden-sm"><?php echo $button_cart; ?></span></button>
                          </div>
                            <button type="button" class="wishlist btn btn-default" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i></button>
                            <button type="button" class="compare btn btn-default" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i></button>
                          </div>
                        </div>
                      </div>
                      <?php } ?>
                    </div>
                    </div>
                    <script type="text/javascript">
                        $(document).ready(function() {
                            max_height_div('.product-thumb h4');
                            max_height_div('.product-thumb .option');
                        });
                        $('.product_related').owlCarousel({
                            responsiveBaseWidth: '.product_related',
                            itemsCustom: [[0, 1], [448, 2], [650, 2], [750, 3], [1000, 3]],
                            autoPlay: false,
                            mouseDrag:false,
                            navigation: true,
                            navigationText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'],
                            pagination: false,
                        });
                    </script>
                    <?php } ?>
                    <?php } else { ?>
                    <script type="text/javascript">
                        $(document).ready(function() {
                            window.location.reload();
                        });
                    </script>
                    <?php } ?>
                    <!-- /related -->
                </div>
            </div>
        </div>

<!--
<table class="coupon_table">
    <tr>
        <td><p><?php echo $lang['text_additional']; ?></p></td>
    </tr>
    <?php if ($coupon) { ?>
    <tr>
        <td>
            <div class="coupon input-group">
                <input type="text" name="coupon" value="" placeholder="<?php echo $lang['text_coupon']; ?>" id="input-coupon" class="form-control" />
                <span class="input-group-btn">
                    <button id="button-coupon" data-loading-text="<?php echo $lang['text_loading']; ?>"  class="btn btn-primary"><?php echo $lang['button_apply']; ?></button>
                </span>
            </div>
        </td>
    </tr>
    <?php } ?>
    <?php if ($reward) { ?>
    <tr>
        <td>
            <div class="coupon input-group">
                <input type="text" name="reward" value="" placeholder="<?php echo $lang['text_reward']; ?>" id="input-reward" class="form-control" />
                <span class="input-group-btn">
                    <button id="button-reward" data-loading-text="<?php echo $lang['text_loading']; ?>"  class="btn btn-primary"><?php echo $lang['button_apply']; ?></button>
                </span>
            </div>
        </td>
    </tr>
    <?php } ?>
    <?php if ($voucher) { ?>
    <tr>
        <td>
            <div class="coupon input-group">
                <input type="text" name="voucher" value="" placeholder="<?php echo $lang['text_voucher']; ?>" id="input-voucher" class="form-control" />
                <span class="input-group-btn">
                    <button id="button-voucher" data-loading-text="<?php echo $lang['text_loading']; ?>"  class="btn btn-primary"><?php echo $lang['button_apply']; ?></button>
                </span>
            </div>
        </td>
    </tr>
    <?php } ?>
</table>

<?php foreach ($totals as $total) { ?>
    <div class="simplecheckout-cart-total" id="total_<?php echo $total['code']; ?>">
        <span><b><?php echo $total['title']; ?>:</b></span>
        <span class="simplecheckout-cart-total-value"><?php echo $total['text']; ?></span>
        <span class="simplecheckout-cart-total-remove">
            <?php if ($total['code'] == 'coupon') { ?>
                <i data-onclick="removeCoupon" title="<?php echo $button_remove; ?>" class="fa fa-times-circle"></i>
            <?php } ?>
            <?php if ($total['code'] == 'voucher') { ?>
                <i data-onclick="removeVoucher" title="<?php echo $button_remove; ?>" class="fa fa-times-circle"></i>
            <?php } ?>
            <?php if ($total['code'] == 'reward') { ?>
                <i data-onclick="removeReward" title="<?php echo $button_remove; ?>" class="fa fa-times-circle"></i>
            <?php } ?>
        </span>
    </div>
<?php } ?>
<?php if (isset($modules['coupon'])) { ?>
    <div class="simplecheckout-cart-total">
        <span class="inputs"><?php echo $entry_coupon; ?>&nbsp;<input class="form-control" type="text" data-onchange="reloadAll" name="coupon" value="<?php echo $coupon; ?>" /></span>
    </div>
<?php } ?>
<?php if (isset($modules['reward']) && $points > 0) { ?>
    <div class="simplecheckout-cart-total">
        <span class="inputs"><?php echo $entry_reward; ?>&nbsp;<input class="form-control" type="text" name="reward" data-onchange="reloadAll" value="<?php echo $reward; ?>" /></span>
    </div>
<?php } ?>
<?php if (isset($modules['voucher'])) { ?>
    <div class="simplecheckout-cart-total">
        <span class="inputs"><?php echo $entry_voucher; ?>&nbsp;<input class="form-control" type="text" name="voucher" data-onchange="reloadAll" value="<?php echo $voucher; ?>" /></span>
    </div>
<?php } ?>
<?php if (isset($modules['coupon']) || (isset($modules['reward']) && $points > 0) || isset($modules['voucher'])) { ?>
    <div class="simplecheckout-cart-total simplecheckout-cart-buttons">
        <span class="inputs buttons"><a id="simplecheckout_button_cart" data-onclick="reloadAll" class="button btn-primary button_oc btn"><span><?php echo $button_update; ?></span></a></span>
    </div>
<?php } ?>
<input type="hidden" name="remove" value="" id="simplecheckout_remove">
<div style="display:none;" id="simplecheckout_cart_total"><?php echo $cart_total ?></div>
<?php if ($display_weight) { ?>
    <div style="display:none;" id="simplecheckout_cart_weight"><?php echo $weight ?></div>
<?php } ?>
-->
<?php if (!$display_model) { ?>
    <style>
    .simplecheckout-cart col.model,
    .simplecheckout-cart th.model,
    .simplecheckout-cart td.model {
        display: none;
    }
    </style>
<?php } ?>
</div>

В настройках Simple было вот так:

{cart}
{left_column}{customer}{/left_column}
{right_column}{shipping_address}{/right_column}
{shipping}
{payment}
{comment}
{payment_form}

 

Автор: Admin

Admin

Может это сойдет?

MAMP - проблема с MySQL

Не запускается mysql-сервер на MAMP

Несколько раз возникала неприятная ситуация с mysql в MAMP. После некорректного завершения программы (у меня, …

  • Виктор Король

    По сути устаревшая информация. В модуле simple все переделали, так что работают только первые два пункта.

    • Спасибо за информацию! В ближайшее время буду делать сайт на этом шаблоне с использованием модуля Simple и обновлю запись.