📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv11.demodesign.com.tr
/
system
📝
fiyat-dusunce-haber-ver.ocmod.xml
← Geri Dön
<modification> <name>Fiyat Düşünce Haber Ver</name> <version>3.5.3</version> <link>#</link> <author>Artı360</author> <code>fiyat_dusunce_haber_ver</code> <file path="catalog/view/theme/journal2/template/journal2/quickview/quickview.twig"> <operation> <search><![CDATA[<div id="container">]]></search> <add position="after"><![CDATA[ {% if askforquote is not empty %} {{ askforquote }} {% endif %} ]]></add> </operation> </file> <file path="catalog/model/journal3/product.php"> <operation> <search><![CDATA[$result[$row['product_id']] = array(]]></search> <add position="before"><![CDATA[ $AFQ = $this->config->get('askforquote'); $this->load->model('catalog/product'); if (!empty($AFQ['Enabled']) && $AFQ['Enabled']=="yes") { if ($AFQ['HidePrice'] != 'Show') { $hide_price = (isset($AFQ['HidePrice']) && $AFQ['HidePrice'] == 'Yes'); if (!empty($AFQ['EnabledAllProducts']) && $AFQ['EnabledAllProducts'] != "no") { $row['discount'] = $hide_price ? -1 : '0'; $row['price'] = $hide_price ? -1 : '0'; $row['special'] = $hide_price ? -1 : '0'; $row['tax_class_id'] = 0; } else if(!empty($AFQ['enabled-products']['product']) && in_array($product_id,$AFQ['enabled-products']['product'])) { $row['discount'] = $hide_price ? -1 : '0'; $row['price'] = $hide_price ? -1 : '0'; $row['special'] = $hide_price ? -1 : '0'; $row['tax_class_id'] = 0; } else if(!empty($AFQ['enabled-categories']) && $AFQ['enabled-categories'] != 'no'){ $product_categories = $this->model_catalog_product->getCategories($query->row['product_id']); if(!empty($product_categories)) { foreach($product_categories as $p_cat) { if(in_array($p_cat['category_id'],$AFQ['enabled-categories']['category'])) { $row['discount'] = $hide_price ? -1 : '0'; $row['price'] = $hide_price ? -1 : '0'; $row['special'] = $hide_price ? -1 : '0'; $row['tax_class_id'] = $hide_price ? -1 : '0'; } } } } } } ]]></add> </operation> </file> <file path="catalog/controller/product/product.php"> <operation> <search><![CDATA[public function index() {]]></search> <add position="after"><![CDATA[ /* AskForQuote start */ if (defined('JOURNAL3_ACTIVE')){ $moduleNameSmall = 'askforquote'; $settings = $this->config->get($moduleNameSmall); $this->load->language('extension/module/'.$moduleNameSmall); $languageVariables = array( 'full_name', 'enter_name', 'email_address', 'enter_email', 'repeat_email', 'comments', 'comments_placeholder', 'submit_button', 'error_empty_name', 'error_email_address', 'sent_request', 'askforaquote_button', 'popup_request_text', 'popup_success_message', 'input_privacy', 'text_privacy_error' ); foreach ($languageVariables as $languageVariable) { $data[$languageVariable] = $this->language->get($languageVariable); } $this->document->addScript('catalog/view/javascript/jquery/askforquote/sweetalert.min.js'); $this->document->addStyle('catalog/view/theme/journal3/stylesheet/askforquote/askforquote.css'); $this->document->addStyle('catalog/view/theme/journal3/stylesheet/askforquote/sweetalert.css'); $data['privacyPolicy'] = ''; if (!empty($settings['PrivacyPolicy'])) { $this->load->model('catalog/information'); $information = $this->model_catalog_information->getInformation($this->config->get('config_account_id')); $data['privacyPolicy'] = '<label id="AFQPrivacyPolicy"><input type="checkbox" name="privacy_policy" value="1" style="width:auto;"> ' . sprintf($this->language->get('input_privacy'), 'index.php?route=information/information&information_id=' . $information['information_id'], $information['title']) . '</label>'; } } ]]></add> </operation> </file> <file path="catalog/view/theme/journal3/template/product/product.twig"> <operation> <search><![CDATA[{{ footer }}]]></search> <add position="before"><![CDATA[ <form role="form" id="afq_form" style="display:none"> <div id="overlay" style="display:none"><div id="loader"><i class="fa fa-spinner fa-spin"></i></div></div> <h4 style="text-align:center;">{{ popup_request_text }} <span id="product_heading"></span></h4> <div id="product_image_holder" style="text-align:center"></div> <div class="form-group"> <div id="quote_details"> </div> </div> <div class="form-group"> <label for="afq_name"><strong>{{ full_name }}</strong></label> <input type="text" class="form-control" placeholder="{{ enter_name }}" id="afq_name" value="" /> </div> <div class="form-group"> <label for="email"><strong>{{ email_address }}</strong></label> <input type="email" placeholder="{{ enter_email }}" class="form-control" id="afq_email" value="" /> <input type="email" placeholder="{{ repeat_email }}" class="form-control" id="afq_repeat_email" value="" /> </div> <div class="form-group"> <label for="comments"><strong>{{ comments }}</strong></label> <textarea class="form-control" placeholder="{{ comments_placeholder }}" id="afq_comments"></textarea> </div> <div class="form-group"> {{ privacyPolicy }} </div> <button type="submit" id="afq_submit" class="btn btn-primary btn-large">{{ submit_button }}</button> <div id="spin"> <i class="afq_loader fa fa-spinner fa-spin" style="display:none;"></i> </div> </form> <script> if (!$.fancybox) { $('head').append('<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox.css" />'); $('head').append('<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox.js"><'+'/script>'); } var afqAddToCartSelector = 'button#button-cart[onclick], [onclick^="cart.add"], [onclick^="addToCart"], [onclick^="mgk_cart.add"], [onclick^="ee_cart.add"], [onclick^="cart_theme.add"], .button[data-clk]'; var checkSinglePrice = function (product_id) { var query = $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea').serialize(); $.ajax({ url: 'index.php?route=extension/module/askforquote/checkPrice&product_ids='+product_id, type: 'post', data: query, dataType: 'json', success: function(json) { if(json['AFQ']) { var selector = '#button-cart'; if (json.replace_add_to_cart == "0") { if ($('#button-afq').length < 1) { var button = $('#button-cart').clone(); button.attr('id', 'button-afq'); button.html('{{ askforaquote_button }}'); button.attr('value','{{ askforaquote_button }}'); $('#button-cart').after( button); button.attr('disabled',false); button.removeClass("disabled"); {% if currenttemplate == 'journal2' %} var window_width = $(window).width(); if (window_width < 700){ $('#button-cart').css({ 'margin-bottom': '10px' }); } else { $('span.button-cart-text').addClass('AFQ_changed'); $('#button-cart').css({ width: '30%', 'font-size': '12px' }); $('#button-afq').css({ width: '30%', 'font-size': '12px' }); } {% endif %} } selector = '#button-afq'; $(selector).unbind('click'); } else { $(selector).html('{{ askforaquote_button }}'); $(selector).attr('value','{{ askforaquote_button }}'); $(selector).unbind('click'); } $(selector).on('click', function() { showAFQPopup(500,275,product_id); }); } else $('#button-cart').button('reset'); } }); } var hasValue = function(needle, haystack) { for (var hay in haystack) { if (haystack[hay] == needle) { return true; } } return false; } var checkPrice = function (product_ids) { $.ajax({ url: 'index.php?route=extension/module/askforquote/checkPrice', type: 'post', data: {product_ids: product_ids}, dataType: 'json', success: function(json) { if(json) { if (!$.fancybox) { $('head').append('<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox.css" />'); $('head').append('<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox.js"><'+'/script>'); } $('[onclick^="cart.add"], [onclick^="addToCart"]').each(function(i,e){ var params = $(this).attr('onclick').match(/\d+/); var item = $(this); if(json.enable_for_all || hasValue(params[0], json)) { item.val('{{ askforaquote_button }}'); item.children('span').html("{{ askforaquote_button }}") item.attr('data-hint',"{{ askforaquote_button }}"); item.attr('data-original-title',"{{ askforaquote_button }}"); if(item.children('i').length < 2) { item.children('i').attr('class',''); item.children('i').attr('class','fa fa-envelope'); } item.attr('onclick','').unbind('click'); item.on('click', function(e) { e.preventDefault(); e.stopPropagation(); showAFQPopupRelatedProducts(500,275,params[0]); }); } }); } } }); } var rescanPage = function(old_product_ids) { var check_product_ids = []; if ($('input[type="hidden"][name="product_id"]').length == 1) { check_product_ids.push($('input[type="hidden"][name="product_id"]').val()); } $(afqAddToCartSelector).each(function(i,e){ var rpAttr = $(this).attr('onclick'); if (typeof rpAttr === 'undefined' || rpAttr === false) { return; } var params = $(this).attr('onclick').match(/\d+/); if (params) { check_product_ids.push(params[0]); } }); checkPrice(check_product_ids); } $(window).load( function() { var single_product_id = '{{ product_id }}'; if(single_product_id == 0) single_product_id = $('input[name=product_id]').val(); if(single_product_id) { checkSinglePrice(single_product_id); $('input[name*=option], select[name*=option]').on('change', function() { checkSinglePrice(single_product_id); }); } var check_product_ids = []; $('[onclick^="cart.add"], [onclick^="addToCart"]').each(function(i,e){ var params = $(this).attr('onclick').match(/\d+/); check_product_ids.push(params[0]); }); checkPrice(check_product_ids); var rescanTimer = null; $(document).bind('DOMNodeInserted', function(event) { let insertedEl = $(event.target); if (!insertedEl.is(afqAddToCartSelector) && insertedEl.find(afqAddToCartSelector).length == 0) return; if (rescanTimer != null) { clearTimeout(rescanTimer); } rescanTimer = setTimeout(rescanPage.bind(null, check_product_ids), 1000); }); }); function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); return pattern.test(emailAddress); }; var showAFQPopupRelatedProducts = function (width, height, product_id) { $.ajax({ url: 'index.php?route=extension/module/askforquote/checkRequiredOptions', data: {product_id: product_id, quantity: 1}, type: 'post', dataType: 'json', success: function(json) { if(json['error']) { location = json['redirect']; } else { openPopup(width, height, product_id, true); } } }); } var openPopup = function(width, height, product_id, isRelated = false) { $.fancybox.open({ content: $('#afq_form').html(), width: width, height: height, autoSize: true, autoDimensions: true, autoScale: true, autoCenter: false, openEffect : 'fade', wrapCSS : 'afq_popup', openSpeed : 150, closeBtn : true, beforeShow: function () { $('div #quote_details').html(''); $('span#product_heading').html(''); $('div #product_image_holder').html(''); $('input#afq_repeat_email').slideUp(1); }, afterShow: function () { $('div #overlay').css('display','block'); $('div #overlay').toggleClass('active'); var query = $('#product input[type=\'text\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea').serialize(); if (isRelated) { // check if the product is related and remove the options from the default product query = ''; } // check if there are other values in the query data if(query.length > 1){ query += '&'; } query += "product_id=" + product_id; $.ajax({ url: 'index.php?route=extension/module/askforquote/checkOptions', type: 'post', data: query, dataType: 'json', success: function(json) { $('span#product_heading').append('<span>'+json.product_name+'</span><br/>'); $('div #product_image_holder').append('<img src="'+ json.product_image +'" alt="">'); $('.fancybox-skin #afq_name').val(json.customer_name); $('.fancybox-skin #afq_email').val(json.customer_email); if (json.quantity > 1 || json.options) { //$('.fancybox-skin #details_title').show(); if (json.quantity > 1) { $('div #quote_details').append('<span><strong>Quantity</strong></span>: '); $('div #quote_details').append('<span id="quote_quantity">'+json.quantity+'</span><br/>'); } if (json.options) { $('div #quote_details').append('<span><strong>Options</strong></span><br/>'); $.each( json.options, function(key, value) { if (value.type == 'date' || value.type == 'datetime' || value.type == 'time' || value.type == 'text' || value.type == 'textarea') { $('div #quote_details').append('- <small class="selected_options" data-optionId='+value.product_option_id+' data-optionValueId='+value.value+'>'+ value.name +': '+value.value+'</small><br/>'); } else{ $('div #quote_details').append('- <small class="selected_options" data-optionId='+value.product_option_id+' data-optionValueId='+value.product_option_value_id+'>'+ value.name +': '+value.value+'</small><br/>'); } }); } } $('div #overlay').css('display','none'); $('div #overlay').toggleClass('active'); } }); $('.fancybox-skin #afq_submit').click(function(e) { e.preventDefault(); e.stopPropagation(); if($('.fancybox-skin #afq_name').val() == '') { $('.fancybox-skin #afq_name').css({ border: '#F59393 1px solid', background: '#FFF0F0' }); if ($('#error-name').length < 1){ $('.fancybox-skin #afq_name').after('<div class="CFPError" id="error-name">{{ error_empty_name }}</div>'); } } else if(!isValidEmailAddress($('.fancybox-skin #afq_email').val()) || $('.fancybox-skin #afq_email').val() == ''){ $('.fancybox-skin #afq_email').css({ border: '#F59393 1px solid', background: '#FFF0F0' }); if ($('#error-email').length < 1){ $('.fancybox-skin #afq_email').after('<div class="CFPError" id="error-email">{{ error_email_address }}</div>'); } } else if ($('label#AFQPrivacyPolicy input').length > 0 && $('label#AFQPrivacyPolicy input:checked').length == 0) { $('label#AFQPrivacyPolicy').addClass("CFP_popover_field_error"); $('label#AFQPrivacyPolicy').after('<div class="CFPError">{{ text_privacy_error }}</div>'); } else { var afq_name = $('.fancybox-skin #afq_name').val(); var afq_email = $('.fancybox-skin #afq_email').val(); var afq_repeat_mail = $('.fancybox-skin #afq_repeat_email').val(); var afq_quote_quantity = $('.fancybox-skin #quote_quantity').html(); var afq_product_id = product_id; var afq_comments = $('.fancybox-skin #afq_comments').val(); var afq_privacy = $('label#AFQPrivacyPolicy input').length > 0 ? $('#AFQPrivacyPolicy input').val() : 0; var options = new Object(); $.each($('.fancybox-skin .selected_options'), function(index, el) { options[el.getAttribute('data-optionId')] = el.getAttribute('data-optionValueId'); }); $.ajax({ url: 'index.php?route=extension/module/askforquote/addQuote', type: 'post', data: {name: afq_name, email: afq_email, repeat_mail: afq_repeat_mail, product_id: afq_product_id, comments: afq_comments, options:options, quantity:afq_quote_quantity, 'privacy_policy':afq_privacy}, dataType: 'json', beforeSend: function() { $(".fancybox-skin #afq_submit").hide(); $(".afq_loader").show(); }, success: function(json) { $(".afq_loader").hide(); $(".fancybox-skin #afq_submit").show(); if(json=='success') { $.fancybox.close(); swal("{{ popup_success_message }}", "{{ sent_request }}", "success"); } } }); } }); } }); } var showAFQPopup = function (width,height,product_id) { $.ajax({ url: 'index.php?route=extension/module/askforquote/checkRequiredOptions', type: 'post', data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'), dataType: 'json', success: function(json) { if (!json['error']){ openPopup(width, height, product_id); } else { if (json['error']) { $('.alert, .text-danger').remove(); $('.form-group').removeClass('has-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>'); } // Highlight any found errors $('.text-danger').parent().addClass('has-error'); } } } }); }; </script> {% if askforquote.CustomCSS is not empty %} <style> {% autoescape %} {{ askforquote.CustomCSS|raw }} {% endautoescape %} </style> {% endif %} ]]></add> </operation> </file> </modification>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula