Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Postal

Newbie
  
  • Posts

    9
  • Joined

  • Last visited

Postal's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

1

Reputation

  1. Как это я так. Видимо проверил покупку из блоков рекомендуем и категории и обрадовался =) Еще раз спасибо вам за помощь.
  2. Может кому пригодится. Можно менять только сам скрипт в common.js, находящийся в папке js вашей темы. Вместо function addToCart(product_id, quantity) { quantity = typeof(quantity) != 'undefined' ? quantity : 1; $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + quantity, dataType: 'json', success: function(json) { $('.success, .warning, .attention, .information, .error').remove(); if (json['redirect']) { location = json['redirect']; } if (json['success']) { $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'); $('.success').fadeIn('slow'); $('#cart-total').html(json['total']); $('html, body').animate({ scrollTop: 0 }, 'slow'); } } }); } должно получится function addToCart(product_id, quantity) { {location = "http:/ваш.домен/index.php?route=information/information&information_id=7"; } } tpl файлы можно оставить в покое в этом случае.
  3. Спасибо, думаю проблему можно считать решенной и идти спать =)
  4. Можно еще уточнить? менять либо только в common.js либо в .tpl -ах, я правильно понял?
  5. Преамбула: сайт должен функционировать как каталог товаров, при нажатии на кнопку "заказать"(та, которая по дефолту "купить") посетитель попадает на страницу с описанием куда ему позвонить или подъехать, и куда ему вообще пойти. После ковыряния в в common.js и в product.tpl были нашел и еще несколько аналогичных, отвечающих за эту кнопку в разных местах шаблона: <script type="text/javascript"><!-- $('#button-cart').bind('click', function() { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'), dataType: 'json', success: function(json) { $('.success, .warning, .attention, information, .error').remove(); if (json['error']) { if (json['error']['option']) { for (i in json['error']['option']) { $('#option-' + i).after('<span class="error">' + json['error']['option'][i] + '</span>'); } } } if (json['success']) { $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'); $('.success').fadeIn('slow'); $('#cart-total').html(json['total']); $('html, body').animate({ scrollTop: 0 }, 'slow'); } } }); }); //--></script> Я понимаю, что мне нужно исправить что-то после if (json['success']) { , вот только что? ajax вселяет в меня ужас, ничего не понимаю. opencart вообще первый день использую, может я вообще не в ту степь полез? Прошу вашей помощи!
Guest
×
  • 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.