Перейти к содержанию
Freescape

Помощь С Изменением Кнопок

Рекомендуемые сообщения

Приветствую друзья! У меня имеется не стандартный шаблон opencart, в нем имеется конструктор заказа пиццы, роллов, бургеров и тд.. по компонентам. Не могу понять как поменять инпут со значением количества товара и кнопки больше меньше, которые задают это количество. Хотелось бы заменить все это дело на чекбокс, т.к., сейчас можно поставить любое количество ингредиентов, а это не логично)
Смотрел код, но я в нем не особо силен, прошу помочь.

 

В данном коде, нашел, что 
owq-sub (кнопка меньше) - встречается 5 раз,
owq-add (кнопка больше) - встречается 5 раз,
form-control owq-input (инпут с кол-вом) - встречается 4 раза.

Фото конструктора : фото

<?php echo $header; ?>
<div class="container">
    <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
    </ul>
    <div class="row">
        <?php echo $column_left; ?>
        <?php if ($column_left && $column_right) { ?>
        <?php $class = 'col-sm-6'; ?>
        <?php } elseif ($column_left || $column_right) { ?>
        <?php $class = 'col-sm-9'; ?>
        <?php } else { ?>
        <?php $class = 'col-sm-12'; ?>
        <?php } ?>
        <div id="content" class="<?php echo $class; ?>">
            <?php echo $content_top; ?>
            <div class="row">
                <?php if ($column_left || $column_right) { ?>
                <?php $class = 'col-sm-6'; ?>
                <?php } else { ?>
                <?php $class = 'col-sm-6 col-lg-7'; ?>
                <?php } ?>
                <div class="<?php echo $class; ?> product_page-left">
                    <div class="product-gallery">
                        <?php if ($images) { ?>
                        <div class="row">
                            <div class="col-lg-12 text-center">
                                <div class="relative">
                                    <img alt="" data-zoom-type="<?php echo $zoom_type; ?>" width="<?php echo $popup_width; ?>" height="<?php echo $popup_height; ?>" src="<?php echo $images[0]['thumb']; ?>" data-zoom-image="<?php echo $images[0]['popup']; ?>"/>
                                    <div class="builder-images-block">
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-2 hidden-xs hidden-sm hidden-md image-thumb">
                                <ul id="productGallery" class="image-additional" data-slide-width="<?php echo $image_additional_width; ?>">
                                    <?php foreach ($images as $key => $image) { ?>
                                    <?php if($key > 0 && $key < 4){ ?>
                                    <li>
                                        <img width="<?php echo $image_additional_width; ?>" height="<?php echo $image_additional_height; ?>" src="<?php echo $image['additional']; ?>" alt="<?php echo $heading_title; ?>" />
                                    </li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </div>
                        </div>
                        <?php } ?>
                    </div>
                </div>
                <?php if ($column_left || $column_right) { ?>
                <?php $class = 'col-sm-6'; ?>
                <?php } else { ?>
                <?php $class = 'col-sm-6 col-lg-5'; ?>
                <?php } ?>
                <div class="<?php echo $class; ?> product_page-right">
                    <div class="general_info product-info">
                        <h2 class="product-title"><?php echo $heading_title; ?></h2>
                        <!-- Prodyuct rating status -->
                        <div class="rating-section product-rating-status">
                            <?php if ($review_status) { ?>
                            <div class="rating">
                                <?php for ($i = 1; $i <= 5; $i++) { ?>
                                <?php if ($rating < $i) { ?>
                                <span class="fa-stack">
                                    <i class="material-design-bookmark45 fa-stack-1x"></i>
                                </span>
                                <?php } else { ?>
                                <span class="fa-stack">
                                    <i class="material-design-bookmark45 fa-stack-1x"></i>
                                    <i class="material-design-bookmark45 star fa-stack-1x"></i>
                                </span>
                                <?php } ?>
                                <?php } ?>
                                <span class="review-link review-link-show">
                                    <a href="#"><?php echo $reviews; ?></a>
                                </span>
                                <span class="review-link review-link-write">
                                    <a href="#"><?php echo $text_write; ?></a>
                                </span>
                            </div>
                            <?php } ?>
                        </div>
                        <!--
                        <ul class="list-unstyled product-section">
                            <?php if ($manufacturer) { ?>
                            <li><strong><?php echo $text_manufacturer; ?></strong>
                                <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a>
                            </li>
                            <?php } ?>
                            <li>
                                <strong><?php echo $text_model; ?></strong>
                                <span><?php echo $model; ?></span>
                            </li>
                            <?php if ($reward) { ?>
                            <li>
                                <strong><?php echo $text_reward; ?></strong>
                                <span><?php echo $reward; ?></span>
                            </li>
                            <?php } ?>
                            <li>
                                <strong><?php echo $text_stock; ?></strong>
                                <span class="<?php echo($stock_status <= 0 ? 'out-stock' : 'stock'); ?>"><?php echo $stock; ?></span>
                            </li>
                        </ul>
                    -->
                </div>
                <div id="product">
                    <?php if ($options) { ?>
                    <div class="product-include_options">
                        <h3 class="hidden"><?php echo $text_include_option; ?></h3>
                    </div>   
                    <div class="product-options">
                        <!--<h3><?php echo $text_option; ?></h3>-->
                        <?php foreach ($options as $option) { ?>
                        <?php if ($option['type'] == 'select') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
                            <select name="option[<?php echo $option['product_option_id']; ?>]" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control">
                                <option value=""><?php echo $text_select; ?></option>
                                <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
                                    <?php if ($option_value['price']) { ?>
                                    (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                                    <?php } ?>
                                </option>
                                <?php } ?>
                            </select>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'radio') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label"><?php echo $option['name']; ?></label>
                            <div id="input-option<?php echo $option['product_option_id']; ?>">
                                <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" />
                                        <?php echo $option_value['name']; ?>
                                        <?php if ($option_value['price']) { ?>
                                        (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                                        <?php } ?>
                                    </label>
                                </div>
                                <?php } ?>
                            </div>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'checkbox') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label"><?php echo $option['name']; ?></label>
                            <div id="input-option<?php echo $option['product_option_id']; ?>">
                                <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" />
                                        <?php if ($option_value['image']) { ?>
                                        <img width="50" height="50" src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" class="img-thumbnail" />
                                        <?php } ?>
                                        <?php echo $option_value['name']; ?>
                                        <?php if ($option_value['price']) { ?>
                                        (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                                        <?php } ?>
                                    </label>
                                </div>
                                <?php } ?>
                            </div>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'image') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label"><?php echo $option['name']; ?></label>
                            <div id="input-option<?php echo $option['product_option_id']; ?>">
                                <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" />
                                        <img width="50" height="50" src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" class="img-thumbnail" /> <?php echo $option_value['name']; ?>
                                        <?php if ($option_value['price']) { ?>
                                        (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                                        <?php } ?>
                                    </label>
                                </div>
                                <?php } ?>
                            </div>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'text') { ?>
                        <div class="form-group hidden">
                            <span class="include_option">
                                <?php echo $option['name']; ?>
                            </span>
                            <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
                            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" placeholder="<?php echo $option['name']; ?>" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
                        </div>
                        <?php } ?>

                        <!-- Pizza Options -->

                        <?php if ($option['type'] == 'input_qty') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <div id="input-option<?php echo $option['product_option_id']; ?>" class="owq-option">
                                <table>
                                    <thead>
                                        <tr> <?php if (!empty($option['owq_has_image'])) { ?><td></td><?php } ?> <td><?php echo $option['name']; ?>:</td> <?php if (!empty($option['owq_has_sku'])) { ?><td>Article:</td><?php } ?> <?php if (!empty($option['owq_has_stock'])) { ?><td>Avaible:</td><?php } ?> <td>Price:</td> <?php if (!empty($option['owq_discounts'])) { ?> <?php foreach ($option['owq_discounts'] as $dvalue) { ?> <td>Price for<br /><?php echo $dvalue; ?></td> <?php } ?> <?php } ?> <td class="col-quantity"><?php echo $entry_qty; ?>:</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                        <tr>
                                            <?php if (!empty($option['owq_has_image'])) { ?>
                                            <td>
                                                <?php if (!empty($option_value['image'])) { ?>
                                                <img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name']; ?>" class="option-image" />
                                                <?php } ?>
                                            </td>
                                            <?php } ?>
                                            <td>
                                                <input style="display:none;" type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="" data-split="/" data-price="0" data-prefix="=" data-fprice="<?php echo $option_value['owq_full_price']; ?>" data-id="<?php echo $option_value['product_option_value_id']; ?>" />
                                                <?php echo $option_value['name']; ?>
                                            </td>
                                            <?php if (!empty($option['owq_has_sku'])) { ?>
                                            <td><?php echo $option_value['owq_sku']; ?></td>
                                            <?php } ?>
                                            <?php if (!empty($option['owq_has_stock'])) { ?>
                                            <td class="stock">
                                                <?php if (!empty($option_value['owq_has_stock'])) { ?>
                                                <?php echo $option_value['owq_quantity']; ?>
                                                <?php } ?>
                                            </td>
                                            <?php } ?>
                                            <td>
                                                <?php if ($option_value['owq_full_price_text']) { ?>
                                                <?php echo $option_value['owq_full_price_text']; ?>
                                                <?php } ?>
                                            </td>
                                            <td class="col-quantity">
                                                <div class="owq-quantity">
                                                    <span class="owq-sub">&lt;</span>
                                                    <input type="text" value="" <?php if (!empty($option_value['owq_has_stock'])) { ?>data-max="<?php echo $option_value['owq_quantity']; ?>"<?php } ?> class="form-control owq-input" />
                                                    <span class="owq-add">&gt;</span>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        </div> 
                        <?php $entry_qty = ''; ?> <?php } ?>
                        <?php if ($option['type'] == 'input_qty_nm') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <div id="input-option<?php echo $option['product_option_id']; ?>" class="owq-option builder">
                                <table>
                                    <thead>
                                        <tr> <?php if (!empty($option['owq_has_image'])) { ?><td></td><?php } ?> <td><?php echo $option['name']; ?>:</td> <?php if (!empty($option['owq_has_sku'])) { ?><td>Article:</td><?php } ?> <?php if (!empty($option['owq_has_stock'])) { ?><td>Avaible:</td><?php } ?> <td>Price:</td> <?php if (!empty($option['owq_discounts'])) { ?> <?php foreach ($option['owq_discounts'] as $dvalue) { ?> <td>Price for<br /><?php echo $dvalue; ?></td> <?php } ?> <?php } ?> <td class="col-quantity"><?php echo $entry_qty; ?>:</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                        <tr class="tr-image">
                                            <?php if (!empty($option['owq_has_image'])) { ?>
                                            <td class="td-image <?php echo $option_value['name']; ?>">
                                                <?php if (!empty($option_value['image'])) { ?>
                                                <img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name']; ?>" class="option-image" />
                                                <img src="<?php echo $option_value['image_builder']; ?>" alt="<?php echo $option_value['name']; ?>" class="hidden builder-image" />
                                                <?php } ?>
                                            </td>
                                            <?php } ?>
                                            <td>
                                                <input style="display:none;" type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="" data-split="|" data-price="0" data-prefix="<?php echo $option_value['price_prefix']; ?>" data-fprice="<?php echo $option_value['owq_price']; ?>" data-id="<?php echo $option_value['product_option_value_id']; ?>" />
                                                <?php echo $option_value['name']; ?>
                                            </td>
                                            <?php if (!empty($option['owq_has_stock'])) { ?>
                                            <td class="stock">
                                                <?php if (!empty($option_value['owq_has_stock'])) { ?>
                                                <?php echo $option_value['owq_quantity']; ?>
                                                <?php } ?>
                                            </td>
                                            <?php } ?>
                                            <td>
                                                <?php if ($option_value['price']) { ?>
                                                <?php echo $option_value['price_prefix'].$option_value['price']; ?>
                                                <?php } ?>
                                            </td>
                                            <td class="col-quantity">
                                                <div class="owq-quantity">
                                                    <span class="owq-sub">&lt;</span>
                                                    <input type="text" value="" <?php if (!empty($option_value['owq_has_stock'])) { ?>data-max="<?php echo $option_value['owq_quantity']; ?>"<?php } ?> class="form-control owq-input" />
                                                    <span class="owq-add">&gt;</span>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <?php $entry_qty = ''; ?> <?php } ?>
                        <?php if ($option['type'] == 'input_qty_ns') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <div id="input-option<?php echo $option['product_option_id']; ?>" class="owq-option">
                                <table>
                                    <thead>
                                        <tr>
                                            <td><?php echo $option['name']; ?>:</td>
                                            <?php if (!empty($option['owq_has_stock'])) { ?>
                                            <td>Avaible:</td>
                                            <?php } ?>
                                            <td>Price:</td>
                                            <td class="col-quantity"><?php echo $entry_qty; ?>:</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                        <tr>
                                            <td>
                                                <input style="display:none;" type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="" data-split="|" data-price="0" data-prefix="<?php echo $option_value['price_prefix']; ?>" data-fprice="<?php echo $option_value['owq_price']; ?>" data-id="<?php echo $option_value['product_option_value_id']; ?>" />
                                                <?php echo $option_value['name']; ?>
                                            </td>
                                            <?php if (!empty($option['owq_has_stock'])) { ?>
                                            <td class="stock">
                                                <?php if (!empty($option_value['owq_has_stock'])) { ?>
                                                <?php echo $option_value['owq_quantity']; ?> шт.
                                                <?php } ?>
                                            </td>
                                            <?php } ?>
                                            <td>
                                                <?php if ($option_value['price']) { ?>
                                                <?php echo $option_value['price_prefix'].$option_value['price']; ?>
                                                <?php } ?>
                                            </td>
                                            <td class="col-quantity">
                                                <div class="owq-quantity">
                                                    <span class="owq-sub">&lt;</span>
                                                    <input type="text" value="" <?php if (!empty($option_value['owq_has_stock'])) { ?>data-max="<?php echo $option_value['owq_quantity']; ?>"<?php } ?> class="form-control owq-input" />
                                                    <span class="owq-add">&gt;</span>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'select_qty') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <div id="input-option<?php echo $option['product_option_id']; ?>" class="owq-option">
                                <table>
                                    <thead>
                                        <tr>
                                            <td><?php echo $option['name']; ?>:</td>
                                            <td class="col-quantity"><?php echo $entry_qty; ?>:</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <select name="option[<?php echo $option['product_option_id']; ?>]" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control">
                                                    <option value=""><?php echo $text_select; ?></option>
                                                    <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                                    <option value="<?php echo $option_value['product_option_value_id']; ?>" data-fprice="<?php echo $option_value['owq_price']; ?>" data-id="<?php echo $option_value['product_option_value_id']; ?>">
                                                        <?php echo $option_value['name']; ?>
                                                        <?php if ($option_value['price']) { ?>
                                                        <?php echo $option_value['price_prefix'].$option_value['price']; ?>
                                                        <?php } ?>
                                                    </option>
                                                    <?php } ?>
                                                </select>
                                            </td>
                                            <td>
                                                <div class="owq-quantity">
                                                    <span class="owq-sub">&lt;</span>
                                                    <input type="text" value="" class="form-control owq-input" />
                                                    <span class="owq-add">&gt;</span>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <?php } ?>

                        <!-- Pizza Options -->
                        <?php if ($option['type'] == 'textarea') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
                            <textarea name="option[<?php echo $option['product_option_id']; ?>]" rows="5" placeholder="<?php echo $option['name']; ?>" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control"><?php echo $option['value']; ?></textarea>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'file') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label"><?php echo $option['name']; ?></label>
                            <button type="button" id="button-upload<?php echo $option['product_option_id']; ?>" data-loading-text="<?php echo $text_loading; ?>" class="btn-default btn-block"><span><?php echo $button_upload; ?></span></button>
                            <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" id="input-option<?php echo $option['product_option_id']; ?>" />
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'date') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
                            <div class="input-group date">
                                <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="YYYY-MM-DD" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
                                <span class="input-group-btn">
                                    <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
                                </span>
                            </div>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'datetime') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
                            <div class="input-group datetime">
                                <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="YYYY-MM-DD HH:mm" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
                                <span class="input-group-btn">
                                    <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </span>
                            </div>
                        </div>
                        <?php } ?>
                        <?php if ($option['type'] == 'time') { ?>
                        <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
                            <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
                            <div class="input-group time">
                                <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="HH:mm" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
                                <span class="input-group-btn">
                                    <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </span>
                            </div>
                        </div>
                        <?php } ?>
                        <?php } ?>
                    </div>
                    <?php } ?>
                    <!-- product reccurings -->
                    <?php if ($recurrings) { ?>
                    <div class="product-reccurings">
                        <h3><?php echo $text_payment_recurring ?></h3>
                        <div class="form-group required">
                            <select name="recurring_id" class="form-control">
                                <option value=""><?php echo $text_select; ?></option>
                                <?php foreach ($recurrings as $recurring) { ?>
                                <option value="<?php echo $recurring['recurring_id'] ?>"><?php echo $recurring['name'] ?></option>
                                <?php } ?>
                            </select>
                            <div class="help-block" id="recurring-description"></div>
                        </div>
                    </div>
                    <?php } ?>
                    <!-- Add to cart form -->

                    <?php if ($price) { ?>
                    <div class="price-section">
                        <span class="autocalc-product-price"><?php echo $price; ?></span>
                        <?php if ($tax) { ?>
                        <span class="tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span>
                        <?php } ?>
                        <div class="reward-block">
                            <?php if ($points) { ?>
                            <span class="reward"><strong><?php echo $text_points; ?></strong><?php echo $points; ?></span>
                            <?php } ?>
                            <?php if ($discounts) { ?>
                            <?php foreach ($discounts as $discount) { ?>
                            <span>
                                <strong><?php echo $discount['quantity']; ?><?php echo $text_discount; ?> :</strong>
                                <?php echo $discount['price']; ?>
                            </span>
                            <?php } ?>
                            <?php } ?>
                        </div>
                    </div>
                    <?php } ?>
                    <div class="quantity">
                        <label class="control-label" for="input-quantity"><?php echo $entry_qty; ?></label>
                        <a class="counter counter-minus fa fa-caret-down" href='#'></a>
                        <input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control"/>
                        <input type="hidden" name="product_id" value="<?php echo $product_id; ?>"/>
                        <a class="counter counter-plus fa fa-caret-up" href='#'></a>
                    </div>
                    <div class="in_stock">
                        <strong><?php echo $text_stock; ?></strong>
                        <span class="<?php echo($stock_status <= 0 ? 'out-stock' : 'stock'); ?>"><?php echo $stock; ?></span>
                    </div>
                    <div class="product-buttons">
                        <button <?php echo $stock_status <= 0 ? 'disabled' : ''; ?> type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn-primary btn-invert"><?php echo $stock_status <= 0 ? $stock : $button_cart; ?></button>
                        <button class="product-btn-add" onclick="wishlist.add('<?php echo $product_id; ?>');">
                            <?php echo $button_wishlist; ?>
                        </button>
                        <button type="button" class="product-btn-add" onclick="compare.add('<?php echo $product_id; ?>');">
                            <?php echo $button_compare; ?>
                        </button>
                    </div>
                    <?php if ($tags) { ?>
                    <!-- Product tags -->
                    <div class="product-tags">
                        <?php echo $text_tags; ?>
                        <?php for ($i = 0; $i < count($tags); $i++) { ?>
                        <?php if ($i < (count($tags) - 1)) { ?>
                        <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>,
                        <?php } else { ?>
                        <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>
                        <?php } ?>
                        <?php } ?>
                    </div>
                    <?php } ?>
                    <div class="product-share">
                        <!-- AddThis Button BEGIN -->
                        <div class="addthis_sharing_toolbox"></div>
                        <!-- Go to www.addthis.com/dashboard to customize your tools -->
                        <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-55e053ac02ebd38e" async="async"></script>
                        <!-- AddThis Button END -->
                    </div>
                    <?php if ($minimum > 1) { ?>
                    <div class="alert alert-info">
                        <i class="material-design-round52"></i>
                        <?php echo $text_minimum; ?>
                    </div>
                    <?php } ?>
                </div>
            </div>
        </div>
            <div class="row">
                <div class="product_tabs">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#tab-description" data-toggle="tab">
                                <?php echo $tab_description; ?>
                            </a>
                        </li>
                        <?php if ($attribute_groups) { ?>
                        <li>
                            <a href="#tab-specification" data-toggle="tab">
                                <?php echo $tab_attribute; ?>
                            </a>
                        </li>
                        <?php } ?>
                        <?php if ($review_status) { ?>
                        <li>
                            <a href="#tab-review" data-toggle="tab">
                                <?php echo $tab_review; ?>
                            </a>
                        </li>
                        <?php } ?>
                        <?php if ($video) { ?>
                        <li>
                            <a href="#tab-video" data-toggle="tab">
                                <?php echo $tab_video; ?>
                            </a>
                        </li>
                        <?php } ?>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab-description">
                            <?php echo $description; ?>
                        </div>
                        <?php if ($attribute_groups) { ?>
                        <div class="tab-pane product-spec product-section" id="tab-specification">
                            <table class="table table-bordered">
                                <?php foreach ($attribute_groups as $attribute_group) { ?>
                                <tr>
                                    <th colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></th>
                                </tr>
                                <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
                                <tr>
                                    <td><?php echo $attribute['name']; ?></td>
                                    <td><?php echo $attribute['text']; ?></td>
                                </tr>
                                <?php } ?>
                                <?php } ?>
                            </table>
                        </div>
                        <?php } ?>
                        <?php if ($review_status) { ?>
                        <div class="tab-pane product-reviews" id="tab-review">
                            <form class="form-horizontal" id="form-review">
                                <div id="review"></div>
                                <div class="review-form-title">
                                    <h3 class="product-section_title" id="reviews_form_title"><?php echo $text_write; ?></h3>
                                </div>
                                <div class="product-review-form" id="reviews_form">
                                    <?php if ($review_guest) { ?>
                                    <div class="form-group required">
                                        <div class="col-sm-12">
                                            <label class="control-label" for="input-name"><?php echo $entry_name; ?></label>
                                            <input type="text" name="name" value="<?php echo $customer_name; ?>" id="input-name" class="form-control" />
                                        </div>
                                    </div>
                                    <div class="form-group required">
                                        <div class="col-sm-12">
                                            <label class="control-label" for="input-review"><?php echo $entry_review; ?></label>
                                            <textarea name="text" rows="5" id="input-review" class="form-control"></textarea>
                                            <div class="help-block"><?php echo $text_note; ?></div>
                                        </div>
                                    </div>
                                    <div class="form-group required">
                                        <div class="col-sm-12">
                                            <label class="control-label"><?php echo $entry_rating; ?></label>
                                            &nbsp;&nbsp;&nbsp; <?php echo $entry_bad; ?>&nbsp;
                                            <input type="radio" name="rating" value="1" />
                                            &nbsp;
                                            <input type="radio" name="rating" value="2" />
                                            &nbsp;
                                            <input type="radio" name="rating" value="3" />
                                            &nbsp;
                                            <input type="radio" name="rating" value="4" />
                                            &nbsp;
                                            <input type="radio" name="rating" value="5" />
                                            &nbsp;<?php echo $entry_good; ?>
                                        </div>
                                    </div>
                                    <?php echo $captcha; ?>
                                    <div class="buttons clearfix">
                                        <div class="pull-right">
                                            <button type="button" id="button-review" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary">
                                                <?php echo $button_continue; ?>
                                            </button>
                                        </div>
                                    </div>
                                    <?php } else { ?>
                                    <?php echo $text_login; ?>
                                    <?php } ?>
                                </div>
                            </form>
                        </div>
                        <?php } ?>
                        <?php if ($video) { ?>
                        <div id="tab-video" class="tab-pane product-video product-section">
                            <div class="r_frame">
                                <?php echo $video; ?>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <?php }?>
                    </div>
                </div>
            </div>

        <!-- related Products -->
        <?php if ($products) { ?>
        <div class="box-heading">
            <h3><?php echo $text_related; ?></h3>
        </div>
        <div class="box-content">
            <div class="box-carousel">
                <?php $pr = 10000; foreach ($products as $product) { $pr++; ?>
                <div class="product-thumb transition <?php if ($product['options']) echo 'options';?>">
                    <?php if ($product['options']) { ?>
                    <!-- Product options -->
                    <div class="product-option-wrap">
                        <div class="product-options form-horizontal">
                            <div class="options">
                                <a class="ajax-overlay_close" href='#'></a>
                                <div class="form-group hidden">
                                    <div class="col-sm-8">
                                        <input type="text" name="product_id" value="<?php echo $product['product_id'] ?>" class="form-control"/>
                                    </div>
                                </div>
                                <?php foreach ($product['options'] as $option) { ?>
                                <?php if ($option['type'] == 'select') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12" for="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <select name="option[<?php echo $option['product_option_id']; ?>]" id="input-option<?php echo $option['product_option_id'] . $pr; ?>" class="form-control">
                                            <option value=""><?php echo $text_select; ?></option>
                                            <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                            <option value="<?php echo $option_value['product_option_value_id']; ?>">
                                                <?php echo $option_value['name']; ?>
                                                <?php if ($option_value['price']) { ?>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)<?php } ?>
                                            </option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'radio') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <div id="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                            <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                            <div class="radio">
                                                <label for="option[<?php echo $option['product_option_id'] . $option_value['product_option_value_id'] . $pr; ?>]">
                                                    <input type="radio" hidden name="option[<?php echo $option['product_option_id']; ?>]" id="option[<?php echo $option['product_option_id'] . $option_value['product_option_value_id'] . $pr; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>"/>
                                                    <?php echo $option_value['name']; ?>
                                                    <?php if ($option_value['price']) { ?>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)<?php } ?>
                                                </label>
                                            </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'checkbox') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <div id="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                            <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                            <div class="checkbox">
                                                <label>
                                                    <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>"/>
                                                    <?php echo $option_value['name']; ?>
                                                    <?php if ($option_value['price']) { ?>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)<?php } ?>
                                                </label>
                                            </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'image') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <div id="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                            <?php foreach ($option['product_option_value'] as $option_value) { ?>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>"/>
                                                    <img width="50" height="50" src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" class="img-thumbnail"/> <?php echo $option_value['name']; ?>
                                                    <?php if ($option_value['price']) { ?>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)<?php } ?>
                                                </label>
                                            </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'text') { ?>
                                <div class="form-group hidden">
                                    <label class="control-label col-sm-12" for="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" placeholder="<?php echo $option['name']; ?>" id="input-option<?php echo $option['product_option_id'] . $pr; ?>" class="form-control"/>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'textarea') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12" for="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <textarea name="option[<?php echo $option['product_option_id']; ?>]" rows="5" placeholder="<?php echo $option['name']; ?>" id="input-option<?php echo $option['product_option_id'] . $pr; ?>" class="form-control"><?php echo $option['value']; ?>
                                        </textarea>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'file') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <button type="button" id="button-upload<?php echo $option['product_option_id'] . $pr; ?>" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-block btn-default">
                                            <i class="fa fa-upload"></i>
                                            <?php echo $button_upload; ?>
                                        </button>
                                        <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" id="input-option<?php echo $option['product_option_id'] . $pr; ?>"/>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'date') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12" for="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <div class="input-group date">
                                            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="YYYY-MM-DD" id="input-option<?php echo $option['product_option_id'] . $pr; ?>" class="form-control"/>
                                            <span class="input-group-btn">
                                                <button class="btn btn-default" type="button">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'datetime') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12" for="input-option<?php echo $option['product_option_id'] . $pr; ?>"><?php echo $option['name']; ?></label>
                                    <div class="col-sm-12">
                                        <div class="input-group datetime">
                                            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="YYYY-MM-DD HH:mm" id="input-option<?php echo $option['product_option_id'] . $pr; ?>" class="form-control"/>
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php if ($option['type'] == 'time') { ?>
                                <div class="form-group<?php echo($option['required'] ? ' required' : ''); ?>">
                                    <label class="control-label col-sm-12" for="input-option<?php echo $option['product_option_id'] . $pr; ?>">
                                        <?php echo $option['name']; ?>
                                    </label>
                                    <div class="col-sm-12">
                                        <div class="input-group time">
                                            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="HH:mm" id="input-option<?php echo $option['product_option_id'] . $pr; ?>" class="form-control"/>
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                                <?php } ?>
                                <button class="product-btn-add" type="button" onclick="cart.addPopup($(this),'<?php echo $product['product_id']; ?>');">
                                    <span><?php echo $button_cart; ?></span>
                                </button>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    <div class="image">
                        <?php if ($product['special']) { ?>
                        <?php if ($label_sale) { ?>
                        <div class="sale">
                            <span><?php echo $text_sale; ?></span>
                        </div>
                        <?php } ?>
                        <?php if ($label_discount) { ?>
                        <div class="discount">
                            <span><?php echo $product['label_discount']; ?></span>
                        </div>
                        <?php } ?>
                        <?php } ?>
                        <?php if ($product['label_new']) { ?>
                        <div class="new-pr"><span><?php echo $text_new; ?></span></div>
                        <?php } ?>                           
                        <a class="lazy" style="padding-bottom: <?php echo($product['img-height'] / $product['img-width'] * 100); ?>%" href="<?php echo $product['href']; ?>">
                            <?php if ($product['additional_thumb']) { ?>
                            <img width="<?php echo $product['img-width']; ?>" height="<?php echo $product['img-height'] ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-primary" data-src="<?php echo $product['thumb']; ?>" src="#"/>
                            <img width="<?php echo $product['img-width']; ?>" height="<?php echo $product['img-height'] ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-secondary" data-src="<?php echo $product['additional_thumb']; ?>" src="#"/>
                            <?php } else { ?>
                            <img width="<?php echo $product['img-width']; ?>" height="<?php echo $product['img-height'] ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img" data-src="<?php echo $product['thumb']; ?>" src="#"/>
                            <?php } ?>
                        </a>
                        <button class="quickview" type="button" data-toggle="tooltip" title="<?php echo $text_quick; ?>" data-rel="details" data-product="<?php echo $product['product_id']; ?>"><i class="fa fa-search-plus"></i>
                        </button>                                 
                    </div>
                    <div class="caption">
                        <?php if ($product['rating']) { ?>
                        <div class="rating">
                            <?php for ($i = 1; $i <= 5; $i++) { ?>
                            <?php if ($product['rating'] < $i) { ?>
                            <span class="fa-stack"><i class="fa fa-star fa-stack-1x"></i></span>
                            <?php } else { ?>
                            <span class="fa-stack">
                                <i class="fa fa-star fa-stack-1x"></i>
                                <i class="fa fa-star star  fa-stack-1x"></i>
                            </span>
                            <?php } ?>
                            <?php } ?>
                        </div>
                        <?php } ?>   
                        <div class="name">
                            <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
                        </div>
                        <div class="description"><?php echo $product['description']; ?></div>
                        <?php if ($product['price']) { ?>
                        <div class="price">
                            <?php if (!$product['special']) { ?>
                            <?php echo $product['price']; ?>
                            <?php } else { ?>
                            <span class="price-new"><?php echo $product['special']; ?></span>
                            <span class="price-old"><?php echo $product['price']; ?></span>
                            <?php } ?>
                            <?php if ($product['tax']) { ?>
                            <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
                            <?php } ?>
                        </div>
                        <?php } ?>
                        <div class="cart-buttons">
                            <button class="product-btn-add" type="button" <?php if (count($product['options']) > 3) { ?> onclick="cart.add('<?php echo $product['product_id']; ?>');" <?php } else { ?> onclick="ajaxAdd($(this),<?php echo $product['product_id'] ?>);" <?php } ?>><?php echo $button_cart; ?>
                            </button>
                            <button class="product-btn" type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i>
                            </button>
                            <button class="product-btn" type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i>
                            </button>
                        </div>
                        <div class="icon-buttons">
                            <button type="button" data-toggle="tooltip" title="<?php echo $button_cart; ?>" <?php if (count($product['options']) > 3) { ?> onclick="cart.add('<?php echo $product['product_id']; ?>');" <?php } else { ?> onclick="ajaxAdd($(this),<?php echo $product['product_id'] ?>);" <?php } ?>><i class="fa fa-shopping-bag"></i>
                            </button>
                            <button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i>
                            </button>
                            <button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i>
                            </button>
                        </div>                           
                    </div>
                </div>
                <?php } ?>
            </div>
        </div>
        <?php } ?>
        <?php echo $content_bottom; ?>
    </div>
    <?php echo $column_right; ?>
</div>
</div>
<script>
    (function ($) {
        $(document).ready(function () {
            $('.review-link a').click(function (e) {
                e.preventDefault();
                $('.product_tabs a[href="#tab-review"').tab('show');

            })
            $('.review-link-show').click(function () {
                $('html, body').animate({
                    'scrollTop': $('.product_tabs').offset().top - ($('#stuck').outerHeight() + 50)
                }, 1000);
            })
            $('.review-link-write').click(function () {
                $('html, body').animate({
                    'scrollTop': $('#reviews_form_title').offset().top - ($('#stuck').outerHeight() + 50)
                }, 1000);
                $('#reviews_form_title').addClass('close-tab').parents('#tab-review').find('#reviews_form').slideDown();
            })
            $('.product_tabs li:first-child a').tab('show');
        });
    })(jQuery);

    document.getElementById('input-quantity').onkeypress = function (e) {

        e = e || event;

        if (e.ctrlKey || e.altKey || e.metaKey) return;

        var chr = getChar(e);

        if (chr == null) return;

        if (chr < '0' || chr > '9') {
            return false;
        }

    }

    function getChar(event) {
        if (event.which == null) {
            if (event.keyCode < 32) return null;
            return String.fromCharCode(event.keyCode)
        }

        if (event.which != 0 && event.charCode != 0) {
            if (event.which < 32) return null;
            return String.fromCharCode(event.which)
        }

        return null;
    }
    jQuery('#reviews_form_title').addClass('close-tab');
    jQuery('#reviews_form_title').on("click", function () {
        if (jQuery(this).hasClass('close-tab')) {
            jQuery(this).removeClass('close').parents('#tab-review').find('#reviews_form').slideToggle();
        }
        else {
            jQuery(this).addClass('close-tab').parents('#tab-review').find('#reviews_form').slideToggle();
        }
    })
</script>

<script type="text/javascript">
    $('select[name=\'recurring_id\'], input[name="quantity"]').change(function () {
        $.ajax({
            url: 'index.php?route=product/product/getRecurringDescription',
            type: 'post',
            data: $('input[name=\'product_id\'], input[name=\'quantity\'], select[name=\'recurring_id\']'),
            dataType: 'json',
            beforeSend: function () {
                $('#recurring-description').html('');
            },
            success: function (json) {
                $('.alert, .text-danger').remove();

                if (json['success']) {
                    $('#recurring-description').html(json['success']);
                }
            }
        });
    });
</script>

<script type="text/javascript">
    $('#button-cart').on('click', function () {
        $.ajax({
            url: 'index.php?route=checkout/cart/add',
            type: 'post',
            data: $('#product input[type=\'hidden\'], #input-quantity , #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea, .owl-option select'),
            dataType: 'json',
            beforeSend: function () {
                $('#button-cart').button('loading');
            },
            complete: function () {
                $('#button-cart').button('reset');
            },
            success: function (json) {
                clearTimeout(timer);
                $('.alert, .text-danger').remove();
                $('.form-group').removeClass('has-error');

                if (json['error']) {
                    if (json['error']['option']) {
                        for (i in json['error']['option']) {
                            var element = $('#input-option' + i.replace('_', '-'));

                            if (element.parent().hasClass('input-group')) {
                                element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
                            } else {
                                element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
                            }
                        }
                    }

                    if (json['error']['recurring']) {
                        $('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
                    }

                    if (json['error']['quantity']){
                        $('#content').parent().before('<div class="alert alert-danger"><i class="material-design-cancel19"></i>' + json['error']['quantity'] + ' <button type="button" class="close material-design-close47"></button> </div>');
                    }

                    $('.text-danger').parent().addClass('has-error');
                }

                if (json['success']) {
                    $('#content').parent().before('<div class="alert alert-success"><i class="material-design-verification24"></i> ' + json['success'] + '<button type="button" class="close material-design-close47"></button></div>');


                    $('#cart-total').html(json['total']);
                    $('#cart-total2').html(json['total2']);
                    $('#cart > ul').load('index.php?route=common/cart/info ul li');
                }
                timer = setTimeout(function () {
                    $('.alert').addClass('fadeOut');
                }, 4000)
            }
        });
    });
</script>

<script type="text/javascript">
    $('#review').delegate('.pagination a', 'click', function (e) {
        e.preventDefault();

        $('#review').fadeOut('slow');

        $('#review').load(this.href);

        $('#review').fadeIn('slow');
    });

    $('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

    $('#button-review').on('click', function () {
        $.ajax({
            url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
            type: 'post',
            dataType: 'json',
            data: $("#form-review").serialize(),
            beforeSend: function () {
                $('#button-review').button('loading');
            },
            complete: function () {
                $('#button-review').button('reset');
            },
            success: function (json) {
                $('.alert-success, .alert-danger').remove();

                if (json['error']) {
                    $('#review').after('<div class="alert alert-danger"><i class="material-design-cancel19"></i> ' + json['error'] + '</div>');
                }

                if (json['success']) {
                    $('#review').after('<div class="alert alert-success"><i class="material-design-verification24"></i> ' + json['success'] + '</div>');

                    $('input[name=\'name\']').val('');
                    $('textarea[name=\'text\']').val('');
                    $('input[name=\'rating\']:checked').prop('checked', false);
                }
            }
        });
    });
</script>

<script type="text/javascript">
    var disqus_shortname = 'thtest123';

    (function () {
        var s = document.createElement('script');
        s.async = true;
        s.type = 'text/javascript';
        s.src = '//' + disqus_shortname + '.disqus.com/count.js';
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
</script>

<script type="text/javascript">
    $('.include_option').appendTo('.product-include_options');
</script>
<script type="text/javascript">
    $('.product-include_options').has('.include_option').find('h3').removeClass('hidden');
</script>
<script type="text/javascript">
    function update_qty_options() {
        $('.owq-option input[type="checkbox"]').each(function() {
            $qty = $(this).closest('tr').find('.owq-input');
            opt_qty = Number($qty.val()); if (isNaN(opt_qty)) opt_qty = 0;
            if ($qty.data('max') && opt_qty > $qty.data('max')) {
                $qty.closest('tr').addClass('no-stock');
            } else {
                $qty.closest('tr').removeClass('no-stock');
            }
            if ($(this).data('id') && opt_qty > 0) {
                $(this).val($(this).data('id') + $(this).data('split') + opt_qty).data('price', $(this).data('fprice') * opt_qty).prop('checked', true);
            } else {
                $(this).prop('checked', false);
            }
        });
        $('.owq-option select').each(function() {
            $qty = $(this).closest('div').find('.owq-input');
            opt_qty = Number($qty.val()); if (isNaN(opt_qty)) opt_qty = 0;
            $(this).find('option:selected').each(function(){
                if ($(this).data('id') && opt_qty > 0) {
                    $(this).parent().find('option').val($(this).data('id') + '|' + opt_qty);
                    $(this).val($(this).data('id') + '|' + opt_qty).data('price', $(this).data('fprice') * opt_qty);
                } else {
                    $(this).data('price', 0);
                }
            });
        });
    }
    $(document).ready(function(){
        $('.owq-option .owq-input').on('input',function(){
            update_qty_options();
            if(typeof recalculateprice == 'function') {
                recalculateprice();
            }
        });
        $('.owq-quantity .owq-add').on('click', function() {
            $input = $(this).prev();
            qty = Number($input.val());
            if (isNaN(qty)) qty = 0; qty++;
            <?php /*if ($input.data('max') && qty > $input.data('max')) qty = $input.data('max');*/ ?>
            $input.val(qty).trigger('input');
            if(($this).parents('.owq-options.builder') && qty > 0){
                $(this).parents('.tr-image').find('.builder-image').appendTo('.builder-images-block');
            } else {
                $('.builder-images-block .builder-image').appendTo($(this).parents('.tr-image').find('.td-image'));
            }
        });
        $('.owq-quantity .owq-sub').on('click', function() {
            $input = $(this).next(); qty = Number($input.val());
            if (isNaN(qty)) qty = 0; qty--; if (qty < 1) qty = ''; $input.val(qty).trigger('input');
            if(($this).parents('.owq-options.builder') && qty > 0){
                $(this).parents('.tr-image').find('.builder-image').appendTo('.builder-images-block');
            } else {

                if(Number($('.autocalc-product-price').html().replace(/[^0-9\.]+/g,"")) > main_price) {
                    animateMainPrice(main_price);
                    recalculateprice();
                }

                var this_option = $(this).parents('.tr-image').find('.td-image');
                $('.builder-images-block .builder-image').each(function(indx){
                    if(this_option.hasClass($(this).attr("alt"))) {
                        $(this).appendTo(this_option);   
                    }
                });
            }
        });
        update_qty_options();


        $('.owq-area-hw .owq-input-width').trigger('input');
    });

    function calculate_tax(price)
    {
        return price;
    }

    function process_discounts(price, quantity)
    {
        return price;
    }

    animate_delay = 199;
    main_timeout_id = 0;
    var price_symbol_left = <?php echo '"' . ($price_symbol_left) . '"'; ?>,
    price_symbol_right = <?php echo '"' . ($price_symbol_right) . '"'; ?>,
    price_decimal_point = <?php echo '"' . ($price_decimal_point) . '"'; ?>;
   
    var main_price = Number($('.autocalc-product-price').html().replace(/[^0-9\.]+/g,""));

    function changePrice(price){
        htmlPrice = price_symbol_left + price + price_symbol_right;

        $('.autocalc-product-price').html(htmlPrice);
    }

    function animateMainPrice(price) {
        clearTimeout(main_timeout_id);
        main_timeout_id = setTimeout(changePrice(price), animate_delay);
    }

    function recalculateprice()
    {
        var main_price_new = Number($('.autocalc-product-price').html().replace(/[^0-9\.]+/g,""));
        var input_quantity = Number($('input[name="quantity"]').val());
        var special = 0;
        var tax = 0;
       
        if (isNaN(input_quantity)) input_quantity = 0;
       
        var option_price = 0;
       
        $('.owq-option input:checked,.owq-option option:selected').each(function() {
            main_price_new = main_price;
            if ($(this).data('prefix') == '=') {
                option_price += Number($(this).data('price'));
                main_price_new = 0;
                special = 0;
            }
        });
       
        $('.owq-option input:checked,.owq-option option:selected').each(function() {
            main_price_new = main_price;
            if ($(this).data('prefix') == '+') {
                option_price += Number($(this).data('price'));
            }
            if ($(this).data('prefix') == '-') {
                option_price -= Number($(this).data('price'));
            }
            if ($(this).data('prefix') == 'u') {
                pcnt = 1.0 + (Number($(this).data('price')) / 100.0);
                option_price *= pcnt;
                main_price_new *= pcnt;
                special *= pcnt;
            }
            if ($(this).data('prefix') == 'd') {
                pcnt = 1.0 - (Number($(this).data('price')) / 100.0);
                option_price *= pcnt;
                main_price_new *= pcnt;
                special *= pcnt;
            }
            if ($(this).data('prefix') == '*') {
                option_price *= Number($(this).data('price'));
                main_price_new *= Number($(this).data('price'));
                special *= Number($(this).data('price'));
            }
            if ($(this).data('prefix') == '/') {
                option_price /= Number($(this).data('price'));
                main_price_new /= Number($(this).data('price'));
                special /= Number($(this).data('price'));
            }
        });

        special += option_price;
        main_price_new += option_price;

        tax = main_price_new;

        special *= input_quantity;
        tax *= input_quantity;

        // Display Main Price
        animateMainPrice(main_price_new.toFixed(price_decimal_point));
       
    }

    $(document).ready(function() {
        $('.owq-option input[type="checkbox"]').bind('change', function() { recalculateprice(); });
        $('.owq-option input[type="radio"]').bind('change', function() { recalculateprice(); });
        $('.owq-option select').bind('change', function() { recalculateprice(); });
       
        $quantity = $('input[name="quantity"]');
        $quantity.data('val', $quantity.val());
        (function() {
            if ($quantity.val() != $quantity.data('val')){
                $quantity.data('val',$quantity.val());
                recalculateprice();
            }
            setTimeout(arguments.callee, 250);
        })();

        recalculateprice();
    });
</script>
<?php echo $footer; ?>

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×