simple расширение количество товаров не отображается

Тема в разделе "Дизайн, оформление и шаблоны", создана пользователем 26_RUSSS, 30 ноя 2020.

  1. 26_RUSSS

    26_RUSSS Новичок

    Сообщения:
    3
    Симпатии:
    1
    Проблема такова что не отображается количество товаров... Вроде как бы и тег все добавил...

    Строка сама вот:

    <span class="product-warning" style="color:red"><br><b><u>*** {{ product['stock'] }}</u></b></span>
    upload_2020-11-30_11-28-59.gif
    ну почему-то переменную

    product['stock']
    upload_2020-11-30_11-28-59.gif
    не видит..

    Сам код целиком вот выходит

    <div class="simplecheckout-block" id="simplecheckout_cart" {{ hide ? 'data-hide="true"' : '' }} {{ has_error ? 'data-error="true"' : '' }}>
    {% if display_header %}
    <div class="checkout-heading panel-heading" class="fa fa-shopping-bag">{{ text_cart }}</div>
    {% endif %}
    {% if attention %}
    <div class="alert alert-danger simplecheckout-warning-block">{{ attention }}</div>
    {% endif %}
    {% if error_warning %}
    <div class="alert alert-danger simplecheckout-warning-block">{{ error_warning }}</div>
    {% endif %}
    <div class="table-responsive">
    <table class="simplecheckout-cart">
    <colgroup>
    <col class="image">
    <col class="name">
    <col class="model">
    <col class="quantity">
    <col class="price">
    <col class="total">
    <col class="remove">
    </colgroup>
    <thead>
    <tr>
    <th class="image">{{ column_image }}</th>
    <th class="name">{{ column_name }}</th>
    <th class="model">{{ column_model }}</th>
    <th class="quantity">{{ column_quantity }}</th>
    <th class="price">{{ column_price }}</th>
    <th class="total">{{ column_total }}</th>
    <th class="remove"></th>
    </tr>
    </thead>
    <tbody>
    {% for product in products %}
    {% if product['recurring'] is not empty %}
    <tr>
    <td class="simplecheckout-recurring-product" style="border:none;"><img src="{{ additional_path }}catalog/view/theme/default/image/reorder.png" alt="" title="" style="float:left;" />
    <span style="float:left;line-height:18px; margin-left:10px;">
    <strong>{{ text_recurring_item }}</strong>
    {{ product['profile_description'] }}
    </span>
    </td>
    </tr>
    {% endif %}
    <tr>
    <td class="image">
    {% if product['thumb'] %}
    <a href="{{ product['href'] }}"><img src="{{ product['thumb'] }}" alt="{{ product['name'] }}" title="{{ product['name'] }}" /></a>
    {% endif %}
    </td>
    <td class="name">
    {% if product['thumb'] %}
    <div class="image">
    <a href="{{ product['href'] }}"><img src="{{ product['thumb'] }}" alt="{{ product['name'] }}" title="{{ product['name'] }}" /></a>
    </div>
    {% endif %}
    <a href="{{ product['href'] }}">{{ product['name'] }}</a>
    {% if not product['stock'] and (config_stock_warning or not config_stock_checkout) %}
    <span class="product-warning" style="color:red"><br><b><u>*** {{ product['stock'] }}</u></b></span>
    {% endif %}
    <div class="options">
    {% for option in product['option'] %}
    &nbsp;<small> - {{ option['name'] }}: {{ option['value'] }}</small><br />
    {% endfor %}
    {% if product['recurring'] is not empty %}
    - <small>{{ text_payment_profile }}: {{ product['profile_name'] }}</small>
    {% endif %}
    </div>
    {% if product['reward'] %}
    <small>{{ product['reward'] }}</small>
    {% endif %}
    </td>
    <td class="model">{{ product['model'] }}</td>
    <td class="quantity">
    <div class="input-group btn-block" style="max-width: 200px;">
    <span class="input-group-btn">
    <button class="btn btn-primary" data-onclick="decreaseProductQuantity" data-toggle="tooltip" type="submit">
    <i class="fa fa-minus"></i>
    </button>
    </span>
    <input class="form-control" type="text" data-onchange="changeProductQuantity" {{ quantity_step_as_minimum ? 'onfocus="$(this).blur()" data-minimum="' ~ product['minimum'] ~ '"' : '' }} name="quantity[{{ product['cart_id'] is not empty ? product['cart_id'] : product['key'] }}]" value="{{ product['quantity'] }}" size="1" />
    <span class="input-group-btn">
    <button class="btn btn-primary" data-onclick="increaseProductQuantity" data-toggle="tooltip" type="submit">
    <i class="fa fa-plus"></i>
    </button>
    <button class="btn btn-danger" data-onclick="removeProduct" data-product-key="{{ product['cart_id'] is not empty ? product['cart_id'] : product['key'] }}" data-toggle="tooltip" type="button">
    <i class="fa fa-times-circle"></i>
    </button>
    </span>
    </div>
    </td>
    <td class="price">{{ product['price'] }}</td>
    <td class="total">{{ product['total'] }}</td>
    <td class="remove">
    </td>
    </tr>
    {% endfor %}
    {% for voucher_info in vouchers %}
    <tr>
    <td class="image"></td>
    <td class="name">{{ voucher_info['description'] }}</td>
    <td class="model"></td>
    <td class="quantity">
    <div class="input-group btn-block" style="max-width: 200px;">
    <input class="form-control" type="text" disabled value="1" size="1" />
    <span class="input-group-btn">
    <button class="btn btn-danger" data-onclick="removeGift" data-gift-key="{{ voucher_info['key'] }}" title="{{ button_remove }}" type="button">
    <i class="fa fa-times-circle"></i>
    </button>
    </span>
    </div>
    </td>
    <td class="price">{{ voucher_info['amount'] }}</td>
    <td class="total">{{ voucher_info['amount'] }}</td>
    <td class="remove">
    </td>
    </tr>
    {% endfor %}
    </tbody>
    </table>
    </div>

    {% for total in totals %}
    <div class="simplecheckout-cart-total" id="total_{{ total['code'] }}">
    <span><b>{{ total['title'] }}:</b></span>
    <span class="simplecheckout-cart-total-value">{{ total['text'] }}</span>
    <span class="simplecheckout-cart-total-remove">
    {% if total['code'] == 'coupon' %}
    <i data-onclick="removeCoupon" title="{{ button_remove }}" class="fa fa-times-circle"></i>
    {% endif %}
    {% if total['code'] == 'voucher' %}
    <i data-onclick="removeVoucher" title="{{ button_remove }}" class="fa fa-times-circle"></i>
    {% endif %}
    {% if total['code'] == 'reward' %}
    <i data-onclick="removeReward" title="{{ button_remove }}" class="fa fa-times-circle"></i>
    {% endif %}
    </span>
    </div>
    {% endfor %}
    {% if modules['coupon'] is defined %}
    <div class="simplecheckout-cart-total">
    <span class="inputs">{{ entry_coupon }}&nbsp;<input class="form-control" type="text" data-onchange="reloadAll" name="coupon" value="{{ coupon }}" /></span>
    </div>
    {% endif %}
    {% if modules['reward'] is defined and points > 0 %}
    <div class="simplecheckout-cart-total">
    <span class="inputs">{{ entry_reward }}&nbsp;<input class="form-control" type="text" name="reward" data-onchange="reloadAll" value="{{ reward }}" /></span>
    </div>
    {% endif %}
    {% if modules['voucher'] is defined %}
    <div class="simplecheckout-cart-total">
    <span class="inputs">{{ entry_voucher }}&nbsp;<input class="form-control" type="text" name="voucher" data-onchange="reloadAll" value="{{ voucher }}" /></span>
    </div>
    {% endif %}
    {% if modules['coupon'] is defined or (modules['reward'] is defined and points > 0) or modules['voucher'] is defined %}
    <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>{{ button_update }}</span></a></span>
    </div>
    {% endif %}
    <input type="hidden" name="remove" value="" id="simplecheckout_remove">
    <div style="display:none;" id="simplecheckout_cart_total">{{ cart_total }}</div>
    {% if display_weight %}
    <div style="display:none;" id="simplecheckout_cart_weight">{{ weight }}</div>
    {% endif %}
    {% if not display_model %}
    <style>
    .simplecheckout-cart col.model,
    .simplecheckout-cart th.model,
    .simplecheckout-cart td.model {
    display: none;
    }
    </style>
    {% endif %}
    </div>
     

    Вложения:

  2. Ravilr

    Ravilr Специалист

    Сообщения:
    3.883
    Симпатии:
    1.065
    Ничего не видно по вопросу. Напишите разработчику модуля, подскажет
     
  3. 26_RUSSS

    26_RUSSS Новичок

    Сообщения:
    3
    Симпатии:
    1
    уже разобрался вот решения =) для 3.0.2.0 версии
    В /system/library/cart/cart.php например после строчки

    'stock' => $stock,
    Добавьте

    'stock_qty' => $product_query->row['quantity'],
    В в /catalog/controller/checkout/simplecheckout_cart.php например после

    'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')),

    добавить

    'stock_qty' => $product['stock_qty'],

    в twig

    <span class="product-warning" style="color:red"><br><b><u>*** для заказа доступно {{ product['stock_qty'] }} шт.</u></b></span>
     
    Ravilr нравится это.