<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name>Sticky Buton Geliştirmesi</name>
<code>add_to_cart_panel</code>
<version>1.1.1 (OC 2.3)</version>
<author>info@yesilkare.com</author>
<link>https://www.yesilkare.com</link>


<file path="catalog/controller/common/header.php">
<operation>
<search><![CDATA[$data['styles'] = $this->document->getStyles();]]></search>
<add position="before"><![CDATA[
        // Add to Cart Panel BEGIN
        if ($this->config->get('module_add_to_cart_panel_status')) {
            $data['analytics'][] = $this->load->controller('extension/module/add_to_cart_panel/preload');
        }
        // Add to Cart Panel END
]]></add>
</operation>
</file>


<file path="catalog/controller/product/product.php">
<operation>
<search><![CDATA[$data['review_status'] = $this->config->get('config_review_status');]]></search>
<add position="before"><![CDATA[
            // Add to Cart Panel BEGIN
            if ($this->config->get('module_add_to_cart_panel_status')) {
                $data['add_to_cart_panel'] = $this->load->controller('extension/module/add_to_cart_panel', $data);
            } else {
                $data['add_to_cart_panel'] = '';
            }
            // Add to Cart Panel END
]]></add>
</operation>
</file>


<file path="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search><![CDATA[<?php echo $footer; ?>]]></search>
<add position="before"><![CDATA[
<?php if (!empty($add_to_cart_panel)) { ?>
<?php echo $add_to_cart_panel; ?>
<?php } ?>
]]></add>
</operation>

<operation>
<search><![CDATA[$('.text-danger').parent().addClass('has-error');]]></search>
<add position="after"><![CDATA[
        <?php if (!empty($add_to_cart_panel)) { ?>
        // Add to Cart Panel BEGIN
        if ($("#product .has-error").length) {
          var atcpErrorPosition  = $("#product .has-error:first").offset().top - 10;
          var atcpPositionTop    = $(window).scrollTop();
          var atcpPositionBottom = $(window).scrollTop() + $(window).height();

          if (atcpErrorPosition < (atcpPositionTop) || atcpErrorPosition > (atcpPositionBottom - 150)) {
            $("html, body").animate({ scrollTop: atcpErrorPosition }, "slow");
          }
        }
        // Add to Cart Panel END
        <?php } ?>
]]></add>
</operation>
</file>

</modification>
