Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Nacenka na dop polya
- https://staff.megagroup.ru/staff/client/plan.php?object_type_id=1&object_id=2466561&plan_id=38814838#plan_id_38814838
- https://redmine.oml.ru/issues/45474
- Otkrepil shabloni:
- shop2.v2-white-cart-product.tpl https://pastebin.com/A3xAeVAV
- shop2.v2-cart-product.tpl https://pastebin.com/T1Qv34JV
- shop2.v2-product-options-not-mod.tpl https://pastebin.com/hKKAFFWd
- JS shop2.2.js https://pastebin.com/TkwFMQwF
- obekt js => shop2.margin_price
- metod shop2.margin_price.price_change
- viziv metodov mnogo gde DOCUMENT_READY shop2.queue.margin_price sobitie change 'select.additional-cart-params'
- shop2.margin_price = {
- price_change: function(j_this, selector_parent){
- if( shop2.mode == 'cart' ){
- form = $('#shop2-cart');
- shop2.cart.update(form);
- return;
- }
- var
- $form = $(j_this).closest(selector_parent),
- form = $form.get(0),
- kind_id = form.kind_id.value,
- adds = $form.find('.additional-cart-params'),
- len = adds.length,
- el;
- var param = {
- 'kind_id': form.kind_id.value,
- 'params': {}
- }
- if (len) {
- for (var i = 0; i < len; i += 1) {
- el = adds[i];
- if (el.value) {
- param.params[el.name] = el.value;
- }
- }
- }
- $.ajax({
- url: '/my/s3/xapi/public/?method=shop2/getPrice',
- type: "get",
- data: {"param": param},
- dataType: "json",
- success: function(data){
- $form.find('.price-current').replaceWith( data.result.data.html.price );
- $form.find('.price-old ').replaceWith( data.result.data.html.price_old );
- }
- });
- },
- select_change: function(){
- if( !shop2.cf_margin_price_enabled ){
- return;
- };
- var additional_cart_params = $('select.additional-cart-params');
- if( additional_cart_params.length ){
- additional_cart_params.each(function(index, elem ){
- $.on( elem , {
- change: function(e) {
- shop2.margin_price.price_change( $( e.target ), 'form');
- }
- });
- })
- }else {
- return;
- }
- }
- };
- shop2.queue.margin_price = function() {
- shop2.margin_price.select_change();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement