Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Как убрать перезагрузку блока досивки?


 Share

Recommended Posts

Здравствуйте, вопрос икой, посивил модуль досивки Omniva, и попыился интегрировать в simplecheckout.
Но после выпотому чтора досивки когда производишь заказ, перезагружается поле, и пропадает выпотому чтор данной досивки, т.е её никак не выбрать.

вот код

<?php
        // Omniva (skip terminal locations)
        if (strpos($quote['code'], 'omnivalt.parcel_terminal') !== false) {
          continue;
        } else if (strpos($quote['code'], 'fake.parcel_terminal') !== false) {
          ?>
          <script>
        $(document).ready(function () {
      var omnivaModuleReady = false;
      $(document).on('click', 'input[type="radio"][name="shipping_method"]', function (e) {
          console.log($(this).val());
        if ($(this).val() === 'fake.parcel_terminal' && !omnivaModuleReady) {
            omnivaModuleReady = $(this).omniva({
                country_code: '<?php echo $omni_country_code;?>',
                path_to_img: 'image/omniva/',
                callback: function (id) {
                  omnivaModuleReady.val('omnivalt.parcel_terminal_' + id);
                },
                translate: omniva_map_translation,
                terminals: <?php echo json_encode($omni_terminals);?>,
            });
            omnivaModuleReady.trigger('omniva.show');

            // with default template this should be enough even if user changes postcode (as he needs to press continue button)
            var sameShipping = $('input[name="shipping_address"]');
            if (sameShipping.length > 0 && sameShipping.is(':checked')) {
                omnivaModuleReady.trigger('omniva.postcode', [$('#input-payment-postcode').val()]);
            } else {
                omnivaModuleReady.trigger('omniva.postcode', [$('#input-shipping-postcode').val()]);
            }
        } else {
            if (omnivaModuleReady) {
              if ($(this).is(omnivaModuleReady)) {
                  omnivaModuleReady.trigger('omniva.show');
              } else {
                  omnivaModuleReady.trigger('omniva.hide');
              }
            }
        }
      });
      $('input[type="radio"][name="shipping_method"]:checked').click();
      $('#button-shipping-method').on('click', function (e) {
        var $selectedOption = $('input[type="radio"][name="shipping_method"]:checked');
        if ($($selectedOption).val().includes('fake.parcel')) {
          e.preventDefault();
          e.stopPropagation();
          alert(omniva_map_translation.terminal_not_selected);
        }
      });
    });
    </script>
          <?php
        }
        // Omniva END
        ?>

 

Всивил после <?php foreach ($shipping_method['quote'] as $quote) { ?>

Версия opencart 2.3

Link to comment
Share on other sites


13 минут назад, DEVHUB сказал:

Может стоить убрать перезагрузку поля в настройках симплы? 

А как её убрать на блоке досивка?

Link to comment
Share on other sites


  • 2 months later...
В 05.08.2021 в 16:19, ZoomieOS сказал:

А как её убрать на блоке досивка?

Напишите доступы в адмнку.. гляну...

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.