-- Table structure for table `ac_location`
--

CREATE TABLE `ac_location` (
  `location_id` int(11) NOT NULL,
  `name` varchar(32) NOT NULL,
  `address` text NOT NULL,
  `telephone` varchar(32) NOT NULL,
  `fax` varchar(32) NOT NULL,
  `geocode` varchar(32) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `open` text NOT NULL,
  `comment` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `ac_manufacturer`
--

CREATE TABLE `ac_manufacturer` (
  `manufacturer_id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `sort_order` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `ac_manufacturer`
--

INSERT INTO `ac_manufacturer` (`manufacturer_id`, `name`, `image`, `sort_order`) VALUES
(23, 'Acer', 'catalog/website/brand/acer-logo-198x85w.png', 0),
(25, 'AMD', 'catalog/website/brand/amd-198x85w.png', 0),
(26, 'CP Plus', 'catalog/website/brand/cp-plus-198x85w.png', 0),
(27, 'D-Link', 'catalog/website/brand/d-link-198x85w.png', 0),
(28, 'GEIL', 'catalog/website/brand/geil-198x85w.png', 0),
(29, 'SAPPHIRE', 'catalog/website/brand/sapphire-198x85w.png', 0),
(30, 'SEAGATE', 'catalog/website/brand/seagate-logo-new-198x85h.png', 0),
(31, 'Thermaltake', 'catalog/website/brand/thermaltake-198x85w.png', 0),
(32, 'Transcend', 'catalog/website/brand/transend-198x85w.png', 0),
(33, 'ViewSonic', 'catalog/website/brand/viewsonic-198x85w.png', 0),
(34, 'ZOTAC', 'catalog/website/brand/zotac-gaming-logo-198x85w.png', 0),
(35, 'HP', 'catalog/website/logo/hp-logo.png', 0),
(36, 'Redragon', '', 0),
(37, 'R&amp;M', '', 0),
(38, 'Samsung', '', 0),
(39, 'Pantum', '', 0),
(40, 'Lenovo', 'catalog/website/logo/lenovo.PNG', 0),
(41, 'IMOU', 'catalog/website/brand/imou-logo-198x85w-100x100.PNG', 0),
(42, 'Fantech ', '', 0),
(43, 'Dell', 'catalog/website/logo/dell-logo.png', 0),
(44, 'Non-Brand', '', 0),
(45, 'Adata', '', 0),
(46, 'Netac', '', 0),
(47, 'Asus', 'catalog/website/logo/asus.PNG', 0),
(48, 'Toshiba', '', 0),
(49, 'Fujitsu', '', 0),
(50, 'Apple', 'catalog/website/logo/apple-logo.PNG', 0),
(51, 'Microsoft Surface', 'catalog/website/logo/logo-surface-pro-3-surface-pro-2-surface-pro-4-microsof-surface.jpg', 0),
(52, 'A4tech', 'catalog/website/logo/a4tech-dear-it-logo.png', 0),
(53, 'Logitech', 'catalog/website/logo/logitech-logo.PNG', 0),
(54, 'Tp-link', '', 0),
(55, 'Kisonli', 'catalog/website/logo/Kisonli.png', 0),
(56, 'Western Digital', 'catalog/website/logo/Western Digital logo.png', 0),
(57, 'G.Skill', '', 0),
(58, 'zyxel', 'catalog/website/logo/zyxel-logo.PNG', 0),
(59, 'Amazfit ', 'catalog/website/logo/2 copy copy.PNG', 0),
(60, 'Yison', 'catalog/website/logo/2024.PNG', 0),
(61, 'JBL', 'catalog/website/logo/JBL-Logo.svg.png', 0),
(62, 'Antec', '', 0),
(63, 'Canon', '', 0),
(64, 'Brother', 'catalog/website/logo/brother-.eps-logo-vector.png', 0),
(65, 'Havit', 'catalog/website/logo/habit logo.PNG', 0),
(67, 'Kieslect', 'catalog/website/logo/images-min.png', 20),
(68, 'Epson', 'catalog/website/logo/Epson-Logo.png', 27),
(69, 'HIkvision', 'catalog/website/logo/4444.PNG', 0),
(70, 'Dahua', 'catalog/website/logo/22.png', 20),
(71, 'Tenda', 'catalog/website/logo/tenda logooo.PNG', 0),
(72, 'MeeTion', 'catalog/website/logo/fhfG.PNG', 0),
(73, 'Onten', 'catalog/website/logo/onten.PNG', 0),
(74, 'Sony ', 'catalog/website/logo/images.png', 0),
(75, 'Unit', '', 25),
(76, 'Boya ', 'catalog/website/logo/images.png', 30),
(77, 'K&amp;F Concept', 'catalog/website/logo/s-l300.png', 30),
(78, 'Digipod', 'catalog/website/logo/digipod-logo-with-alpha-channel-1-1024x285.png', 32),
(79, 'Yunteng ', 'catalog/website/logo/Untitled-1 copy.PNG', 34),
(80, 'Maono', 'catalog/website/logo/Maono logo.PNG', 0),
(81, 'STARINK', 'catalog/website/logo/images.png', 35),
(82, 'Value-Top', 'catalog/website/logo/Untitled-1 copy.PNG', 30),
(83, 'Xiaomi  ', 'catalog/website/logo/Xiaomi_logo_(2021-).svg.png', 40),
(84, 'Zeblaze', '', 40),
(85, 'Warrior', 'catalog/website/logo/warrior.png', 42),
(86, 'Billion Reservoirs', '', 40),
(87, 'inforce', '', 40),
(88, 'BRX', '', 45),
(89, 'Haier ', '', 45),
(90, 'MSI', 'catalog/website/logo/images (1).png', 45),
(91, 'Cudy', '', 0),
(92, 'Power Guard', '', 30),
(93, 'SANTAK', '', 32),
(94, 'Digital X', '', 40),
(95, 'Prolink', '', 42),
(96, 'Apollo', '', 12),
(97, 'Ruijie', '', 42),
(98, 'Jedel', 'catalog/20250213112129.png', 0),
(99, 'KISONLI', '', 0),
(100, 'Orico', 'catalog/logo .png', 0),
(101, 'Wesder', 'catalog/ezgif.com-webp-to-jpg-converter (13).jpg', 0),
(102, 'Nice Tech', '', 0),
(103, 'Cooler Master', 'catalog/download.png', 0),
(104, 'Alfa', '', 0),
(105, 'CHEERLUX', '', 0);

-- --------------------------------------------------------

--
-- Table structure for table `ac_manufacturer_to_store`
--

CREATE TABLE `ac_manufacturer_to_store` (
  `manufacturer_id` int(11) NOT NULL,
  `store_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `ac_manufacturer_to_store`
--

INSERT INTO `ac_manufacturer_to_store` (`manufacturer_id`, `store_id`) VALUES
(23, 0),
(25, 0),
(26, 0),
(27, 0),
(28, 0),
(29, 0),
(30, 0),
(31, 0),
(32, 0),
(33, 0),
(34, 0),
(35, 0),
(36, 0),
(37, 0),
(38, 0),
(39, 0),
(40, 0),
(41, 0),
(42, 0),
(43, 0),
(44, 0),
(45, 0),
(46, 0),
(47, 0),
(48, 0),
(49, 0),
(50, 0),
(51, 0),
(52, 0),
(53, 0),
(54, 0),
(55, 0),
(56, 0),
(57, 0),
(58, 0),
(59, 0),
(60, 0),
(61, 0),
(62, 0),
(63, 0),
(64, 0),
(65, 0),
(67, 0),
(68, 0),
(69, 0),
(70, 0),
(71, 0),
(72, 0),
(73, 0),
(74, 0),
(75, 0),
(76, 0),
(77, 0),
(78, 0),
(79, 0),
(80, 0),
(81, 0),
(82, 0),
(83, 0),
(84, 0),
(85, 0),
(86, 0),
(87, 0),
(88, 0),
(89, 0),
(90, 0),
(91, 0),
(92, 0),
(93, 0),
(94, 0),
(95, 0),
(96, 0),
(97, 0),
(98, 0),
(99, 0),
(100, 0),
(101, 0),
(102, 0),
(103, 0),
(104, 0),
(105, 0);

-- --------------------------------------------------------

--
-- Table structure for table `ac_marketing`
--

CREATE TABLE `ac_marketing` (
  `marketing_id` int(11) NOT NULL,
  `name` varchar(32) NOT NULL,
  `description` text NOT NULL,
  `code` varchar(64) NOT NULL,
  `clicks` int(5) NOT NULL DEFAULT 0,
  `date_added` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `ac_marketing`
--

INSERT INTO `ac_marketing` (`marketing_id`, `name`, `description`, `code`, `clicks`, `date_added`) VALUES
(1, '2 Megapixel', 'ffffffff', '66017937d868a', 2, '2024-03-25 19:16:54');

-- --------------------------------------------------------

--
-- Table structure for table `ac_modification`
--

CREATE TABLE `ac_modification` (
  `modification_id` int(11) NOT NULL,
  `extension_install_id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL,
  `code` varchar(64) NOT NULL,
  `author` varchar(64) NOT NULL,
  `version` varchar(32) NOT NULL,
  `link` varchar(255) NOT NULL,
  `xml` mediumtext NOT NULL,
  `status` tinyint(1) NOT NULL,
  `date_added` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `ac_modification`
--

INSERT INTO `ac_modification` (`modification_id`, `extension_install_id`, `name`, `code`, `author`, `version`, `link`, `xml`, `status`, `date_added`) VALUES
(6, 6, 'DearSoft Short Description Attribute', 'DearSoft-short-description-attribute', 'DearSoft', '1.1', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>DearSoft Short Description Attribute</name>\n    <code>DearSoft-short-description-attribute</code>\n    <version>1.1</version>\n    <author>DearSoft</author>\n    <link>https://dearsoft.bd</link>\n\n    <file path=\"admin/controller/catalog/product.php\">\n        <operation>\n            <search><![CDATA[$data[\'languages\'] = $this->model_localisation_language->getLanguages();]]></search>\n            <add position=\"after\"><![CDATA[\n                //short description attribute start\n                $data[\'short_description_attribute\'] = $this->config->get(\'short_description_attribute\');\n                $short_description_attribute = $this->config->get(\'short_description_attribute\');\n                if(isset($short_description_attribute[\'status\']) && $short_description_attribute[\'status\'] == 1) {     \n                    if (isset($this->request->post[\'product_short_description\'])) {\n                        $data[\'short_description_attributes\'] = $this->request->post[\'product_short_description\'];\n                    } elseif (isset($this->request->get[\'product_id\'])) {\n                        $this->load->model(\'extension/module/short_description_attribute\');                 \n                        $data[\'short_description_attributes\'] = $this->model_extension_module_short_description_attribute->getShortDescriptionAttributes($this->request->get[\'product_id\']);\n                    } else {\n                        $data[\'short_description_attributes\'] = array();       \n                    }\n                }\n                //short description attribute end\n            ]]></add>\n        </operation>\n    </file>\n\n\n     <file path=\"admin/view/template/catalog/product_form.twig\">\n        <operation>\n            <search><![CDATA[<label class=\"col-sm-2 control-label\" for=\"input-meta-title{{ language.language_id }}\">{{ entry_meta_title }}</label>]]></search>\n            <add position=\"before\" offset=\"1\"><![CDATA[\n            {% if short_description_attribute.status and short_description_attribute.status == 1 %}\n                    <div class=\"form-group\">\n                        <label class=\"col-sm-2 control-label\" for=\"input-description{{ language.language_id }}\">Short Description</label>\n                        <div class=\"col-sm-10\">\n                            <div class=\"table-responsive\">\n                                <table id=\"short-attribute\" class=\"table table-striped table-bordered table-hover\">\n                                  <thead>\n                                    <tr>\n                                      <td class=\"text-left\">Featured Text</td>\n                                      <td class=\"text-right\"><button type=\"button\" onclick=\"addAttribute1();\" data-toggle=\"tooltip\" title=\"{{ button_attribute_add }}\" class=\"btn btn-primary\"><i class=\"fa fa-plus-circle\"></i></button></td>\n                                    </tr>\n                                  </thead>\n                                  <tbody>\n                \n                                    {% set short_attribute_row = 0 %}\n                                    {% for description_attributes in short_description_attributes %}\n                                      <tr id=\"short-attribute-row{{ short_attribute_row }}\">\n                                        <td class=\"text-left\">\n                                            {% for language in languages %}\n                                            <div class=\"input-group\"><span class=\"input-group-addon\"><img src=\"language/{{ language.code }}/{{ language.code }}.png\" title=\"{{ language.name }}\"/></span> \n                                            <textarea name=\"short_description_attribute[{{ language.language_id }}][description][]\" rows=\"1\" placeholder=\"{{ entry_text }}\" class=\"form-control\">{{ description_attributes.description ? description_attributes.description }}</textarea>\n                                            </div>\n                                          {% endfor %}\n                                          </td>\n                                        <td class=\"text-right\"><button type=\"button\" onclick=\"$(\'#short-attribute-row{{ short_attribute_row }}\').remove();\" data-toggle=\"tooltip\" title=\"{{ button_remove }}\" class=\"btn btn-danger\"><i class=\"fa fa-minus-circle\"></i></button></td>\n                                      </tr>\n                                      {% set short_attribute_row = short_attribute_row + 1 %}\n                                    {% endfor %}\n                                  </tbody>\n                \n                                </table>\n                              </div>\n                        </div>\n                    </div>\n                    {% endif %}\n            ]]></add>\n        </operation>\n\n        <operation>\n            <search><![CDATA[var option_row = {{ option_row }};]]></search>\n            <add position=\"before\" offset=\"1\">\n                <![CDATA[\n                <script type=\"text/javascript\">\n                  var short_attribute_row = 100;\n\n                  function addAttribute1() {\n                      html = \'<tr id=\"short-attribute-row\' + short_attribute_row + \'\">\';\n                      html += \'  <td class=\"text-left\">\';\n                    {% for language in languages %}\n                      html += \'<div class=\"input-group\"><span class=\"input-group-addon\"><img src=\"language/{{ language.code }}/{{ language.code }}.png\" title=\"{{ language.name }}\" /></span><textarea name=\"short_description_attribute[{{ language.language_id }}][description][]\" rows=\"1\" placeholder=\"{{ entry_text }}\" class=\"form-control\"></textarea></div>\';\n                    {% endfor %}\n                      html += \'  </td>\';\n                      html += \'  <td class=\"text-right\"><button type=\"button\" onclick=\"$(\\\'#short-attribute-row\' + short_attribute_row + \'\\\').remove();\" data-toggle=\"tooltip\" title=\"{{ button_remove }}\" class=\"btn btn-danger\"><i class=\"fa fa-minus-circle\"></i></button></td>\';\n                      html += \'</tr>\';\n\n                      $(\'#short-attribute tbody\').append(html);\n\n                      short_attribute_row++;\n                  }\n                  </script>\n                ]]>\n            </add>\n        </operation>\n    </file>\n\n    <file path=\"admin/model/catalog/product.php\">\n        <operation info=\"when delete product\">\n            <search><![CDATA[public function deleteProduct($product_id) {]]></search>\n            <add position=\"after\" offset=\"4\"><![CDATA[\n            $this->db->query(\"DELETE FROM \" . DB_PREFIX . \"product_short_description_attribute WHERE product_id = \'\" . (int)$product_id . \"\'\");\n              ]]></add>\n        </operation>  \n\n         <!-- <operation info=\"when copy product\">\n            <search><![CDATA[$this->addProduct($data);]]></search>\n            <add position=\"before\"><![CDATA[\n            $this->load->model(\'extension/module/short_description\'); \n            $data[\'product_short_description\'] =  $this->model_extension_module_short_description_attribute->get_desrc_product_copy($product_id);\n                        ]]>\n            </add>\n        </operation> -->\n        \n        <operation info=\"when insert new product\">\n            <search><![CDATA[$product_id = $this->db->getLastId();]]></search>\n            <add position=\"after\"><![CDATA[\n                   $this->load->model(\'extension/module/short_description_attribute\'); \n        $this->model_extension_module_short_description_attribute->insert($product_id, $data);                       \n                ]]>\n            </add>\n        </operation>            \n        <operation info=\"when eidt product\">\n            <search><![CDATA[public function editProduct($product_id, $data) {]]></search>\n            <add position=\"after\" offset=\"1\"><![CDATA[\n                        $this->load->model(\'extension/module/short_description_attribute\'); \n        $this->model_extension_module_short_description_attribute->insert($product_id, $data);                        \n                ]]>\n            </add>\n        </operation> \n    </file>\n\n    <file path=\"catalog/controller/product/product.php\">\n        <operation info=\"change description show\">\n            <search><![CDATA[$data[\'description\'] = html_entity_decode($product_info[\'description\'], ENT_QUOTES, \'UTF-8\');]]></search>\n            <add position=\"replace\"><![CDATA[\n               //short description attribute start\n                $product_id = (int)$this->request->get[\'product_id\'];\n                $short_description_config = $this->config->get(\'short_description_attribute\'); \n                $data[\'product_attributes\'] = array();\n                if(isset($short_description_config[\'status\']) && $short_description_config[\'status\'] == 1 ) {\n\n                    $this->load->model(\'extension/module/short_description_attribute\');\n                    \n                    $product_attributes_list = $this->model_extension_module_short_description_attribute->getShortDescriptionAttributes($product_id);\n                    $description = array();\n                    foreach($product_attributes_list as $row){\n                        if($row[\'description\']){\n                            $description[] = html_entity_decode($row[\'description\'], ENT_QUOTES, \'UTF-8\');\n                        }\n                    }\n                    $data[\'product_attributes\'] = $description;\n\n                }\n                \n                $attr_table = \'\';\n                if($data[\'product_attributes\']){\n                    \n                    $attr_table .= \'<div class=\"module-features-description\">\n                            <ul>\';\n                    foreach($data[\'product_attributes\'] as $d){\n                        $attr_table .=\'<li>\'.$d.\'</li>\';\n                    }\n                    $attr_table .= \'</ul>\n                        </div>\';\n                }\n                //short description attribute end\n                \n                $data[\'description\'] = $attr_table;\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/controller/product/category.php\">\n        <operation info=\"change description show\">\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\n            <add position=\"before\"><![CDATA[\n                //short description attribute start\n                $product_id = $result[\'product_id\'];\n                $short_description_config = $this->config->get(\'short_description_attribute\'); \n                $data[\'product_attributes\'] = array();\n                if(isset($short_description_config[\'status\']) && $short_description_config[\'status\'] == 1 ) {\n    \n                    $this->load->model(\'extension/module/short_description_attribute\');\n                    \n                    $product_attributes_list = $this->model_extension_module_short_description_attribute->getShortDescriptionAttributes($product_id);\n                    $description = array();\n                    foreach($product_attributes_list as $row){\n                        if($row[\'description\']){\n                            $description[] = html_entity_decode($row[\'description\'], ENT_QUOTES, \'UTF-8\');\n                        }\n                    }\n                    $data[\'product_attributes\'] = $description;\n    \n                }\n                //short description attribute end\n            ]]></add>\n        </operation>\n        <operation info=\"change description show\">\n            <search><![CDATA[\'name\'        => $result[\'name\'],]]></search>\n            <add position=\"after\">\n            <![CDATA[\n                \'product_attributes\' => $data[\'product_attributes\'],\n                ]]>\n            </add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/controller/product/search.php\">\n        <operation info=\"change description show\">\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\n            <add position=\"before\"><![CDATA[\n                //short description attribute start\n                $product_id = $result[\'product_id\'];\n                $short_description_config = $this->config->get(\'short_description_attribute\'); \n                $data[\'product_attributes\'] = array();\n                if(isset($short_description_config[\'status\']) && $short_description_config[\'status\'] == 1 ) {\n    \n                    $this->load->model(\'extension/module/short_description_attribute\');\n                    \n                    $product_attributes_list = $this->model_extension_module_short_description_attribute->getShortDescriptionAttributes($product_id);\n                    $description = array();\n                    foreach($product_attributes_list as $row){\n                        if($row[\'description\']){\n                            $description[] = html_entity_decode($row[\'description\'], ENT_QUOTES, \'UTF-8\');\n                        }\n                    }\n                    $data[\'product_attributes\'] = $description;\n    \n                }\n                //short description attribute end\n            ]]></add>\n        </operation>\n        <operation info=\"change description show\">\n            <search><![CDATA[\'name\'        => $result[\'name\'],]]></search>\n            <add position=\"after\">\n            <![CDATA[\n                \'product_attributes\' => $data[\'product_attributes\'],\n                ]]>\n            </add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/view/theme/journal3/template/journal3/product_card.twig\">\n        <operation>\n            <search><![CDATA[<div class=\"description\">{{ product.description }}</div>]]></search>\n            <add position=\"replace\"><![CDATA[\n                \n                <style>\n                .module-features-description ul{\n                padding-inline-start: 20px !important;\n                }\n                .module-features-description ul ul{\n                display: contents;\n                }\n                .module-features-description ul ul li {\n                    list-style-type: disc;\n                }\n\n                </style>\n                <div class=\"description\">\n                    {% if product.product_attributes %}\n                        <div class=\"module-features-description\">\n                            <ul>\n                                {% for short_attribute in product.product_attributes %}\n                                    <li>{{ short_attribute }}</li>\n                                {% endfor %}\n                            </ul>\n                        </div>\n                        {% endif %}\n                    </div>\n                ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/controller/journal3/{blocks,product_tabs}.php\">\n        <operation info=\"change description show\">\n            <search><![CDATA[static::$PRODUCT_INFO[\'short_description\'] = utf8_substr(strip_tags(html_entity_decode(static::$PRODUCT_INFO[\'description\'], ENT_QUOTES, \'UTF-8\')), 0, (int)$short_description_limit) . \'..\';]]></search>\n            <add position=\"replace\"><![CDATA[\n                //short description attribute start\n            $product_id = (int)$this->request->get[\'product_id\'];\n            $short_description_config = $this->config->get(\'short_description_attribute\'); \n            $data[\'product_attributes\'] = array();\n            if(isset($short_description_config[\'status\']) && $short_description_config[\'status\'] == 1 ) {\n\n                $this->load->model(\'extension/module/short_description_attribute\');\n                \n                $product_attributes_list = $this->model_extension_module_short_description_attribute->getShortDescriptionAttributes($product_id);\n                $description = array();\n                foreach($product_attributes_list as $row){\n                    if($row[\'description\']){\n                        $description[] = html_entity_decode($row[\'description\'], ENT_QUOTES, \'UTF-8\');\n                    }\n                }\n                $data[\'product_attributes\'] = $description;\n\n            }\n            \n            $attr_table = \'\';\n            if($data[\'product_attributes\']){\n                \n                $attr_table .= \'<div class=\"module-features-description\">\n                          <ul>\';\n                foreach($data[\'product_attributes\'] as $d){\n                      $attr_table .=\'<li>\'.$d.\'</li>\';\n                }\n                $attr_table .= \'</ul>\n                    </div>\';\n            }\n            //short description attribute end\n            \n            //$data[\'description\'] = $attr_table;\n            static::$PRODUCT_INFO[\'short_description\'] = $attr_table;\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/controller/extension/pc_builder/pc_builder_search.php\">\n        <operation info=\"change description show\">\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\n            <add position=\"before\"><![CDATA[\n                //short description attribute start\n                $product_id = $result[\'product_id\'];\n                $short_description_config = $this->config->get(\'short_description_attribute\'); \n                $data[\'product_attributes\'] = array();\n                if(isset($short_description_config[\'status\']) && $short_description_config[\'status\'] == 1 ) {\n    \n                    $this->load->model(\'extension/module/short_description_attribute\');\n                    \n                    $product_attributes_list = $this->model_extension_module_short_description_attribute->getShortDescriptionAttributes($product_id);\n                    $description = array();\n                    foreach($product_attributes_list as $row){\n                        if($row[\'description\']){\n                            $description[] = html_entity_decode($row[\'description\'], ENT_QUOTES, \'UTF-8\');\n                        }\n                    }\n                    $data[\'product_attributes\'] = $description;\n    \n                }\n                //short description attribute end\n\n                $attr_table = \'\';\n                if($data[\'product_attributes\']){\n                    \n                    $attr_table .= \'<div class=\"module-features-description\">\n                            <ul>\';\n                    foreach($data[\'product_attributes\'] as $d){\n                        $attr_table .=\'<li>\'.$d.\'</li>\';\n                    }\n                    $attr_table .= \'</ul>\n                        </div>\';\n                }\n                //short description attribute end\n            ]]></add>\n        </operation>\n\n        <operation info=\"change description show\">\n            <search><![CDATA[\'description\' => utf8_substr(trim(strip_tags(html_entity_decode($result[\'description\'], ENT_QUOTES, \'UTF-8\'))), 0, $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_product_description_length\')) . \'..\',]]></search>\n            <add position=\"after\"><![CDATA[\'description\' => $attr_table,]]></add>\n        </operation>\n\n    </file>\n\n</modification>\n', 1, '2023-12-26 16:35:13'),
(7, 7, 'DearSoft Custom Compare', 'DearSoft-custom-compare', 'DearSoft', '1.1', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>DearSoft Custom Compare</name>\r\n    <code>dearsoft-custom-compare</code>\r\n    <version>1.1</version>\r\n    <author>DearSoft</author>\r\n    <link>https://dearsoft.bd</link>\r\n\r\n</modification>\r\n', 1, '2023-12-30 10:49:18'),
(3, 3, 'Live Product Editor', 'DearSoft-live-product-editor', 'DearSoft', '5.1', 'https://www.dearsoft.bd', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<modification>\n	<name>Live Product Editor</name>\n	<version>5.1</version>\n	<code>again-live-product-editor</code>\n  <author>DearSoft</author>\n  <link>https://www.dearsoft.bd</link>\n\n<!-- Seperate left menu -->\n\n<!-- ADMIN - CONTROLLER [START] -->\n  <!-- common/column_left [START] -->\n  <file path=\"admin/controller/common/column_left.php\">\n    <operation>\n      <search><![CDATA[ if ($this->user->hasPermission(\'access\', \'catalog/recurring\')) { ]]></search>\n      <add position=\"before\"><![CDATA[\n			if ($this->user->hasPermission(\'access\', \'extension/product_extra\')) {\n				$catalog[] = array(\n					\'name\'	   => $this->language->get(\'text_instant_editor\'),\n					\'href\'     => $this->url->link(\'extension/product_extra\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()\n				);\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/column_left [END] -->\n\n  <!-- en-gb/en-gb [START] -->\n  <file path=\"admin/language/en-gb/en-gb.php\">\n    <operation>\n      <search><![CDATA[\n      <?php\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			// Text\n			$_[\'text_instant_editor\'] = \'Live Editor\';\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- en-gb/en-gb [END] -->\n\n<!-- ADMIN - CONTROLLER [END] -->\n</modification>\n', 1, '2023-05-14 12:02:36'),
(5, 5, 'Admin Show Promotion Menu In Sidebar', 'admin_show_promotion_menu', 'DearSoft', '1.0', 'https://dearsoft.bd/', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>Admin Show Promotion Menu In Sidebar</name>\n    <code>admin_show_promotion_menu</code>\n    <version>1.0</version>\n    <author>DearSoft</author>\n    <link>https://dearsoft.bd/</link>\n    <description>This will add Promotion link in admin left sidebar bellow marketing</description>\n\n    <!-- Controller -->\n    <file path=\"admin/controller/common/column_left.php\">\n        <operation error=\"skip\">\n            <search index=\"0\"><![CDATA[if ($this->user->hasPermission(\'access\', \'marketplace/extension\')) {]]></search>\n            <add position=\"before\"><![CDATA[\n            if ($this->user->hasPermission(\'access\', \'marketplace/extension\')) {\n				$marketplace[] = array(\n					\'name\'	   => $this->language->get(\'text_module\'),\n					\'href\'     => $this->url->link(\'marketplace/extension\', [\n						\'user_token\' => $this->session->data[\'user_token\'],\n						\'type\' => \'module\',\n					], true),\n					\'children\' => array()\n				);\n			}\n            ]]></add>\n        </operation>\n\n        <operation error=\"skip\">\n            <search index=\"0\"><![CDATA[if ($this->user->hasPermission(\'access\', \'marketing/contact\')) {]]></search>\n            <add position=\"before\"><![CDATA[\n            // X Extensions\n            $x_extensions = array();\n              if ($this->user->hasPermission(\'access\', \'extension/module/xgift\')) {\n                $x_extensions[] = array(\n                  \'name\'     => $this->language->get(\'text_gift\'),\n                  \'href\'     => $this->url->link(\'extension/module/xgift\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n                  \'children\' => array()\n                );\n              }\n\n              if ($this->user->hasPermission(\'access\', \'extension/module/xdiscount\')) {\n                $x_extensions[] = array(\n                  \'name\'     => $this->language->get(\'text_discount\'),\n                  \'href\'     => $this->url->link(\'extension/module/xdiscount\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n                  \'children\' => array()\n                );\n              }\n\n              if ($this->user->hasPermission(\'access\', \'extension/total/xfeepro\')) {\n                $x_extensions[] = array(\n                  \'name\'     => $this->language->get(\'text_fee\'),\n                  \'href\'     => $this->url->link(\'extension/total/xfeepro\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n                  \'children\' => array()\n                );\n              }\n\n              if ($this->user->hasPermission(\'access\', \'extension/shipping/xshippingpro\')) {\n                $x_extensions[] = array(\n                  \'name\'     => $this->language->get(\'text_shipping_discount\'),\n                  \'href\'     => $this->url->link(\'extension/shipping/xshippingpro\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n                  \'children\' => array()\n                );\n              }\n\n              if ($x_extensions) {\n                $marketing[] = array(\n                  \'name\'     => $this->language->get(\'text_promotions\'),\n                  \'href\'     => \'\',\n                  \'children\' => $x_extensions\n                );\n              }\n            ]]></add>\n        </operation>\n    </file>\n\n    <!-- Language -->\n    <file path=\"admin/language/*/common/column_left.php\">\n        <operation>\n            <search><![CDATA[$_[\'text_extension\']            = \'Extensions\';]]></search>\n            <add position=\"before\"><![CDATA[\n                    $_[\'text_module\']               = \'Modules\';\n                    $_[\'text_promotions\']           = \'Promotions\';\n                    $_[\'text_gift\']                 = \'Gift\';\n                    $_[\'text_discount\']             = \'Discount\';\n                    $_[\'text_fee\']                  = \'Fee\';\n                    $_[\'text_shipping_discount\']    = \'Shipping Discount\';\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/marketplace/extension.twig\">\n        <operation>\n            <search><![CDATA[<div id=\"extension\"></div>]]></search>\n            <add position=\"before\"><![CDATA[\n                <style>\n                .img-responsive{\n                    display:none !important;\n                }\n                </style>\n            ]]></add>\n        </operation>\n    </file>\n</modification>', 1, '2023-07-12 21:36:55'),
(8, 8, 'Product Questions & Answers', 'questions_and_answers', 'DearSoft', '2.0.7', 'https://www.dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n	<name>Product Questions &amp; Answers</name>\n	<code>questions_and_answers</code>\n	<version>2.0.7</version>\n	<author>DearSoft</author>\n	<link>https://www.dearsoft.bd</link>\n\n	<file path=\"system/config/qa.php\">\n		<operation info=\"Indicate that the OCMOD script is working\" error=\"log\">\n			<search><![CDATA[<?php]]></search>\n			<add position=\"after\"><![CDATA[$_[\'qa_ocmod_script_working\'] = true;\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/controller/design/layout.php\">\n		<operation info=\"Hack: filter out Q&amp;A from modules list\" error=\"log\">\n			<search><![CDATA[foreach ($extensions as $code)]]></search>\n			<add position=\"after\"><![CDATA[\n			if ($code == \'qa\') continue;\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/model/setting/event.php\">\n		<operation info=\"Get event data\">\n			<ignoreif><![CDATA[public function getEventByCodeTriggerAction($code, $trigger, $action)]]></ignoreif>\n			<search><![CDATA[\n			public function addEvent\n			]]></search>\n			<add position=\"before\"><![CDATA[\n	public function getEventByCodeTriggerAction($code, $trigger, $action) {\n		$event = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"event` WHERE `code` = \'\" . $this->db->escape($code) . \"\' AND `trigger` = \'\" . $this->db->escape($trigger) . \"\' AND `action` = \'\" . $this->db->escape($action) . \"\'\");\n\n		return $event->rows;\n	}\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/controller/common/column_left.php\">\n		<operation>\n			<search><![CDATA[\n			if ($this->user->hasPermission(\'access\', \'catalog/information\')) {\n			]]></search>\n			<add position=\"before\"><![CDATA[\n		if ($this->config->get(\'module_qa_status\') && $this->user->hasPermission(\'access\', \'extension/module/qa\')) {\n			$this->load->language(\"extension/module/qa\", \"qa\");\n			$catalog[] = array(\n				\'name\'     => $this->language->get(\"qa\")->get(\'text_menu_qa\'),\n				\'href\'     => $this->url->link(\'extension/module/qa/view\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n				\'children\' => array()\n			);\n		}\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/controller/setting/setting.php\">\n		<operation>\n			<search><![CDATA[\n			$data[\'captcha_pages\'] = array()\n			]]></search>\n			<add position=\"after\"><![CDATA[\n		if ($this->config->get(\'module_qa_status\')) {\n			$this->load->language(\"extension/module/qa\", \"qa\");\n			$data[\'captcha_pages\'][] = array(\n				\'text\'  => $this->language->get(\"qa\")->get(\'text_captcha_qa\'),\n				\'value\' => \'qa\'\n			);\n		}\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"system/library/pagination.php\">\n		<operation>\n			<ignoreif><![CDATA[function render_custom()]]></ignoreif>\n			<search><![CDATA[\n			function render()\n			]]></search>\n			<add position=\"before\"><![CDATA[\n	public function render_custom() {\n		$total = $this->total;\n\n		if (!property_exists($this, \'page_var\') || !isset($this->page_var)) {\n			$this->page_var = \'page\';\n		}\n\n		if ($this->page < 1) {\n			$page = 1;\n		} else {\n			$page = $this->page;\n		}\n\n		if (!(int)$this->limit) {\n			$limit = 10;\n		} else {\n			$limit = $this->limit;\n		}\n\n		$num_links = $this->num_links;\n		$num_pages = ceil($total / $limit);\n\n		$this->url = str_replace(\'%7Bpage%7D\', \'{page}\', $this->url);\n\n		$output = \'<ul class=\"\' . $this->style . \'\">\';\n\n		if ($page > 1) {\n			$output .= \'<li><a href=\"\' . str_replace(array(\"&amp;{$this->page_var}={page}\", \"?{$this->page_var}={page}\", \"&{$this->page_var}={page}\"), \'\', $this->url) . \'\">\' . $this->text_first . \'</a></li>\';\n\n			if ($page - 1 === 1) {\n				$output .= \'<li><a href=\"\' . str_replace(array(\"&amp;{$this->page_var}={page}\", \"?{$this->page_var}={page}\", \"&{$this->page_var}={page}\"), \'\', $this->url) . \'\">\' . $this->text_prev . \'</a></li>\';\n			} else {\n				$output .= \'<li><a href=\"\' . str_replace(\'{page}\', $page - 1, $this->url) . \'\">\' . $this->text_prev . \'</a></li>\';\n			}\n		}\n\n		if ($num_pages > 1) {\n			if ($num_pages <= $num_links) {\n				$start = 1;\n				$end = $num_pages;\n			} else {\n				$start = $page - floor($num_links / 2);\n				$end = $page + floor($num_links / 2);\n\n				if ($start < 1) {\n					$end += abs($start) + 1;\n					$start = 1;\n				}\n\n				if ($end > $num_pages) {\n					$start -= ($end - $num_pages);\n					$end = $num_pages;\n				}\n			}\n\n			if ($start > 1) {\n				$output .= \'<li class=\"disabled\"><a href=\"#\">&middot;&middot;&middot;</a></li>\';\n			}\n\n			for ($i = $start; $i <= $end; $i++) {\n				if ($page == $i) {\n					$output .= \'<li class=\"active\"><span>\' . $i . \'</span></li>\';\n				} else {\n					if ($i === 1) {\n						$output .= \'<li><a href=\"\' . str_replace(array(\"&amp;{$this->page_var}={page}\", \"?{$this->page_var}={page}\", \"&{$this->page_var}={page}\"), \'\', $this->url) . \'\">\' . $i . \'</a></li>\';\n					} else {\n						$output .= \'<li><a href=\"\' . str_replace(\'{page}\', $i, $this->url) . \'\">\' . $i . \'</a></li>\';\n					}\n				}\n			}\n\n			if ($end < $num_pages) {\n				$output .= \'<li class=\"disabled\"><a href=\"#\">&middot;&middot;&middot;</a></li>\';\n			}\n		}\n\n		if ($page < $num_pages) {\n			$output .= \'<li><a href=\"\' . str_replace(\'{page}\', $page + 1, $this->url) . \'\">\' . $this->text_next . \'</a></li>\';\n			$output .= \'<li><a href=\"\' . str_replace(\'{page}\', $num_pages, $this->url) . \'\">\' . $this->text_last . \'</a></li>\';\n		}\n\n		$output .= \'</ul>\';\n\n		if ($num_pages > 1) {\n			return $output;\n		} else {\n			return \'\';\n		}\n	}\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"system/library/template/twig.php\">\n		<operation info=\"Add custom Twig filters OC &lt; 3.0.3.6\" error=\"skip\">\n			<search><![CDATA[\n			$template = $this->twig->loadTemplate($template\n			]]></search>\n			<add position=\"before\"><![CDATA[\n			if (strpos($template, \"extension/module/qa\") !== FALSE) {\n				$this->twig->addFilter(new \\Twig_SimpleFilter(\'addslashes\', \'addslashes\'));\n				$this->twig->addFilter(new \\Twig_SimpleFilter(\'html_entity_decode\', \'html_entity_decode\'));\n				$this->twig->addFilter(new \\Twig_SimpleFilter(\'map\', \'array_map\'));\n				$this->twig->addFilter(new \\Twig_SimpleFilter(\'replace_nl2br\', function($string) {\n					return str_replace(array(\"\\r\\n\", \"\\n\\r\", \"\\r\", \"\\n\"), \"<br>\", $string);\n				}));\n			}\n			]]></add>\n		</operation>\n		<operation info=\"Add custom Twig filters OC &gt;= 3.0.3.6\" error=\"skip\">\n			<search><![CDATA[\n			return $twig->render($filename\n			]]></search>\n			<add position=\"before\"><![CDATA[\n			if (strpos($filename, \"extension/module/qa\") !== FALSE) {\n				$twig->addFilter(new \\Twig\\TwigFilter(\'addslashes\', \'addslashes\'));\n				$twig->addFilter(new \\Twig\\TwigFilter(\'html_entity_decode\', \'html_entity_decode\'));\n				$twig->addFilter(new \\Twig\\TwigFilter(\'map\', \'array_map\'));\n				$twig->addFilter(new \\Twig\\TwigFilter(\'replace_nl2br\', function($string) {\n					return str_replace(array(\"\\r\\n\", \"\\n\\r\", \"\\r\", \"\\n\"), \"<br>\", $string);\n				}));\n			}\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"catalog/view/theme/journal3/template/product/product.twig\">\n		<operation>\n			<!--\n				This is needed for the Q&A tab to load the first page of questions if no content has been preloaded\n				(extension setting \'Preload questions\' = None) or all content has been preloaded (extension setting\n				\'Preload questions\' = All).\n\n				This code block must be included somewhere on the product page, but it does not matter where exactly.\n				The string \'{{ footer }}\' should exist on every possible custom theme product.tpl file, so\n				this block can most probably be left unchanged.\n			-->\n			<search><![CDATA[\n			{{ footer }}\n			]]></search>\n			<add position=\"before\"><![CDATA[\n{% if module_qa_status %}\n<script type=\"text/javascript\"><!--\n$(\"body\").on(\"click\",\"#qa-ask\",function(a){a.preventDefault(),$(\"a[href=\'#tab-qa\']\").trigger(\"click\"),$(\"html,body\").animate({scrollTop:$(\"#qa-title\").offset().top},1300)}).on(\"click\",\"#qa .pagination a\",function(){var a=this.href;return $(\"#qa\").slideUp(\"slow\",function(){$(\"#qa\").load(a,function(){$(\"#qa\").slideDown(\"slow\")})}),!1});{% if preload != 1 %}$(\'#qa\').load(\'index.php?route=extension/module/qa/question&product_id={{ product_id }}\');{% endif %}$(\"#button-qa\").on(\"click\",function(){$.ajax({type:\"POST\",url:\"index.php?route=extension/module/qa/ask&product_id={{ product_id }}\",dataType:\"json\",data:$(\"#q-form :input\").serialize(),beforeSend:function(){$(\"#button-qa\").button(\"loading\")},complete:function(){$(\"#button-qa\").button(\"reset\")},success:function(a){$(\".alert-success, .alert-danger\").remove(),a.error&&$(\"#qa-title\").before(\'<div class=\"alert alert-danger\"><i class=\"fa fa-exclamation-circle\"></i> \'+a.error+\"</div>\"),a.success&&($(\"#qa-title\").before(\'<div class=\"alert alert-success\"><i class=\"fa fa-check-circle\"></i> \'+a.success+\"</div>\"),$(\"textarea[name=\'q_question\']\").val(\"\"))},error:function(a){$(\"#qa-title\").before(\'<div class=\"alert alert-danger\"><i class=\"fa fa-exclamation-circle\"></i> \'+a.statusText+\"</div>\")}})});\n\n//--></script>\n{% endif %}\n			]]></add>\n		</operation>\n	</file>\n</modification>\n', 0, '2024-01-20 10:40:29'),
(9, 9, 'HTML in Attribute', 'html_in_attribute', 'DearSoft', '1.0', 'http://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n  <name>HTML in Attribute</name>\n  <code>html_in_attribute</code>\n  <version>1.0</version>\n  <author>DearSoft</author>\n  <link>http://dearsoft.bd</link>\n\n<file path=\"catalog/model/catalog/product.php\">\n	<operation>\n      <search regex=\"true\"><![CDATA[~(\\$product_attribute\\[\'text\'\\])~]]></search>\n      <add><![CDATA[html_entity_decode($1, ENT_QUOTES, \'UTF-8\')]]></add>\n    </operation>\n  </file>\n\n</modification>', 1, '2024-01-20 10:40:49'),
(10, 10, 'DearSoft Add Caption to Cateogory and Product', 'DearSoft_add_caption_category_product', 'DearSoft', '3.0', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<modification>\n        <name>DearSoft Add Caption to Cateogory and Product</name>\n		<code>DearSoft_add_caption_category_product</code>\n		<version>3.0</version>\n		<author>DearSoft</author>\n		<link>https://dearsoft.bd</link>\n		\n	<file path=\"admin/model/catalog/category.php\">\n		\n		<!-- <operation>\n			<search><![CDATA[name = \'\" . $this->db->escape($value[\'name\']) . \"\',]]></search>\n			<add position=\"replace\">\n			<![CDATA[\n			name = \'\" . $this->db->escape($value[\'name\']) . \"\', caption = \'\" . $this->db->escape($value[\'caption\']) . \"\',\n			]]>\n			</add>\n		</operation> -->\n\n		<operation>\n			<search><![CDATA[foreach ($data[\'category_description\'] as $language_id => $value) {]]></search>\n			<add position=\"after\" offset=\"1\">\n			<![CDATA[\n			if(isset($value[\'caption\'])){\n		        $this->db->query(\"UPDATE \" . DB_PREFIX . \"category_description SET caption = \'\" . $this->db->escape($value[\'caption\']) . \"\' WHERE category_id = \'\" . (int)$category_id . \"\'\");\n		    }\n			]]>\n			</add>\n		</operation>\n		\n		<operation>\n			<search><![CDATA[$category_description_data[$result[\'language_id\']] = array(]]></search>\n			<add position=\"after\">\n			<![CDATA[\n			\'caption\'          => $result[\'caption\'],\n			]]>\n			</add>\n		</operation>\n	</file>\n\n	<file path=\"admin/language/en-gb/catalog/category.php\">\n		<operation error=\"ignore\">\n			<search><![CDATA[// Error]]></search>\n			<add position=\"before\">\n			<![CDATA[\n	$_[\'entry_caption\']		= \'Caption\';\n			]]>\n			</add>\n		</operation>\n	</file> \n\n	<file path=\"admin/view/template/catalog/category_form.twig\">\n		<operation>\n			<search><![CDATA[<label class=\"col-sm-2 control-label\" for=\"input-description{{ language.language_id }}\">{{ entry_description }}</label>]]></search>\n			<add position=\"before\" offset=\"1\"><![CDATA[\n			  <div class=\"form-group\">\n	                    <label class=\"col-sm-2 control-label\" for=\"input-caption{{ language.language_id }}\">{{ entry_caption }}</label>\n	                    <div class=\"col-sm-10\">\n	                      <input type=\"text\" name=\"category_description[{{ language.language_id }}][caption]\" value=\"{{ category_description[language.language_id] ? category_description[language.language_id].caption }}\" placeholder=\"{{ entry_caption }}\" id=\"input-name{{ language.language_id }}\" class=\"form-control\" />\n	                      {% if error_name[language.language_id] %}\n	                      <div class=\"text-danger\">{{ error_name[language.language_id] }}</div>\n	                      {% endif %}\n	                    </div>\n	                  </div>\n			]]></add>\n		</operation>\n		</file>\n\n		<file path=\"admin/model/catalog/product.php\">\n			<!-- <operation>\n				<search><![CDATA[name = \'\" . $this->db->escape($value[\'name\']) . \"\',]]></search>\n				<add position=\"replace\">\n				<![CDATA[\n				name = \'\" . $this->db->escape($value[\'name\']) . \"\', caption = \'\" . $this->db->escape($value[\'caption\']) . \"\',\n				]]>\n				</add>\n			</operation> -->\n\n			<operation>\n			<search><![CDATA[foreach ($data[\'product_description\'] as $language_id => $value) {]]></search>\n			<add position=\"after\" offset=\"1\">\n			<![CDATA[\n			if(isset($value[\'caption\'])){\n		        $this->db->query(\"UPDATE \" . DB_PREFIX . \"product_description SET caption = \'\" . $this->db->escape($value[\'caption\']) . \"\' WHERE product_id = \'\" . (int)$product_id . \"\'\");\n		    }\n			]]>\n			</add>\n		</operation>\n			\n			<operation>\n				<search><![CDATA[$product_description_data[$result[\'language_id\']] = array(]]></search>\n				<add position=\"after\">\n				<![CDATA[\n				\'caption\'             => $result[\'caption\'],\n				]]>\n				</add>\n			</operation>\n		</file>\n\n	<file path=\"admin/language/en-gb/catalog/product.php\">\n		<operation error=\"ignore\">\n			<search><![CDATA[// Error]]></search>\n			<add position=\"before\">\n			<![CDATA[\n	$_[\'entry_caption\']		= \'Caption\';\n			]]>\n			</add>\n		</operation>\n	</file> \n\n	<file path=\"admin/view/template/catalog/product_form.twig\">\n		<operation>\n			<search><![CDATA[<label class=\"col-sm-2 control-label\" for=\"input-description{{ language.language_id }}\">{{ entry_description }}</label>]]></search>\n			<add position=\"before\" offset=\"1\"><![CDATA[\n			  <div class=\"form-group\">\n                      <label class=\"col-sm-2 control-label\" for=\"input-caption{{ language.language_id }}\">{{ entry_caption }}</label>\n                      <div class=\"col-sm-10\">\n                        <input type=\"text\" name=\"product_description[{{ language.language_id }}][caption]\" value=\"{{ product_description[language.language_id] ? product_description[language.language_id].caption }}\" placeholder=\"{{ entry_caption }}\" id=\"input-name{{ language.language_id }}\" class=\"form-control\"/>\n                      </div>\n                    </div>\n			]]></add>\n		</operation>\n		</file>\n\n		<file path=\"catalog/controller/product/category.php\">\n		<operation>\n			<search><![CDATA[$data[\'heading_title\'] = $category_info[\'name\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			  if(!empty($category_info[\'caption\'])){\n                $data[\'caption\'] = $category_info[\'caption\'];\n            }else{\n                $data[\'caption\'] = \'\';\n            }\n			]]></add>\n		</operation>\n		</file>\n\n		<file path=\"catalog/model/catalog/product.php\">\n		<operation>\n			<search><![CDATA[\'name\'             => $query->row[\'name\'],]]></search>\n			<add position=\"after\"><![CDATA[\n			  \'caption\'             => $query->row[\'caption\'],\n			]]></add>\n		</operation>\n		</file>\n\n		<file path=\"catalog/controller/product/product.php\">\n		<operation>\n			<search><![CDATA[$data[\'heading_title\'] = $product_info[\'name\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			  if(!empty($product_info[\'caption\'])){\n                $data[\'caption\'] = $product_info[\'caption\'];\n            }else{\n                $data[\'caption\'] = \'\';\n            }\n			]]></add>\n		</operation>\n		</file>\n\n</modification>', 1, '2024-09-14 12:40:28');
INSERT INTO `ac_modification` (`modification_id`, `extension_install_id`, `name`, `code`, `author`, `version`, `link`, `xml`, `status`, `date_added`) VALUES
(19, 19, 'DearSoft PC BUILDER', 'dearsoft-pc-builder', 'DearSoft', '1.0', 'https://www.dearsoft.bd/', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n  <name>DearSoft PC BUILDER</name>\n  <version>1.0</version>\n  <author>DearSoft</author>\n  <link>https://www.dearsoft.bd/</link>\n	<code>dearsoft-pc-builder</code>\n<!-- ADMIN - CONTROLLER [START] -->\n  <!-- common/column_left [START] -->\n  <file path=\"admin/controller/common/column_left.php\">\n    <operation>\n      <search><![CDATA[\n      // Catalog\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builder\n			$pc_builder = array();\n			\n			if ($this->user->hasPermission(\'access\', \'extension/pc_builder/pc_builder_category\')) {\n				$pc_builder[] = array(\n					\'name\'	   => $this->language->get(\'text_pc_builder_categories\'),\n					\'href\'     => $this->url->link(\'extension/pc_builder/pc_builder_category\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()		\n				);\n			}\n			\n			if ($this->user->hasPermission(\'access\', \'extension/pc_builder/pc_builder_component\')) {\n				$pc_builder[] = array(\n					\'name\'	   => $this->language->get(\'text_pc_builder_components\'),\n					\'href\'     => $this->url->link(\'extension/pc_builder/pc_builder_component\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()		\n				);\n\n				$pc_builder[] = array(\n					\'name\'	   => $this->language->get(\'text_pc_builder_settings\'),\n					\'href\'     => $this->url->link(\'extension/pc_builder/pc_builder_setting\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()		\n				);\n			}\n\n			if ($pc_builder) {\n				$data[\'menus\'][] = array(\n					\'id\'       => \'menu-pc-builder\',\n					\'icon\'	   => \'fa-puzzle-piece\', \n					\'name\'	   => $this->language->get(\'text_pc_builder\'),\n					\'href\'     => \'\',\n					\'children\' => $pc_builder\n				);		\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/column_left [END] -->\n  <!-- catalog/category [START] -->\n  <file path=\"admin/controller/catalog/category.php\">\n    <operation>\n      <search><![CDATA[\n      $this->load->model(\'catalog/filter\');\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			if (isset($this->request->post[\'incompatible_category\'])) {\n				$incompatible_categories = $this->request->post[\'incompatible_category\'];\n			} elseif (isset($this->request->get[\'category_id\'])) {\n				$incompatible_categories = $this->model_catalog_category->getCategoryIncompatibleCategory($this->request->get[\'category_id\']);\n			} else {\n				$incompatible_categories = array();\n			}\n\n			$data[\'incompatible_categories\'] = array();\n\n			if (!empty($incompatible_categories)) {\n				foreach ($incompatible_categories as $incompatible_category_id) {\n					$incompatible_category_info = $this->model_catalog_category->getCategory($incompatible_category_id);\n\n					if ($incompatible_category_info) {\n						$data[\'incompatible_categories\'][] = array(\n							\'category_id\' => $incompatible_category_info[\'category_id\'],\n							\'name\' => $incompatible_category_info[\'name\']\n						);\n					}\n				}\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- catalog/category [END] -->\n  <!-- sale/order [START] -->\n  <file path=\"admin/controller/sale/order.php\">\n    <operation>\n      <search><![CDATA[\n      $data[\'vouchers\'] = array();\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			$data[\'pc_builders\'] = array();\n\n			$pc_builders = $this->model_sale_order->getOrderPcBuilders($this->request->get[\'order_id\']);\n\n			foreach ($pc_builders as $pc_builder) {\n				$data[\'pc_builders\'][] = array(\n					\'build\'                 => json_decode($pc_builder[\'build\'], true),\n					\'pc_builder_categories\' => json_decode($pc_builder[\'pc_builder_categories\'], true),\n					\'amount\'                => $this->currency->format($pc_builder[\'amount\'], $order_info[\'currency_code\'], $order_info[\'currency_value\']),\n				);\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- sale/order [END] -->\n  <!-- startup/permission [START] -->\n  <file path=\"admin/controller/startup/permission.php\">\n    <operation>\n      <search><![CDATA[\n      \'extension/payment\',\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			\'extension/pc_builder\',\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- startup/permission [END] -->\n<!-- ADMIN - CONTROLLER [END] -->\n<!-- ADMIN - LANGUAGE [START] -->\n  <!-- en-gb/en-gb [START] -->\n  <file path=\"admin/language/en-gb/en-gb.php\">\n    <operation>\n      <search><![CDATA[\n      <?php\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			// Text\n			$_[\'text_pc_builder\'] = \'PC Builder\';\n			$_[\'text_pc_builder_components\'] = \'PC Builder Components\';\n			$_[\'text_pc_builder_categories\'] = \'PC Builder Categories\';\n			$_[\'text_pc_builder_settings\'] = \'PC Builder Settings\';\n\n      $_[\'entry_description\']      = \'Description\';\n      $_[\'entry_meta_title\']       = \'Meta Tag Title\';\n      $_[\'entry_meta_keyword\']     = \'Meta Tag Keywords\';\n      $_[\'entry_meta_description\'] = \'Meta Tag Description\';\n\n			// Entry\n			$_[\'entry_incompatible_category\'] = \'Incompatible Category\';\n\n			// Help\n			$_[\'help_incompatible_category\'] = \'(Autocomplete)\';\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- en-gb/en-gb [END] -->\n<!-- ADMIN - LANGUAGE [END] -->\n<!-- ADMIN - MODEL [START] -->\n  <!-- catalog/category [START] -->\n  <file path=\"admin/model/catalog/category.php\">\n    <operation>\n      <search index=\"0\"><![CDATA[\n      if (isset($data[\'category_filter\'])) {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			if (!empty($data[\'incompatible_category\'])) {\n				foreach ($data[\'incompatible_category\'] as $incompatible_id) {\n					$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE category_id = \'\" . (int)$category_id . \"\' AND incompatible_id = \'\" . (int)$incompatible_id . \"\'\");\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_incompatible_category SET category_id = \'\" . (int)$category_id . \"\', incompatible_id = \'\" . (int)$incompatible_id . \"\'\");\n					$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE category_id = \'\" . (int)$incompatible_id . \"\' AND incompatible_id = \'\" . (int)$category_id . \"\'\");\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_incompatible_category SET category_id = \'\" . (int)$incompatible_id . \"\', incompatible_id = \'\" . (int)$category_id . \"\'\");\n				}\n			}\n      ]]></add>\n    </operation>\n    <operation>\n      <search index=\"1\"><![CDATA[\n      if (isset($data[\'category_filter\'])) {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE category_id = \'\" . (int)$category_id . \"\'\");\n			$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE incompatible_id = \'\" . (int)$category_id . \"\'\");\n\n			if (!empty($data[\'incompatible_category\'])) {\n				foreach ($data[\'incompatible_category\'] as $incompatible_id) {\n					$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE category_id = \'\" . (int)$category_id . \"\' AND incompatible_id = \'\" . (int)$incompatible_id . \"\'\");\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_incompatible_category SET category_id = \'\" . (int)$category_id . \"\', incompatible_id = \'\" . (int)$incompatible_id . \"\'\");\n					$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE category_id = \'\" . (int)$incompatible_id . \"\' AND incompatible_id = \'\" . (int)$category_id . \"\'\");\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_incompatible_category SET category_id = \'\" . (int)$incompatible_id . \"\', incompatible_id = \'\" . (int)$category_id . \"\'\");\n				}\n			}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      public function getCategoryFilters($category_id) {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			public function getCategoryIncompatibleCategory($category_id) {\n				$incompatible_category_data = array();\n\n				$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"pc_builder_incompatible_category WHERE category_id = \'\" . (int)$category_id . \"\'\");\n\n				foreach ($query->rows as $result) {\n					$incompatible_category_data[] = $result[\'incompatible_id\'];\n				}\n\n				return $incompatible_category_data;\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- catalog/category [END] -->\n  <!-- sale/order [START] -->\n  <file path=\"admin/model/sale/order.php\">\n    <operation>\n      <search><![CDATA[\n      public function getOrderVouchers($order_id) {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			public function getOrderPcBuilders($order_id) {\n				$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"pc_builder_order WHERE order_id = \'\" . (int)$order_id . \"\'\");\n\n				return $query->rows;\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- sale/order [END] -->\n<!-- ADMIN - MODEL [END] -->\n<!-- ADMIN - THEME [START] -->\n  <!-- catalog/category_form [START] -->\n  <file path=\"admin/view/template/catalog/category_form.twig\">\n    <operation>\n      <search><![CDATA[\n      <label class=\"col-sm-2 control-label\" for=\"input-filter\"><span data-toggle=\"tooltip\" title=\"{{ help_filter }}\">{{ entry_filter }}</span></label>\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n        <label class=\"col-sm-2 control-label\" for=\"input-incompatible-category\"><span data-toggle=\"tooltip\" title=\"{{ help_incompatible_category }}\">{{ entry_incompatible_category }}</span></label>\n        <div class=\"col-sm-10\">\n          <input type=\"text\" name=\"incompatible_category\" value=\"\" placeholder=\"{{ entry_incompatible_category }}\" id=\"input-incompatible-category\" class=\"form-control\"/>\n          <div id=\"incompatible-category\" class=\"well well-sm\" style=\"height: 150px; overflow: auto;\"> {% for incompatible_category in incompatible_categories %}\n              <div id=\"incompatible-category{{ incompatible_category.category_id }}\"><i class=\"fa fa-minus-circle\"></i> {{ incompatible_category.name }}\n                <input type=\"hidden\" name=\"incompatible_category[]\" value=\"{{ incompatible_category.category_id }}\"/>\n              </div>\n            {% endfor %}</div>\n        </div>\n      </div>\n      <div class=\"form-group\">\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n			<script type=\"text/javascript\" src=\"view/javascript/summernote/opencart.js\"></script>\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n		  <script type=\"text/javascript\"><!--\n		  // Incompatible Category\n		  $(\'input[name=\\\'incompatible_category\\\']\').autocomplete({\n			  \'source\': function(request, response) {\n				  $.ajax({\n					  url: \'index.php?route=catalog/category/autocomplete&user_token={{ user_token }}&filter_name=\' + encodeURIComponent(request),\n					  dataType: \'json\',\n					  success: function(json) {\n						  response($.map(json, function(item) {\n							  return {\n								  label: item[\'name\'],\n								  value: item[\'category_id\']\n							  }\n						  }));\n					  }\n				  });\n			  },\n			  \'select\': function(item) {\n				  $(\'input[name=\\\'incompatible_category\\\']\').val(\'\');\n\n				  $(\'#incompatible-category\' + item[\'value\']).remove();\n\n				  $(\'#incompatible-category\').append(\'<div id=\"incompatible-category\' + item[\'value\'] + \'\"><i class=\"fa fa-minus-circle\"></i> \' + item[\'label\'] + \'<input type=\"hidden\" name=\"incompatible_category[]\" value=\"\' + item[\'value\'] + \'\" /></div>\');\n			  }\n		  });\n\n		  $(\'#incompatible-category\').delegate(\'.fa-minus-circle\', \'click\', function() {\n			  $(this).parent().remove();\n		  });\n		  //--></script>\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- catalog/category_form [END] -->\n  <!-- sale/order_info [START] -->\n  <file path=\"admin/view/template/sale/order_info.twig\">\n    <operation>\n      <search><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n        <tr>\n          <td class=\"text-left\">\n	        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n	        	<div>\n	        		{% for build in pc_builder.pc_builder_categories %}\n	        			<div style=\"margin-bottom: 15px;\">\n			        		<h4>{{ build.name }}</h4>\n			        		{% for pc_builder_component in build.pc_builder_components %}\n				        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n				        		<div class=\"col-sm-4\">{{ pc_builder_component.name }}</div>\n				        		<div class=\"col-sm-8\">\n				        			{% if pc_builder_component.product %}\n					        			<div>{{ pc_builder_component.product.name }}</div>\n					        			{% if pc_builder_component.product.option %}\n					        				{% for product_option in pc_builder_component.product.option %}\n					        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n					        				{% endfor %}\n					        			{% endif %}\n				        			{% endif %}\n				        		</div>\n				        		</div>\n			        		{% endfor %}\n		        		</div>\n	        		{% endfor %}\n	        	</div>\n          </td>\n          <td class=\"text-left\">{{ text_pc_builder }}</td>\n          <td class=\"text-right\">1</td>\n          <td class=\"text-right\">{{ pc_builder.amount }}</td>\n          <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- sale/order_info [END] -->\n<!-- ADMIN - THEME [END] -->\n<!-- CATALOG - CONTROLLER [START] -->\n  <!-- account/order [START] -->\n  <file path=\"catalog/controller/account/order.php\">\n    <operation>\n      <search><![CDATA[\n      $voucher_total = $this->model_account_order->getTotalOrderVouchersByOrderId($result[\'order_id\']);\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n      $pc_builder_total = $this->model_account_order->getTotalOrderPcBuildersByOrderId($result[\'order_id\']);\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      \'products\'   => ($product_total + $voucher_total),\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n      \'products\'   => ($product_total + $voucher_total + $pc_builder_total),\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      // Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builders\n			$data[\'pc_builders\'] = array();\n\n			$pc_builders = $this->model_account_order->getOrderPcBuilders($this->request->get[\'order_id\']);\n\n			foreach ($pc_builders as $pc_builder) {\n				$data[\'pc_builders\'][] = array(\n					\'build\'                 => json_decode($pc_builder[\'build\'], true),\n					\'pc_builder_categories\' => json_decode($pc_builder[\'pc_builder_categories\'], true),\n					\'amount\'                => $this->currency->format($pc_builder[\'amount\'], $order_info[\'currency_code\'], $order_info[\'currency_value\']),\n				);\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- account/order [END] -->\n  <!-- common/header [START] -->\n  <file path=\"catalog/controller/common/header.php\">\n    <operation>\n      <search><![CDATA[\n      $data[\'contact\'] = $this->url->link(\'information/contact\');\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			$data[\'pc_builder\'] = $this->url->link(\'extension/pc_builder/pc_builder\');\n			$data[\'pc_builder_build\'] = $this->url->link(\'extension/pc_builder/pc_builder_build\');\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/header [END] -->\n  <!-- common/cart [START] -->\n  <file path=\"catalog/controller/common/cart.php\">\n    <operation>\n      <search><![CDATA[\n      $this->load->language(\'common/cart\');\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			// PC Builder\n			$pc_builder_amount = 0;\n			$pc_builder_weight = 0;\n\n			$data[\'pc_builders\'] = array();\n\n			if (!empty($this->session->data[\'pc_builders\'])) {\n				$this->load->model(\'extension/pc_builder/pc_builder_category\');\n				$this->load->model(\'extension/pc_builder/pc_builder_component\');\n				$this->load->model(\'extension/pc_builder/pc_builder_product\');\n				$this->load->model(\'extension/pc_builder/pc_builder_build\');\n\n				$this->load->model(\'tool/image\');\n				$this->load->model(\'tool/upload\');\n\n				$url = \'\';\n\n				foreach ($this->session->data[\'pc_builders\'] as $key => $pc_builder) {\n					$pc_builder_categories_data = array();\n\n					$pc_builder_categories = $this->model_extension_pc_builder_pc_builder_category->getPcBuilderCategories();\n\n					foreach ($pc_builder_categories as $pc_builder_category) {\n						// Get PC Builder Components\n						$pc_builder_components_data = array();\n\n						$filter_data = array(\n							\'filter_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n						);\n\n						$pc_builder_components = $this->model_extension_pc_builder_pc_builder_component->getPcBuilderComponents($filter_data);\n\n						foreach ($pc_builder_components as $pc_builder_component) {\n							if ($pc_builder_component[\'image\']) {\n								$thumb = $this->model_tool_image->resize($pc_builder_component[\'image\'], 32, 32);\n							} else {\n								$thumb = $this->model_tool_image->resize(\'placeholder.png\', 32, 32);\n							}\n\n							$pc_builder_selected_products = $pc_builder[\'build\'];\n\n							if (isset($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\'])) {\n								(float)$option_price = 0;\n								$option_points = 0;\n								$option_weight = 0;\n\n								$product_info = $this->model_extension_pc_builder_pc_builder_product->getProduct($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\']);\n\n								if ($product_info) {\n									if ($product_info[\'image\']) {\n										$image = $this->model_tool_image->resize($product_info[\'image\'], 32, 32);\n									} else {\n										$image = \'\';\n									}\n\n									$option_data = array();\n\n									foreach ($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'option\'] as $product_option_id => $value) {\n\n										// Get Selected Product Option Data\n										$option = $this->model_extension_pc_builder_pc_builder_product->getSelectedProductOptionData($product_option_id, $value, $product_info[\'product_id\'], 1);\n\n										if ($option) {\n											if ($option[\'type\'] != \'file\') {\n												$value = $option[\'value\'];\n											} else {\n												$upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\n\n												if ($upload_info) {\n													$value = $upload_info[\'name\'];\n												} else {\n													$value = \'\';\n												}\n											}\n\n											$option_data[] = array(\n												\'name\'          => $option[\'name\'],\n												\'value\'         => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value),\n												\'type\'          => $option[\'type\'],\n												\'quantity\'      => $option[\'quantity\'],\n												\'subtract\'      => $option[\'subtract\'],\n												\'price\'         => $option[\'price\'],\n												\'price_prefix\'  => $option[\'price_prefix\'],\n												\'points\'        => $option[\'points\'],\n												\'points_prefix\' => $option[\'points_prefix\'],\n												\'weight\'        => $option[\'weight\'],\n												\'weight_prefix\' => $option[\'weight_prefix\'],\n											);\n\n											if ($option[\'price_prefix\'] == \'+\') {\n												$option_price += $option[\'price\'];\n											} elseif ($option[\'price_prefix\'] == \'-\') {\n												$option_price -= $option[\'price\'];\n											}\n\n											if ($option[\'points_prefix\'] == \'+\') {\n												$option_points += $option[\'points\'];\n											} elseif ($option[\'points_prefix\'] == \'-\') {\n												$option_points -= $option[\'points\'];\n											}\n\n											if ($option[\'weight_prefix\'] == \'+\') {\n												$option_weight += $option[\'weight\'];\n											} elseif ($option[\'weight_prefix\'] == \'-\') {\n												$option_weight -= $option[\'weight\'];\n											}\n										}\n									}\n\n									// Display prices\n									if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\n										if (!is_null($product_info[\'special\']) && (float)$product_info[\'special\'] >= 0) {\n											$special = (float)$product_info[\'special\'];\n										} else {\n											$special = false;\n										}\n\n										if ($special) {\n											$unit_price = $this->tax->calculate(((float)$special + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										} else {\n											$unit_price = $this->tax->calculate(((float)$product_info[\'price\'] + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										}\n\n										$price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\n										$total = $this->currency->format($unit_price * 1, $this->session->data[\'currency\']);\n									} else {\n										$price = false;\n										$total = false;\n									}\n\n									$product_data = array(\n										\'product_id\' => $product_info[\'product_id\'],\n										\'name\' => $product_info[\'name\'],\n										\'image\' => $image,\n										\'option\' => $option_data,\n										\'price\' => $price,\n									);\n								} else {\n									$product_data = array();\n								}\n							} else {\n								$product_data = array();\n							}\n\n							$pc_builder_components_data[] = array(\n								\'pc_builder_component_id\' => $pc_builder_component[\'pc_builder_component_id\'],\n								\'name\' => $pc_builder_component[\'name\'],\n								\'thumb\' => $thumb,\n								\'product\' => $product_data,\n								\'required\' => $pc_builder_component[\'required\'],\n								\'href\' => $this->url->link(\'extension/pc_builder/pc_builder_search\', \'pc_builder_component_id=\' . $pc_builder_component[\'pc_builder_component_id\'] . $url)\n							);\n						}\n\n						$pc_builder_categories_data[] = array(\n							\'pc_builder_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n							\'name\' => $pc_builder_category[\'name\'],\n							\'pc_builder_components\' => $pc_builder_components_data,\n						);\n					}\n					$data[\'pc_builders\'][] = array(\n						\'key\'         => $key,\n						\'build\'       => $pc_builder_categories_data,\n						\'amount\'      => $this->currency->format($pc_builder[\'amount\'], $this->session->data[\'currency\']),\n						\'weight\'      => $pc_builder[\'weight\'],\n					);\n\n					$pc_builder_amount += $pc_builder[\'amount\'];\n					$pc_builder_weight = $pc_builder[\'weight\'];\n				}\n			}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      $data[\'text_items\'] = sprintf($this->language->get(\'text_items\'), $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0), $this->currency->format($total, $this->session->data[\'currency\']));\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			$data[\'text_items\'] = sprintf($this->language->get(\'text_items\'), $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0) + (isset($this->session->data[\'pc_builders\']) ? count($this->session->data[\'pc_builders\']) : 0), $this->currency->format($total, $this->session->data[\'currency\']));\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/cart [END] -->\n  <!-- checkout/cart [START] -->\n  <file path=\"catalog/controller/checkout/cart.php\">\n    <operation>\n      <search><![CDATA[\n      if ($this->cart->hasProducts() || !empty($this->session->data[\'vouchers\'])) {\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			if ($this->cart->hasProducts() || !empty($this->session->data[\'vouchers\']) || !empty($this->session->data[\'pc_builders\'])) {\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builder\n			$data[\'pc_builders\'] = array();\n\n			if (!empty($this->session->data[\'pc_builders\'])) {\n				$this->load->model(\'extension/pc_builder/pc_builder_category\');\n				$this->load->model(\'extension/pc_builder/pc_builder_component\');\n				$this->load->model(\'extension/pc_builder/pc_builder_product\');\n				$this->load->model(\'extension/pc_builder/pc_builder_build\');\n\n				$this->load->model(\'tool/image\');\n				$this->load->model(\'tool/upload\');\n\n				$url = \'\';\n\n				foreach ($this->session->data[\'pc_builders\'] as $key => $pc_builder) {\n					$pc_builder_categories_data = array();\n\n					$pc_builder_categories = $this->model_extension_pc_builder_pc_builder_category->getPcBuilderCategories();\n\n					foreach ($pc_builder_categories as $pc_builder_category) {\n						// Get PC Builder Components\n						$pc_builder_components_data = array();\n\n						$filter_data = array(\n							\'filter_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n						);\n\n						$pc_builder_components = $this->model_extension_pc_builder_pc_builder_component->getPcBuilderComponents($filter_data);\n\n						foreach ($pc_builder_components as $pc_builder_component) {\n							if ($pc_builder_component[\'image\']) {\n								$thumb = $this->model_tool_image->resize($pc_builder_component[\'image\'], 32, 32);\n							} else {\n								$thumb = $this->model_tool_image->resize(\'placeholder.png\', 32, 32);\n							}\n\n							$pc_builder_selected_products = $pc_builder[\'build\'];\n\n							if (isset($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\'])) {\n								(float)$option_price = 0;\n								$option_points = 0;\n								$option_weight = 0;\n\n								$product_info = $this->model_extension_pc_builder_pc_builder_product->getProduct($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\']);\n\n								if ($product_info) {\n									if ($product_info[\'image\']) {\n										$image = $this->model_tool_image->resize($product_info[\'image\'], 32, 32);\n									} else {\n										$image = \'\';\n									}\n\n									$option_data = array();\n\n									foreach ($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'option\'] as $product_option_id => $value) {\n\n										// Get Selected Product Option Data\n										$option = $this->model_extension_pc_builder_pc_builder_product->getSelectedProductOptionData($product_option_id, $value, $product_info[\'product_id\'], 1);\n\n										if ($option) {\n											if ($option[\'type\'] != \'file\') {\n												$value = $option[\'value\'];\n											} else {\n												$upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\n\n												if ($upload_info) {\n													$value = $upload_info[\'name\'];\n												} else {\n													$value = \'\';\n												}\n											}\n\n											$option_data[] = array(\n												\'name\'          => $option[\'name\'],\n												\'value\'         => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value),\n												\'type\'          => $option[\'type\'],\n												\'quantity\'      => $option[\'quantity\'],\n												\'subtract\'      => $option[\'subtract\'],\n												\'price\'         => $option[\'price\'],\n												\'price_prefix\'  => $option[\'price_prefix\'],\n												\'points\'        => $option[\'points\'],\n												\'points_prefix\' => $option[\'points_prefix\'],\n												\'weight\'        => $option[\'weight\'],\n												\'weight_prefix\' => $option[\'weight_prefix\'],\n											);\n\n											if ($option[\'price_prefix\'] == \'+\') {\n												$option_price += $option[\'price\'];\n											} elseif ($option[\'price_prefix\'] == \'-\') {\n												$option_price -= $option[\'price\'];\n											}\n\n											if ($option[\'points_prefix\'] == \'+\') {\n												$option_points += $option[\'points\'];\n											} elseif ($option[\'points_prefix\'] == \'-\') {\n												$option_points -= $option[\'points\'];\n											}\n\n											if ($option[\'weight_prefix\'] == \'+\') {\n												$option_weight += $option[\'weight\'];\n											} elseif ($option[\'weight_prefix\'] == \'-\') {\n												$option_weight -= $option[\'weight\'];\n											}\n										}\n									}\n\n									// Display prices\n									if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\n										if (!is_null($product_info[\'special\']) && (float)$product_info[\'special\'] >= 0) {\n											$special = (float)$product_info[\'special\'];\n										} else {\n											$special = false;\n										}\n\n										if ($special) {\n											$unit_price = $this->tax->calculate(((float)$special + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										} else {\n											$unit_price = $this->tax->calculate(((float)$product_info[\'price\'] + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										}\n\n										$price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\n										$total = $this->currency->format($unit_price * 1, $this->session->data[\'currency\']);\n									} else {\n										$price = false;\n										$total = false;\n									}\n\n									$product_data = array(\n										\'product_id\' => $product_info[\'product_id\'],\n										\'name\' => $product_info[\'name\'],\n										\'image\' => $image,\n										\'option\' => $option_data,\n										\'price\' => $price,\n									);\n								} else {\n									$product_data = array();\n								}\n							} else {\n								$product_data = array();\n							}\n\n							$pc_builder_components_data[] = array(\n								\'pc_builder_component_id\' => $pc_builder_component[\'pc_builder_component_id\'],\n								\'name\' => $pc_builder_component[\'name\'],\n								\'thumb\' => $thumb,\n								\'product\' => $product_data,\n								\'required\' => $pc_builder_component[\'required\'],\n								\'href\' => $this->url->link(\'extension/pc_builder/pc_builder_search\', \'pc_builder_component_id=\' . $pc_builder_component[\'pc_builder_component_id\'] . $url)\n							);\n						}\n\n						$pc_builder_categories_data[] = array(\n							\'pc_builder_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n							\'name\' => $pc_builder_category[\'name\'],\n							\'pc_builder_components\' => $pc_builder_components_data,\n						);\n					}\n					$data[\'pc_builders\'][] = array(\n						\'key\'         => $key,\n						\'build\'       => $pc_builder_categories_data,\n						\'amount\'      => $this->currency->format($pc_builder[\'amount\'], $this->session->data[\'currency\']),\n						\'weight\'      => $pc_builder[\'weight\'],\n					);\n				}\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/cart [END] -->\n  <!-- checkout/checkout [START] -->\n  <file path=\"catalog/controller/checkout/checkout.php\">\n    <operation>\n      <search><![CDATA[\n      if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\']) && empty($this->session->data[\'pc_builders\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/checkout [END] -->\n  <!-- checkout/confirm [START] -->\n  <file path=\"catalog/controller/checkout/confirm.php\">\n    <operation>\n      <search><![CDATA[\n      if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\']) && empty($this->session->data[\'pc_builders\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      $order_data[\'total\'] = $total_data[\'total\'];\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n    	if (!empty($this->session->data[\'pc_builders\'])) {\n    		(float)$pc_builder_total = 0;\n\n    		foreach ($this->session->data[\'pc_builders\'] as $pc_builder) {\n    			$pc_builder_total += (float)$pc_builder[\'amount\'];\n    		}\n\n				$order_data[\'total\'] = ((float)$total_data[\'total\'] + (float)$pc_builder_total);\n    	} else {\n				$order_data[\'total\'] = $total_data[\'total\'];\n    	}\n      ]]></add>\n    </operation>\n    <operation>\n      <search index=\"0\"><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builder\n			$order_data[\'pc_builders\'] = array();\n\n			if (!empty($this->session->data[\'pc_builders\'])) {\n				$this->load->model(\'extension/pc_builder/pc_builder_category\');\n				$this->load->model(\'extension/pc_builder/pc_builder_component\');\n				$this->load->model(\'extension/pc_builder/pc_builder_product\');\n				$this->load->model(\'extension/pc_builder/pc_builder_build\');\n\n				$this->load->model(\'tool/image\');\n				$this->load->model(\'tool/upload\');\n\n				$url = \'\';\n\n				foreach ($this->session->data[\'pc_builders\'] as $pc_builder) {\n					$pc_builder_categories_data = array();\n\n					$pc_builder_categories = $this->model_extension_pc_builder_pc_builder_category->getPcBuilderCategories();\n\n					foreach ($pc_builder_categories as $pc_builder_category) {\n						// Get PC Builder Components\n						$pc_builder_components_data = array();\n\n						$filter_data = array(\n							\'filter_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n						);\n\n						$pc_builder_components = $this->model_extension_pc_builder_pc_builder_component->getPcBuilderComponents($filter_data);\n\n						foreach ($pc_builder_components as $pc_builder_component) {\n							if ($pc_builder_component[\'image\']) {\n								$thumb = $this->model_tool_image->resize($pc_builder_component[\'image\'], 32, 32);\n							} else {\n								$thumb = $this->model_tool_image->resize(\'placeholder.png\', 32, 32);\n							}\n\n							$pc_builder_selected_products = $pc_builder[\'build\'];\n\n							if (isset($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\'])) {\n								(float)$option_price = 0;\n								$option_points = 0;\n								$option_weight = 0;\n\n								$product_info = $this->model_extension_pc_builder_pc_builder_product->getProduct($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\']);\n\n								if ($product_info) {\n									if ($product_info[\'image\']) {\n										$image = $this->model_tool_image->resize($product_info[\'image\'], 32, 32);\n									} else {\n										$image = \'\';\n									}\n\n									$option_data = array();\n\n									foreach ($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'option\'] as $product_option_id => $value) {\n\n										// Get Selected Product Option Data\n										$option = $this->model_extension_pc_builder_pc_builder_product->getSelectedProductOptionData($product_option_id, $value, $product_info[\'product_id\'], 1);\n\n										if ($option) {\n											if ($option[\'type\'] != \'file\') {\n												$value = $option[\'value\'];\n											} else {\n												$upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\n\n												if ($upload_info) {\n													$value = $upload_info[\'name\'];\n												} else {\n													$value = \'\';\n												}\n											}\n\n											$option_data[] = array(\n												\'name\'          => $option[\'name\'],\n												\'value\'         => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value),\n												\'type\'          => $option[\'type\'],\n												\'quantity\'      => $option[\'quantity\'],\n												\'subtract\'      => $option[\'subtract\'],\n												\'price\'         => $option[\'price\'],\n												\'price_prefix\'  => $option[\'price_prefix\'],\n												\'points\'        => $option[\'points\'],\n												\'points_prefix\' => $option[\'points_prefix\'],\n												\'weight\'        => $option[\'weight\'],\n												\'weight_prefix\' => $option[\'weight_prefix\'],\n											);\n\n											if ($option[\'price_prefix\'] == \'+\') {\n												$option_price += $option[\'price\'];\n											} elseif ($option[\'price_prefix\'] == \'-\') {\n												$option_price -= $option[\'price\'];\n											}\n\n											if ($option[\'points_prefix\'] == \'+\') {\n												$option_points += $option[\'points\'];\n											} elseif ($option[\'points_prefix\'] == \'-\') {\n												$option_points -= $option[\'points\'];\n											}\n\n											if ($option[\'weight_prefix\'] == \'+\') {\n												$option_weight += $option[\'weight\'];\n											} elseif ($option[\'weight_prefix\'] == \'-\') {\n												$option_weight -= $option[\'weight\'];\n											}\n										}\n									}\n\n									// Display prices\n									if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\n										if (!is_null($product_info[\'special\']) && (float)$product_info[\'special\'] >= 0) {\n											$special = (float)$product_info[\'special\'];\n										} else {\n											$special = false;\n										}\n\n										if ($special) {\n											$unit_price = $this->tax->calculate(((float)$special + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										} else {\n											$unit_price = $this->tax->calculate(((float)$product_info[\'price\'] + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										}\n\n										$price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\n										$total = $this->currency->format($unit_price * 1, $this->session->data[\'currency\']);\n									} else {\n										$price = false;\n										$total = false;\n									}\n\n									$product_data = array(\n										\'product_id\' => $product_info[\'product_id\'],\n										\'name\' => $product_info[\'name\'],\n										\'image\' => $image,\n										\'option\' => $option_data,\n										\'price\' => $price,\n									);\n								} else {\n									$product_data = array();\n								}\n							} else {\n								$product_data = array();\n							}\n\n							$pc_builder_components_data[] = array(\n								\'pc_builder_component_id\' => $pc_builder_component[\'pc_builder_component_id\'],\n								\'name\' => $pc_builder_component[\'name\'],\n								\'thumb\' => $thumb,\n								\'product\' => $product_data,\n								\'required\' => $pc_builder_component[\'required\'],\n								\'href\' => $this->url->link(\'extension/pc_builder/pc_builder_search\', \'pc_builder_component_id=\' . $pc_builder_component[\'pc_builder_component_id\'] . $url)\n							);\n						}\n\n						$pc_builder_categories_data[] = array(\n							\'pc_builder_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n							\'name\' => $pc_builder_category[\'name\'],\n							\'pc_builder_components\' => $pc_builder_components_data,\n						);\n					}\n\n					$order_data[\'pc_builders\'][] = array(\n						\'build\'                      => $pc_builder[\'build\'],\n						\'pc_builder_categories\'      => $pc_builder_categories_data,\n						\'amount\'                     => $pc_builder[\'amount\'],\n						\'weight\'                     => $pc_builder[\'weight\'],\n					);\n				}\n			}\n      ]]></add>\n    </operation>\n    <operation>\n      <search index=\"1\"><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builder\n			$data[\'pc_builders\'] = array();\n\n			if (!empty($this->session->data[\'pc_builders\'])) {\n				$this->load->model(\'extension/pc_builder/pc_builder_category\');\n				$this->load->model(\'extension/pc_builder/pc_builder_component\');\n				$this->load->model(\'extension/pc_builder/pc_builder_product\');\n				$this->load->model(\'extension/pc_builder/pc_builder_build\');\n\n				$this->load->model(\'tool/image\');\n				$this->load->model(\'tool/upload\');\n\n				$url = \'\';\n\n				foreach ($this->session->data[\'pc_builders\'] as $pc_builder) {\n					$pc_builder_categories_data = array();\n\n					$pc_builder_categories = $this->model_extension_pc_builder_pc_builder_category->getPcBuilderCategories();\n\n					foreach ($pc_builder_categories as $pc_builder_category) {\n						// Get PC Builder Components\n						$pc_builder_components_data = array();\n\n						$filter_data = array(\n							\'filter_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n						);\n\n						$pc_builder_components = $this->model_extension_pc_builder_pc_builder_component->getPcBuilderComponents($filter_data);\n\n						foreach ($pc_builder_components as $pc_builder_component) {\n							if ($pc_builder_component[\'image\']) {\n								$thumb = $this->model_tool_image->resize($pc_builder_component[\'image\'], 32, 32);\n							} else {\n								$thumb = $this->model_tool_image->resize(\'placeholder.png\', 32, 32);\n							}\n\n							$pc_builder_selected_products = $pc_builder[\'build\'];\n\n							if (isset($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\'])) {\n								(float)$option_price = 0;\n								$option_points = 0;\n								$option_weight = 0;\n\n								$product_info = $this->model_extension_pc_builder_pc_builder_product->getProduct($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\']);\n\n								if ($product_info) {\n									if ($product_info[\'image\']) {\n										$image = $this->model_tool_image->resize($product_info[\'image\'], 32, 32);\n									} else {\n										$image = \'\';\n									}\n\n									$option_data = array();\n\n									foreach ($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'option\'] as $product_option_id => $value) {\n\n										// Get Selected Product Option Data\n										$option = $this->model_extension_pc_builder_pc_builder_product->getSelectedProductOptionData($product_option_id, $value, $product_info[\'product_id\'], 1);\n\n										if ($option) {\n											if ($option[\'type\'] != \'file\') {\n												$value = $option[\'value\'];\n											} else {\n												$upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\n\n												if ($upload_info) {\n													$value = $upload_info[\'name\'];\n												} else {\n													$value = \'\';\n												}\n											}\n\n											$option_data[] = array(\n												\'name\'          => $option[\'name\'],\n												\'value\'         => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value),\n												\'type\'          => $option[\'type\'],\n												\'quantity\'      => $option[\'quantity\'],\n												\'subtract\'      => $option[\'subtract\'],\n												\'price\'         => $option[\'price\'],\n												\'price_prefix\'  => $option[\'price_prefix\'],\n												\'points\'        => $option[\'points\'],\n												\'points_prefix\' => $option[\'points_prefix\'],\n												\'weight\'        => $option[\'weight\'],\n												\'weight_prefix\' => $option[\'weight_prefix\'],\n											);\n\n											if ($option[\'price_prefix\'] == \'+\') {\n												$option_price += $option[\'price\'];\n											} elseif ($option[\'price_prefix\'] == \'-\') {\n												$option_price -= $option[\'price\'];\n											}\n\n											if ($option[\'points_prefix\'] == \'+\') {\n												$option_points += $option[\'points\'];\n											} elseif ($option[\'points_prefix\'] == \'-\') {\n												$option_points -= $option[\'points\'];\n											}\n\n											if ($option[\'weight_prefix\'] == \'+\') {\n												$option_weight += $option[\'weight\'];\n											} elseif ($option[\'weight_prefix\'] == \'-\') {\n												$option_weight -= $option[\'weight\'];\n											}\n										}\n									}\n\n									// Display prices\n									if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\n										if (!is_null($product_info[\'special\']) && (float)$product_info[\'special\'] >= 0) {\n											$special = (float)$product_info[\'special\'];\n										} else {\n											$special = false;\n										}\n\n										if ($special) {\n											$unit_price = $this->tax->calculate(((float)$special + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										} else {\n											$unit_price = $this->tax->calculate(((float)$product_info[\'price\'] + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n										}\n\n										$price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\n										$total = $this->currency->format($unit_price * 1, $this->session->data[\'currency\']);\n									} else {\n										$price = false;\n										$total = false;\n									}\n\n									$product_data = array(\n										\'product_id\' => $product_info[\'product_id\'],\n										\'name\' => $product_info[\'name\'],\n										\'image\' => $image,\n										\'option\' => $option_data,\n										\'price\' => $price,\n									);\n								} else {\n									$product_data = array();\n								}\n							} else {\n								$product_data = array();\n							}\n\n							$pc_builder_components_data[] = array(\n								\'pc_builder_component_id\' => $pc_builder_component[\'pc_builder_component_id\'],\n								\'name\' => $pc_builder_component[\'name\'],\n								\'thumb\' => $thumb,\n								\'product\' => $product_data,\n								\'required\' => $pc_builder_component[\'required\'],\n								\'href\' => $this->url->link(\'extension/pc_builder/pc_builder_search\', \'pc_builder_component_id=\' . $pc_builder_component[\'pc_builder_component_id\'] . $url)\n							);\n						}\n\n						$pc_builder_categories_data[] = array(\n							\'pc_builder_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n							\'name\' => $pc_builder_category[\'name\'],\n							\'pc_builder_components\' => $pc_builder_components_data,\n						);\n					}\n\n					$data[\'pc_builders\'][] = array(\n						\'build\'  => $pc_builder_categories_data,\n						\'amount\' => $this->currency->format($pc_builder[\'amount\'], $this->session->data[\'currency\']),\n						\'weight\' => $this->weight->format($pc_builder[\'weight\'], $this->config->get(\'config_weight_class_id\'), $this->language->get(\'decimal_point\'), $this->language->get(\'thousand_point\')),\n					);\n				}\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/confirm [END] -->\n  <!-- checkout/{guest,guest_shipping,login,payment_address,payment_method,register,shipping_address,shipping_method} [START] -->\n  <file path=\"catalog/controller/checkout/{guest,guest_shipping,login,payment_address,payment_method,register,shipping_address,shipping_method}.php\">\n    <operation>\n      <search><![CDATA[\n      if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\']) && empty($this->session->data[\'pc_builders\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/{guest,guest_shipping,login,payment_address,payment_method,register,shipping_address,shipping_method} [END] -->\n  <!-- checkout/success [START] -->\n  <file path=\"catalog/controller/checkout/success.php\">\n    <operation>\n      <search><![CDATA[\n      unset($this->session->data[\'vouchers\']);\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n      unset($this->session->data[\'pc_builders\']);\n      ]]></add>\n    </operation>\n  </file>\n  <!-- checkout/success [END] -->\n  <!-- mail/order [START] -->\n  <file path=\"catalog/controller/mail/order.php\">\n    <operation>\n      <search><![CDATA[\n      // Vouchers\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n		// PC builders\n		$data[\'pc_builders\'] = array();\n\n		$order_pc_builders = $this->model_checkout_order->getOrderPcBuilders($order_info[\'order_id\']);\n\n		foreach ($order_pc_builders as $order_pc_builder) {\n			$data[\'pc_builders\'][] = array(\n				\'build\'                 => json_decode($order_pc_builder[\'build\'], true),\n				\'pc_builder_categories\' => json_decode($order_pc_builder[\'pc_builder_categories\'], true),\n				\'amount\'                => $this->currency->format($order_pc_builder[\'amount\'], $order_info[\'currency_code\'], $order_info[\'currency_value\']),\n			);\n		}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      $data[\'vouchers\'] = array();\n      ]]></search>\n      <add index=\"1\" position=\"before\"><![CDATA[\n		// PC builders\n		$data[\'pc_builders\'] = array();\n\n		$order_pc_builders = $this->model_checkout_order->getOrderPcBuilders($order_info[\'order_id\']);\n\n		foreach ($order_pc_builders as $order_pc_builder) {\n			$data[\'pc_builders\'][] = array(\n				\'build\'                 => json_decode($order_pc_builder[\'build\'], true),\n				\'pc_builder_categories\' => json_decode($order_pc_builder[\'pc_builder_categories\'], true),\n				\'amount\'                => $this->currency->format($order_pc_builder[\'amount\'], $order_info[\'currency_code\'], $order_info[\'currency_value\']),\n			);\n		}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- mail/order [END] -->\n<!-- CATALOG - CONTROLLER [END] -->\n<!-- CATALOG - LANGUAGE [START] -->\n  <!-- en-gb/en-gb [START] -->\n  <file path=\"catalog/language/en-gb/en-gb.php\">\n    <operation>\n      <search><![CDATA[\n      <?php\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			// Text\n			$_[\'text_pc_builder\'] = \'PC Builder\';\n			$_[\'text_saved_build\'] = \'My Saved PC Build\';\n			// Button\n			$_[\'button_change\'] = \'Change\';\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- en-gb/en-gb [END] -->\n<!-- CATALOG - LANGUAGE [END] -->\n<!-- CATALOG - MODEL [START] -->\n  <!-- account/order [START] -->\n  <file path=\"catalog/model/account/order.php\">\n    <operation>\n      <search><![CDATA[\n      public function getOrderVouchers($order_id) {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			public function getOrderPcBuilders($order_id) {\n				$query = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"pc_builder_order` WHERE order_id = \'\" . (int)$order_id . \"\'\");\n\n				return $query->rows;\n			}\n\n			public function getTotalOrderPcBuildersByOrderId($order_id) {\n				$query = $this->db->query(\"SELECT COUNT(*) AS total FROM `\" . DB_PREFIX . \"pc_builder_order` WHERE order_id = \'\" . (int)$order_id . \"\'\");\n\n				return $query->row[\'total\'];\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/order [END] -->\n  <!-- checkout/order [START] -->\n  <file path=\"catalog/model/checkout/order.php\">\n    <operation>\n      <search index=\"0\"><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builders\n			if (isset($data[\'pc_builders\'])) {\n				foreach ($data[\'pc_builders\'] as $pc_builder) {\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_order SET order_id = \'\" . (int)$order_id . \"\', build = \'\" . $this->db->escape(json_encode($pc_builder[\'build\'])) . \"\', pc_builder_categories = \'\" . $this->db->escape(json_encode($pc_builder[\'pc_builder_categories\'])) . \"\', amount = \'\" . (float)$pc_builder[\'amount\'] . \"\', weight = \'\" . (float)$pc_builder[\'weight\'] . \"\'\");\n\n					$pc_builder_order_id = $this->db->getLastId();\n				}\n			}\n      ]]></add>\n    </operation>\n    <operation>\n      <search index=\"1\"><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			// PC Builders\n			$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_order WHERE order_id = \'\" . (int)$order_id . \"\'\");\n\n			if (isset($data[\'pc_builders\'])) {\n				foreach ($data[\'pc_builders\'] as $pc_builder) {\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_order SET order_id = \'\" . (int)$order_id . \"\', build = \'\" . $this->db->escape($pc_builder[\'build\']) . \"\', pc_builder_categories = \'\" . $this->db->escape($pc_builder[\'pc_builder_categories\']) . \"\', amount = \'\" . (float)$pc_builder[\'amount\'] . \"\', weight = \'\" . (float)$pc_builder[\'weight\'] . \"\'\");\n\n					$pc_builder_order_id = $this->db->getLastId();\n				}\n			}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      public function getOrderVouchers($order_id) {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n			public function getOrderPcBuilders($order_id) {\n				$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"pc_builder_order WHERE order_id = \'\" . (int)$order_id . \"\'\");\n			\n				return $query->rows;\n			}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/order [END] -->\n<!-- CATALOG - MODEL [END] -->\n<!-- CATALOG - THEME [START] -->\n  <!-- account/order_info [START] -->\n  <file path=\"catalog/view/theme/default/template/account/order_info.twig\">\n    <operation>\n      <search><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n      <tr>\n        <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.pc_builder_categories %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">{{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n        </td>\n        <td class=\"text-left\"></td>\n        <td class=\"text-right\">1</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        {% if products %}\n        <td></td>\n        {% endif %}\n      </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- account/order_info [END] -->\n  <!-- common/header [START] -->\n  <file path=\"catalog/view/theme/default/template/common/header.twig\">\n    <operation>\n      <search><![CDATA[\n      </head>\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n		<script src=\"catalog/view/javascript/pc_builder.js?v=1.0.1\" type=\"text/javascript\"></script>\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      <li><a href=\"{{ account }}\">{{ text_account }}</a></li>\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			<li><a href=\"{{ pc_builder_build }}\">{{ text_saved_build }}</a></li>\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      <li><a href=\"{{ checkout }}\" title=\"{{ text_checkout }}\"><i class=\"fa fa-share\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ text_checkout }}</span></a></li>\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			<li><a href=\"{{ pc_builder }}\" title=\"{{ text_pc_builder }}\"><i class=\"fa fa-puzzle-piece\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ text_pc_builder }}</span></a></li>\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/header [END] -->\n  <!-- common/cart [START] -->\n  <file path=\"catalog/view/theme/default/template/common/cart.twig\">\n    <operation>\n      <search><![CDATA[\n      {% if products or vouchers %}\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			{% if products or vouchers or pc_builders %}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n      <tr>\n        <td class=\"text-center\"></td>\n        <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.build %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">{{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n        </td>\n        <td class=\"text-right\">x&nbsp;1</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        <td class=\"text-center text-danger\"><button type=\"button\" onclick=\"pc_builder.remove(\'{{ pc_builder.key }}\');\" title=\"{{ button_remove }}\" class=\"btn btn-danger btn-xs\"><i class=\"fa fa-times\"></i></button></td>\n      </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/cart [END] -->\n  <!-- checkout/cart [START] -->\n  <file path=\"catalog/view/theme/default/template/checkout/cart.twig\">\n    <operation>\n      <search><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n      <tr>\n        <td></td>\n        <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.build %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">&middot; {{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n      	</td>\n        <td class=\"text-left\">{{ text_pc_builder }}</td>\n        <td class=\"text-left\"><div class=\"input-group btn-block\" style=\"max-width: 200px;\">\n            <input type=\"text\" name=\"\" value=\"1\" size=\"1\" disabled=\"disabled\" class=\"form-control\" />\n            <span class=\"input-group-btn\">\n            <button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_remove }}\" class=\"btn btn-danger\" onclick=\"pc_builder.remove(\'{{ pc_builder.key }}\');\"><i class=\"fa fa-times-circle\"></i></button>\n            </span></div></td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n      </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>\n  <!-- checkout/cart [END] -->\n  <!-- checkout/confirm [START] -->\n  <file path=\"catalog/view/theme/default/template/checkout/confirm.twig\">\n    <operation>\n      <search><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n	    {% for pc_builder in pc_builders %}\n	    <tr>\n	      <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.build %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">&middot; {{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n	      </td>\n	      <td class=\"text-left\">{{ text_pc_builder }}</td>\n	      <td class=\"text-right\">1</td>\n	      <td class=\"text-right\">{{ pc_builder.amount }}</td>\n	      <td class=\"text-right\">{{ pc_builder.amount }}</td>\n	    </tr>\n	    {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/confirm [END] -->\n  <!-- mail/order_add [START] -->\n  <file path=\"catalog/view/theme/default/template/mail/order_add.twig\">\n    <operation>\n      <search><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n		{% for pc_builder in pc_builders %}\n		<tr>\n			<td style=\"font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;\">\n				<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n				<div>\n					{% for build in pc_builder.pc_builder_categories %}\n						<div style=\"margin-bottom: 15px;\">\n							<h4>{{ build.name }}</h4>\n							{% for pc_builder_component in build.pc_builder_components %}\n								<div class=\"row\" style=\"margin-bottom: 5px;\">\n								<div class=\"col-sm-4\">{{ pc_builder_component.name }}</div>\n								<div class=\"col-sm-8\">\n									{% if pc_builder_component.product %}\n										<div>{{ pc_builder_component.product.name }}</div>\n										{% if pc_builder_component.product.option %}\n											{% for product_option in pc_builder_component.product.option %}\n											<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n											{% endfor %}\n										{% endif %}\n									{% endif %}\n								</div>\n								</div>\n							{% endfor %}\n						</div>\n					{% endfor %}\n				</div>\n			</td>\n			<td style=\"font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;\"></td>\n			<td style=\"font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: right; padding: 7px;\">1</td>\n			<td style=\"font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: right; padding: 7px;\">{{ pc_builder.amount }}</td>\n			<td style=\"font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: right; padding: 7px;\">{{ pc_builder.amount }}</td>\n		</tr>\n		{% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- mail/order_add [END] -->\n  <!-- mail/order_alert [START] -->\n  <file path=\"catalog/view/theme/default/template/mail/order_alert.twig\">\n    <operation>\n      <search><![CDATA[\n      {% if vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n		{% if pc_builders %}\n		{% for pc_builder in pc_builders %}\n		1x {{ text_pc_builder }} {{ pc_builder.amount }}\n		{% for build in pc_builder.pc_builder_categories %}\n		{{ build.name }}\n		{% for pc_builder_component in build.pc_builder_components %}\n		{{ pc_builder_component.name }}\n		{% if pc_builder_component.product %}\n		{{ pc_builder_component.product.name }}\n		{% if pc_builder_component.product.option %}\n		{% for product_option in pc_builder_component.product.option %}\n		- {{ product_option.name }}: {{ product_option.value }}\n		{% endfor %}\n		{% endif %}\n		{% endif %}\n		{% endfor %}\n		{% endfor %}\n		{% endfor %}\n		{% endif %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- mail/order_alert [END] -->\n<!-- CATALOG - THEME [END] -->\n<!-- SYSTEM - LIBRARY [START] -->\n  <!-- cart/cart [START] -->\n  <file path=\"system/library/cart/cart.php\">\n    <operation>\n      <search><![CDATA[\n      return $total;\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n    	if (isset($this->session->data[\'pc_builders\'])) {\n				foreach ($this->session->data[\'pc_builders\'] as $pc_builder) {\n					$total += $pc_builder[\'amount\'];\n				}\n    	}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      return $weight;\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n    	if (isset($this->session->data[\'pc_builders\'])) {\n				foreach ($this->session->data[\'pc_builders\'] as $pc_builder) {\n					$weight += $pc_builder[\'weight\'];\n				}\n    	}\n      ]]></add>\n    </operation>\n    <operation>\n      <search><![CDATA[\n      return false;\n      ]]></search>\n      <add index=\"1\" position=\"before\"><![CDATA[\n    	if (isset($this->session->data[\'pc_builders\'])) {\n			return true;\n    	}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- cart/cart [END] -->\n\n\n <!-- for journal theme start-->\n\n <!-- account/account [START] -->\n  <file path=\"catalog/controller/account/account.php\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      $data[\'recurring\'] = $this->url->link(\'account/recurring\', \'\', true);\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n      $data[\'saved_pc_build\'] = $this->url->link(\'extension/pc_builder/pc_builder_build\', \'\', true);\n      ]]></add>\n    </operation>\n  </file>\n  <!-- account/account [END] -->\n  <!-- journal3/checkout [START] -->\n  <file path=\"catalog/controller/journal3/checkout.php\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n      if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\']) && empty($this->session->data[\'pc_builders\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\n      ]]></add>\n    </operation>\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      \'vouchers\'                   => $this->vouchers(),\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n      \'pc_builders\'                => $this->pc_builders(),\n      ]]></add>\n    </operation>\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      $total_items = $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0);\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n      $total_items = $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0) + (isset($this->session->data[\'pc_builders\']) ? count($this->session->data[\'pc_builders\']) : 0);\n      ]]></add>\n    </operation>\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      private function vouchers() {\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      private function pc_builders() {\n        $result = array();\n\n        if (!empty($this->session->data[\'pc_builders\'])) {\n          $this->load->model(\'extension/pc_builder/pc_builder_category\');\n          $this->load->model(\'extension/pc_builder/pc_builder_component\');\n          $this->load->model(\'extension/pc_builder/pc_builder_product\');\n          $this->load->model(\'extension/pc_builder/pc_builder_build\');\n\n          $this->load->model(\'tool/image\');\n          $this->load->model(\'tool/upload\');\n\n          $url = \'\';\n\n          foreach ($this->session->data[\'pc_builders\'] as $key => $pc_builder) {\n            $pc_builder_categories_data = array();\n\n            $pc_builder_categories = $this->model_extension_pc_builder_pc_builder_category->getPcBuilderCategories();\n\n            foreach ($pc_builder_categories as $pc_builder_category) {\n              // Get PC Builder Components\n              $pc_builder_components_data = array();\n\n              $filter_data = array(\n                \'filter_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n              );\n\n              $pc_builder_components = $this->model_extension_pc_builder_pc_builder_component->getPcBuilderComponents($filter_data);\n\n              foreach ($pc_builder_components as $pc_builder_component) {\n                if ($pc_builder_component[\'image\']) {\n                  $thumb = $this->model_tool_image->resize($pc_builder_component[\'image\'], 32, 32);\n                } else {\n                  $thumb = $this->model_tool_image->resize(\'placeholder.png\', 32, 32);\n                }\n\n                $pc_builder_selected_products = $pc_builder[\'build\'];\n\n                if (isset($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\'])) {\n                  (float)$option_price = 0;\n                  $option_points = 0;\n                  $option_weight = 0;\n\n                  $product_info = $this->model_extension_pc_builder_pc_builder_product->getProduct($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\']);\n\n                  if ($product_info) {\n                    if ($product_info[\'image\']) {\n                      $image = $this->model_tool_image->resize($product_info[\'image\'], 32, 32);\n                    } else {\n                      $image = \'\';\n                    }\n\n                    $option_data = array();\n\n                    foreach ($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'option\'] as $product_option_id => $value) {\n\n                      // Get Selected Product Option Data\n                      $option = $this->model_extension_pc_builder_pc_builder_product->getSelectedProductOptionData($product_option_id, $value, $product_info[\'product_id\'], 1);\n\n                      if ($option) {\n                        if ($option[\'type\'] != \'file\') {\n                          $value = $option[\'value\'];\n                        } else {\n                          $upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\n\n                          if ($upload_info) {\n                            $value = $upload_info[\'name\'];\n                          } else {\n                            $value = \'\';\n                          }\n                        }\n\n                        $option_data[] = array(\n                          \'name\'          => $option[\'name\'],\n                          \'value\'         => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value),\n                          \'type\'          => $option[\'type\'],\n                          \'quantity\'      => $option[\'quantity\'],\n                          \'subtract\'      => $option[\'subtract\'],\n                          \'price\'         => $option[\'price\'],\n                          \'price_prefix\'  => $option[\'price_prefix\'],\n                          \'points\'        => $option[\'points\'],\n                          \'points_prefix\' => $option[\'points_prefix\'],\n                          \'weight\'        => $option[\'weight\'],\n                          \'weight_prefix\' => $option[\'weight_prefix\'],\n                        );\n\n                        if ($option[\'price_prefix\'] == \'+\') {\n                          $option_price += $option[\'price\'];\n                        } elseif ($option[\'price_prefix\'] == \'-\') {\n                          $option_price -= $option[\'price\'];\n                        }\n\n                        if ($option[\'points_prefix\'] == \'+\') {\n                          $option_points += $option[\'points\'];\n                        } elseif ($option[\'points_prefix\'] == \'-\') {\n                          $option_points -= $option[\'points\'];\n                        }\n\n                        if ($option[\'weight_prefix\'] == \'+\') {\n                          $option_weight += $option[\'weight\'];\n                        } elseif ($option[\'weight_prefix\'] == \'-\') {\n                          $option_weight -= $option[\'weight\'];\n                        }\n                      }\n                    }\n\n                    // Display prices\n                    if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\n                      if (!is_null($product_info[\'special\']) && (float)$product_info[\'special\'] >= 0) {\n                        $special = (float)$product_info[\'special\'];\n                      } else {\n                        $special = false;\n                      }\n\n                      if ($special) {\n                        $unit_price = $this->tax->calculate(((float)$special + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n                      } else {\n                        $unit_price = $this->tax->calculate(((float)$product_info[\'price\'] + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n                      }\n\n                      $price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\n                      $total = $this->currency->format($unit_price * 1, $this->session->data[\'currency\']);\n                    } else {\n                      $price = false;\n                      $total = false;\n                    }\n\n                    $product_data = array(\n                      \'product_id\' => $product_info[\'product_id\'],\n                      \'name\' => $product_info[\'name\'],\n                      \'image\' => $image,\n                      \'option\' => $option_data,\n                      \'price\' => $price,\n                    );\n                  } else {\n                    $product_data = array();\n                  }\n                } else {\n                  $product_data = array();\n                }\n\n                $pc_builder_components_data[] = array(\n                  \'pc_builder_component_id\' => $pc_builder_component[\'pc_builder_component_id\'],\n                  \'name\' => $pc_builder_component[\'name\'],\n                  \'thumb\' => $thumb,\n                  \'product\' => $product_data,\n                  \'required\' => $pc_builder_component[\'required\'],\n                  \'href\' => $this->url->link(\'extension/pc_builder/pc_builder_search\', \'pc_builder_component_id=\' . $pc_builder_component[\'pc_builder_component_id\'] . $url)\n                );\n              }\n\n              $pc_builder_categories_data[] = array(\n                \'pc_builder_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n                \'name\' => $pc_builder_category[\'name\'],\n                \'pc_builder_components\' => $pc_builder_components_data,\n              );\n            }\n            $result[] = array(\n              \'key\'         => $key,\n              \'build\'       => $pc_builder_categories_data,\n              \'amount\'      => $this->currency->format($pc_builder[\'amount\'], $this->session->data[\'currency\']),\n              \'weight\'      => $pc_builder[\'weight\'],\n            );\n          }\n        }\n\n        return $result;\n      }\n      ]]></add>\n    </operation>\n  </file>\n  <!-- journal3/checkout [END] -->\n<!-- CATALOG - CONTROLLER [END] -->\n<!-- CATALOG - MODEL [START] -->\n  <!-- journal3/checkout [START] -->\n  <file path=\"catalog/model/journal3/checkout.php\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      // vouchers\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      // PC Builder\n      $data[\'pc_builders\'] = array();\n\n      if (!empty($this->session->data[\'pc_builders\'])) {\n        $this->load->model(\'extension/pc_builder/pc_builder_category\');\n        $this->load->model(\'extension/pc_builder/pc_builder_component\');\n        $this->load->model(\'extension/pc_builder/pc_builder_product\');\n        $this->load->model(\'extension/pc_builder/pc_builder_build\');\n\n        $this->load->model(\'tool/image\');\n        $this->load->model(\'tool/upload\');\n\n        $url = \'\';\n\n        foreach ($this->session->data[\'pc_builders\'] as $pc_builder) {\n          $pc_builder_categories_data = array();\n\n          $pc_builder_categories = $this->model_extension_pc_builder_pc_builder_category->getPcBuilderCategories();\n\n          foreach ($pc_builder_categories as $pc_builder_category) {\n            // Get PC Builder Components\n            $pc_builder_components_data = array();\n\n            $filter_data = array(\n              \'filter_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n            );\n\n            $pc_builder_components = $this->model_extension_pc_builder_pc_builder_component->getPcBuilderComponents($filter_data);\n\n            foreach ($pc_builder_components as $pc_builder_component) {\n              if ($pc_builder_component[\'image\']) {\n                $thumb = $this->model_tool_image->resize($pc_builder_component[\'image\'], 32, 32);\n              } else {\n                $thumb = $this->model_tool_image->resize(\'placeholder.png\', 32, 32);\n              }\n\n              $pc_builder_selected_products = $pc_builder[\'build\'];\n\n              if (isset($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\'])) {\n                (float)$option_price = 0;\n                $option_points = 0;\n                $option_weight = 0;\n\n                $product_info = $this->model_extension_pc_builder_pc_builder_product->getProduct($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'product_id\']);\n\n                if ($product_info) {\n                  if ($product_info[\'image\']) {\n                    $image = $this->model_tool_image->resize($product_info[\'image\'], 32, 32);\n                  } else {\n                    $image = \'\';\n                  }\n\n                  $option_data = array();\n\n                  foreach ($pc_builder_selected_products[$pc_builder_component[\'pc_builder_component_id\']][\'option\'] as $product_option_id => $value) {\n\n                    // Get Selected Product Option Data\n                    $option = $this->model_extension_pc_builder_pc_builder_product->getSelectedProductOptionData($product_option_id, $value, $product_info[\'product_id\'], 1);\n\n                    if ($option) {\n                      if ($option[\'type\'] != \'file\') {\n                        $value = $option[\'value\'];\n                      } else {\n                        $upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\n\n                        if ($upload_info) {\n                          $value = $upload_info[\'name\'];\n                        } else {\n                          $value = \'\';\n                        }\n                      }\n\n                      $option_data[] = array(\n                        \'name\'          => $option[\'name\'],\n                        \'value\'         => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value),\n                        \'type\'          => $option[\'type\'],\n                        \'quantity\'      => $option[\'quantity\'],\n                        \'subtract\'      => $option[\'subtract\'],\n                        \'price\'         => $option[\'price\'],\n                        \'price_prefix\'  => $option[\'price_prefix\'],\n                        \'points\'        => $option[\'points\'],\n                        \'points_prefix\' => $option[\'points_prefix\'],\n                        \'weight\'        => $option[\'weight\'],\n                        \'weight_prefix\' => $option[\'weight_prefix\'],\n                      );\n\n                      if ($option[\'price_prefix\'] == \'+\') {\n                        $option_price += $option[\'price\'];\n                      } elseif ($option[\'price_prefix\'] == \'-\') {\n                        $option_price -= $option[\'price\'];\n                      }\n\n                      if ($option[\'points_prefix\'] == \'+\') {\n                        $option_points += $option[\'points\'];\n                      } elseif ($option[\'points_prefix\'] == \'-\') {\n                        $option_points -= $option[\'points\'];\n                      }\n\n                      if ($option[\'weight_prefix\'] == \'+\') {\n                        $option_weight += $option[\'weight\'];\n                      } elseif ($option[\'weight_prefix\'] == \'-\') {\n                        $option_weight -= $option[\'weight\'];\n                      }\n                    }\n                  }\n\n                  // Display prices\n                  if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\n                    if (!is_null($product_info[\'special\']) && (float)$product_info[\'special\'] >= 0) {\n                      $special = (float)$product_info[\'special\'];\n                    } else {\n                      $special = false;\n                    }\n\n                    if ($special) {\n                      $unit_price = $this->tax->calculate(((float)$special + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n                    } else {\n                      $unit_price = $this->tax->calculate(((float)$product_info[\'price\'] + (float)$option_price), $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\n                    }\n\n                    $price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\n                    $total = $this->currency->format($unit_price * 1, $this->session->data[\'currency\']);\n                  } else {\n                    $price = false;\n                    $total = false;\n                  }\n\n                  $product_data = array(\n                    \'product_id\' => $product_info[\'product_id\'],\n                    \'name\' => $product_info[\'name\'],\n                    \'image\' => $image,\n                    \'option\' => $option_data,\n                    \'price\' => $price,\n                  );\n                } else {\n                  $product_data = array();\n                }\n              } else {\n                $product_data = array();\n              }\n\n              $pc_builder_components_data[] = array(\n                \'pc_builder_component_id\' => $pc_builder_component[\'pc_builder_component_id\'],\n                \'name\' => $pc_builder_component[\'name\'],\n                \'thumb\' => $thumb,\n                \'product\' => $product_data,\n                \'required\' => $pc_builder_component[\'required\'],\n                \'href\' => $this->url->link(\'extension/pc_builder/pc_builder_search\', \'pc_builder_component_id=\' . $pc_builder_component[\'pc_builder_component_id\'] . $url)\n              );\n            }\n\n            $pc_builder_categories_data[] = array(\n              \'pc_builder_category_id\' => $pc_builder_category[\'pc_builder_category_id\'],\n              \'name\' => $pc_builder_category[\'name\'],\n              \'pc_builder_components\' => $pc_builder_components_data,\n            );\n          }\n\n          $data[\'pc_builders\'][] = array(\n            \'build\'                      => $pc_builder[\'build\'],\n            \'pc_builder_categories\'      => $pc_builder_categories_data,\n            \'amount\'                     => $pc_builder[\'amount\'],\n            \'weight\'                     => $pc_builder[\'weight\'],\n          );\n        }\n      }\n      ]]></add>\n    </operation>\n  </file>\n  <!-- journal3/checkout [END] -->\n  <!-- journal3/order [START] -->\n  <file path=\"catalog/model/journal3/order.php\">\n    <operation>\n      <search index=\"0\" error=\"skip\"><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      // PC Builders\n      if (isset($data[\'pc_builders\'])) {\n        foreach ($data[\'pc_builders\'] as $pc_builder) {\n          $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_order SET order_id = \'\" . (int)$order_id . \"\', build = \'\" . $this->db->escape(json_encode($pc_builder[\'build\'])) . \"\', pc_builder_categories = \'\" . $this->db->escape(json_encode($pc_builder[\'pc_builder_categories\'])) . \"\', amount = \'\" . (float)$pc_builder[\'amount\'] . \"\', weight = \'\" . (float)$pc_builder[\'weight\'] . \"\'\");\n\n          $pc_builder_order_id = $this->db->getLastId();\n        }\n      }\n      ]]></add>\n    </operation>\n    <operation>\n      <search index=\"1\" error=\"skip\"><![CDATA[\n      // Gift Voucher\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      // PC Builders\n      $this->db->query(\"DELETE FROM \" . DB_PREFIX . \"pc_builder_order WHERE order_id = \'\" . (int)$order_id . \"\'\");\n\n      if (isset($data[\'pc_builders\'])) {\n        foreach ($data[\'pc_builders\'] as $pc_builder) {\n          $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"pc_builder_order SET order_id = \'\" . (int)$order_id . \"\', build = \'\" . $this->db->escape(json_encode($pc_builder[\'build\'])) . \"\', pc_builder_categories = \'\" . $this->db->escape(json_encode($pc_builder[\'pc_builder_categories\'])) . \"\', amount = \'\" . (float)$pc_builder[\'amount\'] . \"\', weight = \'\" . (float)$pc_builder[\'weight\'] . \"\'\");\n\n          $pc_builder_order_id = $this->db->getLastId();\n        }\n      }\n      ]]></add>\n    </operation>\n  </file>\n  <!-- journal3/order [END] -->\n<!-- CATALOG - MODEL [END] -->\n<!-- CATALOG - THEME [START] -->\n  <!-- account/account [START] -->\n  <file path=\"catalog/view/theme/journal3/template/account/account.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      <div class=\"my-affiliates\">\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      <div class=\"my-saved-pc-builds\">\n        <h2 class=\"title\">{{ text_pc_builder }}</h2>\n        <ul class=\"list-unstyled account-list\">\n          <li class=\"saved-pc-build-list\"><a href=\"{{ saved_pc_build }}\">{{ text_saved_build }}</a></li>\n        </ul>\n      </div>\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- account/account [END] -->\n  <!-- account/order_info [START] -->\n  <file path=\"catalog/view/theme/journal3/template/account/order_info.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n      <tr>\n        <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.pc_builder_categories %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">{{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n        </td>\n        <td class=\"text-left\"></td>\n        <td class=\"text-right\">1</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        {% if products %}\n        <td></td>\n        {% endif %}\n      </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- account/order_info [END] -->\n  <!-- common/header [START] -->\n  <file path=\"catalog/view/theme/journal3/template/common/header.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      <li><a href=\"{{ account }}\">{{ text_account }}</a></li>\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			<li><a href=\"{{ pc_builder_build }}\">{{ text_saved_build }}</a></li>\n      ]]></add>\n    </operation>\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      <li><a href=\"{{ checkout }}\" title=\"{{ text_checkout }}\"><i class=\"fa fa-share\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ text_checkout }}</span></a></li>\n      ]]></search>\n      <add position=\"after\"><![CDATA[\n			<li><a href=\"{{ pc_builder }}\" title=\"{{ text_pc_builder }}\"><i class=\"fa fa-puzzle-piece\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ text_pc_builder }}</span></a></li>\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/header [END] -->\n  <!-- common/cart [START] -->\n  <file path=\"catalog/view/theme/journal3/template/common/cart.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      {% if products or vouchers %}\n      ]]></search>\n      <add position=\"replace\"><![CDATA[\n			{% if products or vouchers or pc_builders %}\n      ]]></add>\n    </operation>\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n      <tr>\n        <td class=\"text-center\"></td>\n        <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.build %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">{{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n        </td>\n        <td class=\"text-right\">x&nbsp;1</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        <td class=\"text-center text-danger\"><button type=\"button\" onclick=\"pc_builder.remove(\'{{ pc_builder.key }}\');\" title=\"{{ button_remove }}\" class=\"btn btn-danger btn-xs\"><i class=\"fa fa-times\"></i></button></td>\n      </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- common/cart [END] -->\n  <!-- checkout/cart [START] -->\n  <file path=\"catalog/view/theme/journal3/template/checkout/cart.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n      {% for pc_builder in pc_builders %}\n      <tr>\n        <td></td>\n        <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.build %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">&middot; {{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n      	</td>\n        <td class=\"text-left\">{{ text_pc_builder }}</td>\n        <td class=\"text-left\"><div class=\"input-group btn-block\" style=\"max-width: 200px;\">\n            <input type=\"text\" name=\"\" value=\"1\" size=\"1\" disabled=\"disabled\" class=\"form-control\" />\n            <span class=\"input-group-btn\">\n            <button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_remove }}\" class=\"btn btn-danger\" onclick=\"pc_builder.remove(\'{{ pc_builder.key }}\');\"><i class=\"fa fa-times-circle\"></i></button>\n            </span></div></td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n        <td class=\"text-right\">{{ pc_builder.amount }}</td>\n      </tr>\n      {% endfor %}\n      ]]></add>\n    </operation>\n  </file>\n  <!-- checkout/cart [END] -->\n  <!-- checkout/confirm [START] -->\n  <file path=\"catalog/view/theme/journal3/template/checkout/confirm.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      {% for voucher in vouchers %}\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n	    {% for pc_builder in pc_builders %}\n	    <tr>\n	      <td class=\"text-left\">\n        	<h3 style=\"margin-top: 0px;\">{{ text_pc_builder }}</h3>\n        	<div>\n        		{% for build in pc_builder.build %}\n        			<div style=\"margin-bottom: 15px;\">\n		        		<h4>{{ build.name }}</h4>\n		        		{% for pc_builder_component in build.pc_builder_components %}\n			        		<div class=\"row\" style=\"margin-bottom: 5px;\">\n			        		<div class=\"col-sm-4\">&middot; {{ pc_builder_component.name }}</div>\n			        		<div class=\"col-sm-8\">\n			        			{% if pc_builder_component.product %}\n				        			<div>{{ pc_builder_component.product.name }}</div>\n				        			{% if pc_builder_component.product.option %}\n				        				{% for product_option in pc_builder_component.product.option %}\n				        				<div class=\"small\">- {{ product_option.name }}: {{ product_option.value }}</div>\n				        				{% endfor %}\n				        			{% endif %}\n			        			{% endif %}\n			        		</div>\n			        		</div>\n		        		{% endfor %}\n	        		</div>\n        		{% endfor %}\n        	</div>\n	      </td>\n	      <td class=\"text-left\">{{ text_pc_builder }}</td>\n	      <td class=\"text-right\">1</td>\n	      <td class=\"text-right\">{{ pc_builder.amount }}</td>\n	      <td class=\"text-right\">{{ pc_builder.amount }}</td>\n	    </tr>\n	    {% endfor %}\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- checkout/confirm [END] -->\n  <!-- journal3/checkout/cart [START] -->\n  <file path=\"catalog/view/theme/journal3/template/journal3/checkout/cart.twig\">\n    <operation>\n      <search error=\"skip\"><![CDATA[\n      <tr v-for=\"(voucher, index) in vouchers\">\n      ]]></search>\n      <add position=\"before\"><![CDATA[\n        <tr v-for=\"(pc_builder, index) in pc_builders\">\n          <td></td>\n          <td class=\"text-left\">\n            <h4 style=\"margin-top: 0px;\">PC Builder</h4>\n            <div>\n              <template v-for=\"build in pc_builder.build\">\n                <br/>\n                <div v-html=\"build.name\"></div>\n                <small v-for=\"pc_builder_component in build.pc_builder_components\">\n                  <div class=\"row\" style=\"margin-bottom: 5px;\">\n                    <div class=\"col-sm-4\" v-html=\"pc_builder_component.name + \': \'\"></div>\n                    <div class=\"col-sm-8\">\n                      <div v-if=\"pc_builder_component.product\">\n                        <div v-html=\"pc_builder_component.product.name\"></div>\n                        <div v-if=\"pc_builder_component.product.option\">\n                          <div v-for=\"product_option in pc_builder_component.product.option\">\n                            <small v-html=\"\'- \' + product_option.name + \': \' + product_option.value\"></small>\n                          </div>\n                        </div>\n                      </div>\n                    </div>\n                  </div>\n                </small>\n              </template>\n            </div>\n          </td>\n          <td class=\"text-left\">PC Builder</td>\n          <td class=\"text-left\">1</td>\n          <td class=\"text-right\" v-html=\"pc_builder.amount\"></td>\n          <td class=\"text-right\" v-html=\"pc_builder.amount\"></td>\n        </tr>\n      ]]></add>\n    </operation>\n  </file>  \n  <!-- journal3/checkout/cart [END] -->\n\n  <!-- for journal theme end -->\n\n<!-- SYSTEM - LIBRARY [END] -->\n</modification>', 1, '2025-11-08 16:46:38');
INSERT INTO `ac_modification` (`modification_id`, `extension_install_id`, `name`, `code`, `author`, `version`, `link`, `xml`, `status`, `date_added`) VALUES
(12, 12, 'X-Shipping Pro - DearSoft', 'xshippingpro', 'DearSoft', '4.1.3', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>X-Shipping Pro - Againcart</name>\r\n    <code>xshippingpro</code>\r\n    <version>4.1.3</version>\r\n    <author>DearSoft</author>\r\n    <link>https://dearsoft.bd</link>\r\n    <file path=\"admin/view/template/sale/order_form.twig\">\r\n        <operation>\r\n            <search><![CDATA[ {{ footer }} ]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n            <script type=\"text/javascript\">\r\n            // TODO - controll centrally\r\n            var _ocm_catalog = \'{{ catalog }}\' || $(\'select[name=\\\'store\\\'] option:selected\').val();\r\n            var _ocm_request_cache = {};\r\n            var _ocm_request_counter = 1;\r\n            var xshippingpro_sub_options = {};\r\n            var xshippingpro_sub_options_flag = true;\r\n            var api_token = \'&api_token={{ api_token }}\';\r\n            $(\'#input-shipping-method\').on(\'change\', function() {\r\n                if (!$.isEmptyObject(xshippingpro_sub_options)) {\r\n                   setSubOptions();\r\n                }\r\n            });\r\n            function setSubOptions() {\r\n                var code = $(\'#input-shipping-method\').val();\r\n                var url = _ocm_catalog + \'index.php?route=api/shipping/update_sup_options\' + api_token;\r\n                $.post(url, {xshippingpro_code: code}, function( ) {\r\n                   // for future    \r\n                });\r\n            }\r\n            // following will be common for all mods\r\n            $.ajaxPrefilter(_onOcmAjaxReq);\r\n            $(document).ajaxComplete(_onOcmAjaxReqComplete);\r\n            function _onOcmAjaxReqComplete(event, xhr, settings) {\r\n                if (xshippingpro_sub_options_flag) {\r\n                     $.get(_ocm_catalog + \'index.php?route=api/shipping/get_sup_options\' + api_token, function(json) {\r\n                        xshippingpro_sub_options = json.sub_options;\r\n                     });\r\n                     xshippingpro_sub_options_flag = false;  \r\n                }\r\n            }\r\n            function _onOcmAjaxSuccess(data, status, jqXhr) {\r\n                var xshippingpro_quote = parseAndGetData(data, \'shipping_methods.xshippingpro.quote\');\r\n                if (xshippingpro_quote) {\r\n                    for (var key in xshippingpro_quote) {\r\n                        var tab_id = key.replace(\'xshippingpro\', \'\');\r\n                        if (xshippingpro_sub_options[tab_id]) {\r\n                            for (var _key in xshippingpro_sub_options[tab_id]) {\r\n                                var sub_option = xshippingpro_sub_options[tab_id][_key];\r\n                                var code = sub_option.code.replace(\'xshippingpro.\', \'\');\r\n                                xshippingpro_quote[code] = {\r\n                                   code: sub_option.code,\r\n                                   title: sub_option.title,\r\n                                   text: \'\'\r\n                                };\r\n                            }\r\n                        }\r\n                    }\r\n                    if (!$.isEmptyObject(xshippingpro_sub_options)) {\r\n                        setTimeout(setSubOptions, 500);\r\n                    }\r\n                }\r\n                if (_ocm_request_cache[jqXhr.xid]) {\r\n                    _ocm_request_cache[jqXhr.xid].call(null, data, status, jqXhr);\r\n                    _ocm_request_cache[jqXhr.xid] = null;\r\n                }\r\n            }\r\n            function _onOcmAjaxReq(options, originalOptions, jqXhr) {\r\n                if (options.dataType == \'json\' || !options.dataType) {\r\n                    jqXhr.xid = _ocm_request_counter++;\r\n                    _ocm_request_cache[jqXhr.xid] = options.success;\r\n                    options.success = _onOcmAjaxSuccess;\r\n                }\r\n            }\r\n            function parseAndGetData(data, keys) {\r\n                var _keys = keys.split(\'.\');\r\n                var _data = data;\r\n                if (!data || !$.isPlainObject(data)) {\r\n                   return false;\r\n                }\r\n                for (var i = 0; i < _keys.length; i++) {\r\n                    var key = _keys[i];\r\n                    if (_data[key]) {\r\n                        _data = _data[key];    \r\n                    } else {\r\n                       return false;\r\n                    }\r\n                }\r\n                return _data;\r\n            }\r\n            </script>\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n   <file path=\"system/library/cart/cart.php\">\r\n    <operation error=\"log\">\r\n        <ignoreif regex=\"true\"><![CDATA[ /ocm_special/ ]]></ignoreif>\r\n        <search><![CDATA[ => ($price + $option_price), ]]></search>\r\n        <add position=\"before\"><![CDATA[\r\n              \'ocm_special\'      => $price != $product_query->row[\'price\'],\r\n        ]]></add>\r\n    </operation>\r\n</file>\r\n</modification>', 0, '2025-07-19 16:22:12'),
(13, 13, 'DearSoft SSLCommerz', 'dearsoft-sslcommerz', 'DearSoft', '1.0', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>DearSoft SSLCommerz</name>\r\n    <code>DearSoft-sslcommerz</code>\r\n    <version>1.0</version>\r\n    <author>DearSoft</author>\r\n    <link>https://dearsoft.bd</link>\r\n    <description>This extension use for SSLCommerz payment gateway integration</description>\r\n    \r\n</modification>', 1, '2025-07-26 11:55:29'),
(14, 14, 'DearSoft Smart Sitemap', 'DearSoft_sitemap_ac', 'DearSoft', '1.0', 'https://www.dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>	\n<modification>\n	<name>DearSoft Smart Sitemap</name>\n	<code>DearSoft_sitemap_ac</code>\n	<version>1.0</version>\n	<author>DearSoft</author>\n	<link>https://www.dearsoft.bd</link>\n\n	<!-- OpenCart 2.0 compatibility -->\n					\n	<file path=\"system/engine/action.php\">\n		<operation error=\"skip\">\n			<search><![CDATA[is_dir(DIR_APPLICATION . \'controller/\' . $path)]]></search>\n			<add position=\"replace\"><![CDATA[!in_array($path, array(\'extension/feed\')) && is_dir(DIR_APPLICATION . \'controller/\' . $path)]]></add>\n		</operation>\n	</file>\n\n	<!-- OpenCart 2.3 compatibility -->\n					\n	<file path=\"admin/controller/extension/extension/feed.php\">\n		<operation error=\"skip\">\n			<search><![CDATA[$this->load->model(\'user/user_group\');]]></search>\n			<add position=\"after\"><![CDATA[\n			\n			$this->model_user_user_group->addPermission($this->user->getGroupId(), \'access\', \'feed/sitemaps\');\n			$this->model_user_user_group->addPermission($this->user->getGroupId(), \'modify\', \'feed/sitemaps\');\n						\n			]]></add>\n		</operation>	\n		<operation error=\"skip\">\n			<search><![CDATA[$data[\'extensions\'][] = array(]]></search>\n			<add position=\"before\"><![CDATA[\n			\n			if (in_array($this->language->get(\'heading_title\'), array_column($data[\'extensions\'], \'name\'))) continue;\n			\n			]]></add>\n		</operation>\n	</file>\n	\n	<file path=\"catalog/controller/event/compatibility.php\">\n		<operation error=\"skip\">\n			<search><![CDATA[&& is_file(DIR_APPLICATION]]></search>\n			<add position=\"replace\"><![CDATA[&& !preg_match(\'/\\/sitemaps/\', $route) && is_file(DIR_APPLICATION]]></add>\n		</operation>\n	</file>\n				\n</modification>', 1, '2025-07-27 13:05:22'),
(16, 16, 'DearSoft Group', 'DearSoft_attribute_group', 'DearSoft', '3.0', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>DearSoft Group</name>\n	<code>DearSoft_attribute_group</code>\n	<version>3.0</version>\n	<author>DearSoft</author>\n	<link>https://dearsoft.bd</link>\n\n 	<file path=\"admin/controller/catalog/product.php\">\n		<operation>\n		<search index=\"0\"><![CDATA[$this->load->model(\'catalog/attribute\');]]></search>\n			<add position=\"after\"><![CDATA[\n$this->load->model(\'catalog/attribute_group\');\n$data[\'attribute_groups\'] = $this->model_catalog_attribute_group->getAttributeGroups();\n  			]]></add>\n		</operation>\n	  	<operation>\n		<search index=\"0\"><![CDATA[public function index() {]]></search>\n			<add position=\"before\"><![CDATA[\npublic function getattributesbygroup() {\n	$json = array();\n	\n	if (isset($this->request->get[\'attribute_group_id\'])) {\n		$this->load->model(\'catalog/attribute\');\n		$json = $this->model_catalog_attribute->getAttributes(array(\'filter_attribute_group_id\' => $this->request->get[\'attribute_group_id\']));\n	}\n	$this->response->addHeader(\'Content-Type: application/json\');\n	$this->response->setOutput(json_encode($json));\n}\n			]]></add>\n		</operation>\n	   \n       <operation>\n        <search index=\"0\"><![CDATA[if (isset($this->request->post[\'product_attribute\'])) {]]></search>\n                <add position=\"before\"><![CDATA[\n                    $this->load->model(\'extension/module/attribute_group_category\');\n                    $data[\'attribute_group_categories\'] = $this->model_extension_module_attribute_group_category->getAttributeGroupCategories(array(\'sort\'=>\'sort_order\'));\n                    $data[\'attribute_group_category_status\'] = $this->config->get(\'module_attribute_group_category_status\'); \n                    \n                ]]></add>\n        </operation>\n\n	</file>\n  	<file path=\"admin/view/template/catalog/product_form.twig\">\n		<operation>\n		<search index=\"0\"><![CDATA[<div class=\"tab-pane\" id=\"tab-attribute\">]]></search>\n			<add position=\"after\"><![CDATA[\n<div class=\"form-group\">\n  <label class=\"col-sm-2 control-label\" for=\"input-attribute_group_id\">{{ entry_attribute_group }}</label>\n  <div class=\"col-sm-10\">\n	<select name=\"attribute_group_id\" id=\"input-attribute_group_id\" class=\"form-control\" onchange=\"addAttributeByGroupID($(this).val());\">\n	<option value=\"\">{{ text_select }}</option>\n	{% for attribute_group in attribute_groups %}\n <option value=\"{{ attribute_group.attribute_group_id }}\">{{ attribute_group.name }}</option>\n	{% endfor %}\n	</select>\n  </div>\n</div>\n			]]></add>\n		</operation>\n        <operation>\n        <search><![CDATA[<div class=\"tab-pane\" id=\"tab-attribute\">]]></search>\n                <add position=\"after\"><![CDATA[\n                    {% if attribute_group_category_status %}\n                    <div class=\"form-group\">\n                      <label class=\"col-sm-2 control-label\" for=\"input-attribute-group-category\">{{ entry_attribute_group_category }}</label>\n                      <div class=\"col-sm-10\">\n                            <select name=\"attribute_group_category_id\" id=\"input-attribute-group-category\" class=\"form-control\">\n                            <option value=\"\">{{ text_select }}</option>\n                            {% for attribute_group_category in attribute_group_categories %}\n                                <option value=\"{{ attribute_group_category.attribute_group_category_id }}\">{{ attribute_group_category.name }}</option>\n                            {% endfor %}\n                            </select>\n                      </div>\n                    </div>\n                    {% endif %}\n                ]]></add>\n        </operation>\n	  	<operation>\n		<search index=\"0\"><![CDATA[function addAttribute() {]]></search>\n			<add position=\"before\"><![CDATA[\nfunction addAttributeByGroupID(attribute_group_id) {\n$.ajax({\nurl: \'index.php?route=catalog/product/getattributesbygroup&user_token={{ user_token }}&attribute_group_id=\' +  encodeURIComponent(attribute_group_id),\ndataType: \'json\',\nbeforeSend: function(){\n	$(\'#input-attribute_group_id\').after(\'<i class=\"fa fa-spinner fa-spin\" id=\"attribute-group-loading\"></i>\');\n},\nsuccess: function(json) {\n	if(json.length > 0){	\n		for(var i=0;i<json.length;i++){\n		html  = \'<tr id=\"attribute-row\' + attribute_row + \'\">\';\n	  	html += \'<td class=\"text-left\" style=\"width: 20%;\"><input type=\"text\" name=\"product_attribute[\' + attribute_row + \'][name]\" value=\"\'+json[i].name+\'\" placeholder=\"{{ entry_attribute }}\" class=\"form-control\" /><input type=\"hidden\" name=\"product_attribute[\' + attribute_row + \'][attribute_id]\" value=\"\'+json[i].attribute_id+\'\" /></td>\';\n	 	html += \'  <td class=\"text-left\">\';\n	   {% for language in languages %}\n	  html += \'<div class=\"input-group\"><span class=\"input-group-addon\"><img src=\"language/{{ language.code }}/{{ language.code }}.png\" title=\"{{ language.name }}\" /></span><textarea name=\"product_attribute[\' + attribute_row + \'][product_attribute_description][{{ language.language_id }}][text]\" rows=\"5\" placeholder=\"{{ entry_text }}\" class=\"form-control\"></textarea></div>\';\n	   {% endfor %}\n	  	html += \'  </td>\';\n	  	html += \'  <td class=\"text-right\"><button type=\"button\" onclick=\"$(\\\'#attribute-row\' + attribute_row + \'\\\').remove();\" data-toggle=\"tooltip\" title=\"{{ button_remove }}\" class=\"btn btn-danger\"><i class=\"fa fa-minus-circle\"></i></button></td>\';\n	  	html += \'</tr>\';\n	  	$(\'#attribute tbody\').append(html);\n	  	attributeautocomplete(attribute_row);\n	  	attribute_row++;\n		}\n	}\n	$(\'#attribute-group-loading\').remove();\n}\n});\n}\n			]]></add>\n		</operation>\n        <operation>\n        <search><![CDATA[{{ footer }}]]></search>\n                <add position=\"before\"><![CDATA[\n                    <script type=\"text/javascript\">\n                        $(\'#input-attribute-group-category\').on(\'change\', function(){\n                            let attribute_group_category_id = $(this).val();\n                            let html;                    \n                            if (attribute_group_category_id) {\n                                $.ajax({\n                                    url: \'index.php?route=extension/module/attribute_group_category/attribute&user_token={{ user_token }}&attribute_group_category_id=\' +  encodeURIComponent(attribute_group_category_id),\n                                    dataType: \'json\',\n                                    beforeSend: function(){\n                                            $(\'#input-attribute-group-category\').after(\'<i class=\"fa fa-spinner fa-spin\" id=\"attribute-group-category-loading\"></i>\');\n                                    },\n                                    success: function(json) {\n                                        if(json[\'attributes\'].length > 0){  \n                                            $.each(json[\'attributes\'], function(index, item){\n                                                html = \'\';\n                                                html += \'<tr id=\"attribute-row\' + attribute_row + \'\">\';\n                                                    html += \'<td class=\"text-left\" style=\"width: 20%;\">\';\n                                                        html += \'<input type=\"text\" name=\"product_attribute[\' + attribute_row + \'][name]\" value=\"\' + item.name + \'\" placeholder=\"{{ entry_attribute }}\" class=\"form-control\" />\';\n                                                        html += \'<input type=\"hidden\" name=\"product_attribute[\' + attribute_row + \'][attribute_id]\" value=\"\' + item.attribute_id + \'\" />\';\n                                                    html += \'</td>\';\n                                                    html += \'<td class=\"text-left\">\';\n                                                        {% for language in languages %}\n                                                        html += \'<div class=\"input-group\">\';\n                                                            html += \'<span class=\"input-group-addon\"><img src=\"language/{{ language.code }}/{{ language.code }}.png\" title=\"{{ language.name }}\" /></span>\';\n                                                            html += \'<textarea name=\"product_attribute[\' + attribute_row + \'][product_attribute_description][{{ language.language_id }}][text]\" rows=\"5\" placeholder=\"{{ entry_text }}\" class=\"form-control\"></textarea>\';\n                                                        html += \'</div>\';\n                                                        {% endfor %}                            \n                                                    html += \'</td>\';\n                                                    html += \'<td class=\"text-right\">\';\n                                                        html += \'<button type=\"button\" onclick=\"$(\\\'#attribute-row\' + attribute_row + \'\\\').remove();\" data-toggle=\"tooltip\" title=\"{{ button_remove }}\" class=\"btn btn-danger\"><i class=\"fa fa-minus-circle\"></i></button>\';\n                                                    html += \'</td>\';\n                                                html += \'</tr>\';\n                                                $(\'#attribute tbody\').append(html);\n                                                attributeautocomplete(attribute_row);\n                                                attribute_row++;\n                                            });    \n                                        }\n                                        $(\'#attribute-group-category-loading\').remove();\n                                    }\n                                });\n                            }\n                        });\n                    </script>                            \n                ]]></add>\n        </operation>\n	</file>\n\n<!-- Attribute Group Category -->\n<file path=\"admin/controller/common/column_left.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[if ($attribute) {]]></search>\n            <add position=\"before\">\n            <![CDATA[\n                if ($this->user->hasPermission(\'access\', \'extension/module/attribute_group_category\') && $this->config->get(\'module_attribute_group_category_status\')) {\n                        $attribute[] = array(\n                                \'name\'	   => \'Group Category\',\n                                \'href\'     => $this->url->link(\'extension/module/attribute_group_category/category\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n                                \'children\' => array()\n                        );\n                }                                            \n            ]]>\n            </add>\n        </operation>\n    </file>\n    \n    <file path=\"admin/language/en-gb/catalog/attribute_group.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[// Entry]]></search>\n            <add position=\"after\">\n            <![CDATA[$_[\'entry_attribute_group_category\'] = \'Attribute Group Category\';\n            $_[\'text_autocomplete\'] = \'Autocomplete\';\n]]>\n            </add>\n        </operation>\n    </file>\n    <file path=\"admin/controller/catalog/attribute_group.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[$data[\'sort_order\'] = \'\';]]></search>\n            <add position=\"after\" offset=\"1\">\n            <![CDATA[\n            $data[\'attribute_group_category_status\'] = $this->config->get(\'module_attribute_group_category_status\');  \n            if ($data[\'attribute_group_category_status\']) {\n                $this->load->model(\'extension/module/attribute_group_category\');    \n                if (isset($this->request->post[\'attribute_group_category\'])) {\n                    $attribute_group_category = $this->request->post[\'attribute_group_category\'];\n                } elseif (!empty($attribute_group_info)) {\n                    $attribute_group_category = $this->model_extension_module_attribute_group_category->getAttributeGroupAttributeGroupCategories($this->request->get[\'attribute_group_id\']);\n                } else {\n                    $attribute_group_category = array();\n                }        \n                $data[\'attribute_group_categories\'] = array();\n                foreach ($attribute_group_category as $attribute_group_category_id) {\n                    $attribute_group_category_info = $this->model_extension_module_attribute_group_category->getAttributeGroupCategory($attribute_group_category_id);\n                    if ($attribute_group_category_info) {\n                        $data[\'attribute_group_categories\'][] = array(\n                            \'attribute_group_category_id\' => $attribute_group_category_id,\n                            \'name\' => $attribute_group_category_info[\'name\'],\n                        );\n                    }\n                }\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            }\n            ]]>\n            </add>\n        </operation>\n    </file>\n    <file path=\"admin/model/catalog/attribute_group.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"attribute_group_description]]></search>\n            <add position=\"after\" offset=\"1\">\n            <![CDATA[\n        if ($this->config->get(\'module_attribute_group_category_status\')) {    \n            $this->db->query(\"DELETE FROM \" . DB_PREFIX . \"attribute_group_to_category WHERE attribute_group_id = \'\" . (int)$attribute_group_id . \"\'\");\n            if (!empty($data[\'attribute_group_category\'])) {\n                foreach ($data[\'attribute_group_category\'] as $attribute_group_category_id) {\n                    $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"attribute_group_to_category SET\"\n                            . \" attribute_group_id = \'\" . (int)$attribute_group_id . \"\',\"\n                            . \" attribute_group_category_id = \'\" . (int)$attribute_group_category_id . \"\'\"\n                            . \"\");\n                }\n            }\n        }\n            ]]>\n            </add>\n        </operation>\n        <operation error=\"skip\">\n            <search><![CDATA[public function deleteAttributeGroup($attribute_group_id) {]]></search>\n            <add position=\"after\">\n            <![CDATA[\n            if ($this->config->get(\'module_attribute_group_category_status\')) {\n                $this->db->query(\"DELETE FROM \" . DB_PREFIX . \"attribute_group_to_category WHERE attribute_group_id = \'\" . (int)$attribute_group_id . \"\'\");\n            }    \n            ]]>\n            </add>\n        </operation>\n    </file>\n    <file path=\"admin/view/template/catalog/attribute_group_form.twig\">\n        <operation error=\"skip\">\n            <search><![CDATA[</form>]]></search>\n            <add position=\"before\">\n            <![CDATA[\n            {% if (attribute_group_category_status) %}\n                <div class=\"form-group\">\n                  <label class=\"col-sm-2 control-label\" for=\"input-attribute-group-category\"><span data-toggle=\"tooltip\" title=\"{{ text_autocomplete }}\">{{ entry_attribute_group_category }}</span></label>\n                  <div class=\"col-sm-10\">\n                    <input type=\"text\" name=\"attribute_group_category_name\" value=\"\" placeholder=\"{{ text_autocomplete }}\" id=\"input-attribute-group-category\" class=\"form-control\"/>\n                    <div id=\"attribute-group-category\" class=\"well well-sm\" style=\"height: 150px; overflow: auto;\"> {% for attribute_group_category in attribute_group_categories %}\n                        <div id=\"attribute-group-category{{ attribute_group_category.attribute_group_category_id }}\"><i class=\"fa fa-minus-circle\"></i> {{ attribute_group_category.name }}\n                          <input type=\"hidden\" name=\"attribute_group_category[]\" value=\"{{ attribute_group_category.attribute_group_category_id }}\"/>\n                        </div>\n                      {% endfor %}</div>\n                  </div>\n                </div>  \n            {% endif %}    \n            ]]>\n            </add>\n        </operation>\n        <operation error=\"skip\">\n            <search><![CDATA[{{ footer }}]]></search>\n            <add position=\"before\">\n            <![CDATA[\n{% if (attribute_group_category_status) %}            \n<script type=\"text/javascript\">\n      $(\'#input-attribute-group-category\').autocomplete({\n                \'source\': function(request, response) {\n                        $.ajax({\n                                url: \'index.php?route=extension/module/attribute_group_category/autocompleteCategory&user_token={{ user_token }}&filter_name=\' + encodeURIComponent(request),\n                                dataType: \'json\',\n                                success: function(json) {\n                                        response($.map(json, function(item) {\n                                                return {\n                                                        label: item[\'name\'],\n                                                        value: item[\'attribute_group_category_id\']\n                                                }\n                                        }));\n                                }\n                        });\n                },\n                \'select\': function(item) {\n                        $(\'#input-attribute-group-category\').val(\'\');\n                        $(\'#attribute-group-category\' + item[\'value\']).remove();\n                        $(\'#attribute-group-category\').append(\'<div id=\"attribute-group-category\' + item[\'value\'] + \'\"><i class=\"fa fa-minus-circle\"></i> \' + item[\'label\'] + \'<input type=\"hidden\" name=\"attribute_group_category[]\" value=\"\' + item[\'value\'] + \'\" /></div>\');\n                }\n        });\n\n        $(\'#attribute-group-category\').delegate(\'.fa-minus-circle\', \'click\', function() {\n                $(this).parent().remove();\n        });\n</script> \n{% endif %}  \n            ]]>\n            </add>\n        </operation>\n    </file>\n    \n    <!-- Attribute -->\n    <file path=\"admin/language/en-gb/catalog/attribute.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[// Entry]]></search>\n            <add position=\"after\">\n            <![CDATA[$_[\'entry_attribute_group_category\'] = \'Attribute Group Category\';\n            $_[\'text_autocomplete\'] = \'Autocomplete\';\n]]>\n            </add>\n        </operation>\n    </file>   \n    <file path=\"admin/controller/catalog/attribute.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[$data[\'sort_order\'] = \'\';]]></search>\n            <add position=\"after\" offset=\"1\">\n            <![CDATA[\n            $data[\'attribute_group_category_status\'] = $this->config->get(\'module_attribute_group_category_status\');  \n            if ($data[\'attribute_group_category_status\']) {\n                $this->load->model(\'extension/module/attribute_group_category\');    \n                if (isset($this->request->post[\'attribute_group_category\'])) {\n                    $attribute_group_category = $this->request->post[\'attribute_group_category\'];\n                } elseif (!empty($attribute_info)) {\n                    $attribute_group_category = $this->model_extension_module_attribute_group_category->getAttributeAttributeGroupCategories($this->request->get[\'attribute_id\']);\n                } else {\n                    $attribute_group_category = array();\n                }        \n                $data[\'attribute_group_categories\'] = array();\n                foreach ($attribute_group_category as $attribute_group_category_id) {\n                    $attribute_group_category_info = $this->model_extension_module_attribute_group_category->getAttributeGroupCategory($attribute_group_category_id);\n                    if ($attribute_group_category_info) {\n                        $data[\'attribute_group_categories\'][] = array(\n                            \'attribute_group_category_id\' => $attribute_group_category_id,\n                            \'name\' => $attribute_group_category_info[\'name\'],\n                        );\n                    }\n                }\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            }\n            ]]>\n            </add>\n        </operation>\n    </file>     \n    <file path=\"admin/model/catalog/attribute.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"attribute_description]]></search>\n            <add position=\"after\" offset=\"1\">\n            <![CDATA[\n        if ($this->config->get(\'module_attribute_group_category_status\')) {    \n            $this->db->query(\"DELETE FROM \" . DB_PREFIX . \"attribute_to_group_category WHERE attribute_id = \'\" . (int)$attribute_id . \"\'\");\n            if (!empty($data[\'attribute_group_category\'])) {\n                foreach ($data[\'attribute_group_category\'] as $attribute_group_category_id) {\n                    $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"attribute_to_group_category SET\"\n                            . \" attribute_id = \'\" . (int)$attribute_id . \"\',\"\n                            . \" attribute_group_category_id = \'\" . (int)$attribute_group_category_id . \"\'\"\n                            . \"\");\n                }\n            }\n        }\n            ]]>\n            </add>\n        </operation>\n        <operation error=\"skip\">\n            <search><![CDATA[public function deleteAttribute($attribute_id) {]]></search>\n            <add position=\"after\">\n            <![CDATA[\n            if ($this->config->get(\'module_attribute_group_category_status\')) {\n                $this->db->query(\"DELETE FROM \" . DB_PREFIX . \"attribute_to_group_category WHERE attribute_id = \'\" . (int)$attribute_id . \"\'\");\n            }    \n            ]]>\n            </add>\n        </operation>\n    </file>    \n    <file path=\"admin/view/template/catalog/attribute_form.twig\">\n        <operation error=\"skip\">\n            <search><![CDATA[</form>]]></search>\n            <add position=\"before\">\n            <![CDATA[\n            {% if (attribute_group_category_status) %}\n                <div class=\"form-group\">\n                  <label class=\"col-sm-2 control-label\" for=\"input-attribute-group-category\"><span data-toggle=\"tooltip\" title=\"{{ text_autocomplete }}\">{{ entry_attribute_group_category }}</span></label>\n                  <div class=\"col-sm-10\">\n                    <input type=\"text\" name=\"attribute_group_category_name\" value=\"\" placeholder=\"{{ text_autocomplete }}\" id=\"input-attribute-group-category\" class=\"form-control\"/>\n                    <div id=\"attribute-group-category\" class=\"well well-sm\" style=\"height: 150px; overflow: auto;\"> {% for attribute_group_category in attribute_group_categories %}\n                        <div id=\"attribute-group-category{{ attribute_group_category.attribute_group_category_id }}\"><i class=\"fa fa-minus-circle\"></i> {{ attribute_group_category.name }}\n                          <input type=\"hidden\" name=\"attribute_group_category[]\" value=\"{{ attribute_group_category.attribute_group_category_id }}\"/>\n                        </div>\n                      {% endfor %}</div>\n                  </div>\n                </div>  \n            {% endif %}    \n            ]]>\n            </add>\n        </operation>\n        <operation error=\"skip\">\n            <search><![CDATA[{{ footer }}]]></search>\n            <add position=\"before\">\n            <![CDATA[\n{% if (attribute_group_category_status) %}            \n<script type=\"text/javascript\">\n      $(\'#input-attribute-group-category\').autocomplete({\n                \'source\': function(request, response) {\n                        $.ajax({\n                                url: \'index.php?route=extension/module/attribute_group_category/autocompleteCategory&user_token={{ user_token }}&filter_name=\' + encodeURIComponent(request),\n                                dataType: \'json\',\n                                success: function(json) {\n                                        response($.map(json, function(item) {\n                                                return {\n                                                        label: item[\'name\'],\n                                                        value: item[\'attribute_group_category_id\']\n                                                }\n                                        }));\n                                }\n                        });\n                },\n                \'select\': function(item) {\n                        $(\'#input-attribute-group-category\').val(\'\');\n                        $(\'#attribute-group-category\' + item[\'value\']).remove();\n                        $(\'#attribute-group-category\').append(\'<div id=\"attribute-group-category\' + item[\'value\'] + \'\"><i class=\"fa fa-minus-circle\"></i> \' + item[\'label\'] + \'<input type=\"hidden\" name=\"attribute_group_category[]\" value=\"\' + item[\'value\'] + \'\" /></div>\');\n                }\n        });\n\n        $(\'#attribute-group-category\').delegate(\'.fa-minus-circle\', \'click\', function() {\n                $(this).parent().remove();\n        });\n</script> \n{% endif %}  \n            ]]>\n            </add>\n        </operation>\n    </file>\n    <!-- End of Attribute -->\n\n    <file path=\"admin/language/en-gb/catalog/product.php\">\n        <operation error=\"skip\">\n            <search><![CDATA[// Entry]]></search>\n            <add position=\"after\">\n            <![CDATA[$_[\'entry_attribute_group_category\'] = \'Attribute Group Category\';]]>\n            </add>\n        </operation>\n    </file>    \n        \n    <file path=\"admin/model/catalog/product.php\">\n        <operation>\n        <search><![CDATA[foreach ($data[\'product_attribute\'] as $product_attribute) {]]></search>\n                <add position=\"before\"><![CDATA[\n                   $data[\'product_attribute\'] = array_filter($data[\'product_attribute\'], function($item){ return !empty($item[\'product_attribute_description\'][$this->config->get(\'config_language_id\')][\'text\']);}); \n                ]]></add>\n        </operation>\n    </file>        \n    \n\n</modification>', 1, '2025-07-28 12:31:28');
INSERT INTO `ac_modification` (`modification_id`, `extension_install_id`, `name`, `code`, `author`, `version`, `link`, `xml`, `status`, `date_added`) VALUES
(17, 17, 'DearSoft Product Option Image', 'again-product-option-image', 'DearSoft', '3.0', 'https://www.deaersoft.bd/', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n	<name>DearSoft Product Option Image</name>\n	<version>3.0</version>\n	<author>DearSoft</author>\n	<link>https://www.deaersoft.bd/</link>\n	<code>again-product-option-image</code>\n\n	<file path=\"admin/controller/catalog/option.php\">\n\n		<!-- autocomplete() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'limit\'       => 5]]></search>\n			<add position=\"replace\"><![CDATA[\'limit\'       => 15]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/controller/catalog/product.php\">\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[$this->load->model(\'catalog/option\');]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$this->load->model(\'tool/image\');\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[foreach ($product_option[\'product_option_value\'] as $product_option_value) {]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			if (is_file(DIR_IMAGE . $product_option_value[\'option_image\'])) {\n				$product_option_value_image = $product_option_value[\'option_image\'];\n				$product_option_value_thumb = $product_option_value[\'option_image\'];\n			} else {\n				$product_option_value_image = \'\';\n				$product_option_value_thumb = \'no_image.png\';\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'weight_prefix\'           => $product_option_value[\'weight_prefix\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option_value\'		=> $product_option_value[\'master_option_value\'],\n			\'option_image\'			=> $product_option_value_image,\n			\'option_thumb\'			=> $this->model_tool_image->resize($product_option_value_thumb, 100, 100),\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[\'required\'             => $product_option[\'required\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option\'			=> $product_option[\'master_option\'],\n			\'master_option_data\'		=> $master_option_data,\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm(), getList() -->\n		<operation error=\"skip\">\n			<search><![CDATA[if (isset($this->error[\'warning\'])) {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			$this->load->language(\'catalog/related_options\');\n			//$data[\'entry_master_option\']       = $this->language->get(\'entry_master_option\');\n			//$data[\'entry_master_option_value\'] = $this->language->get(\'entry_master_option_value\');\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search><![CDATA[if (isset($product_option[\'product_option_value\'])) {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n				$master_option_data = array();\n				if (isset($product_option[\'master_option_data\'])) {\n					$master_option_data = $product_option[\'master_option_data\'];\n				} else {\n					if (!empty($product_option[\'master_option\'])) {\n						foreach ($product_options as $product_option1) {\n							if ($product_option1[\'option_id\'] == $product_option[\'master_option\']) {\n								foreach ($product_option1[\'product_option_value\'] as $key_option => $val_option) {\n									$option_name = $this->model_catalog_option->getOptionValue($val_option[\'option_value_id\']);\n									$product_option1[\'product_option_value\'][$key_option][\'name\'] = $option_name[\'name\'];\n								}\n								$master_option_data = $product_option1;\n							}\n						}\n					}\n				}\n\n			if ($product_option[\'type\'] == \'select\' || $product_option[\'type\'] == \'radio\' || $product_option[\'type\'] == \'checkbox\' || $product_option[\'type\'] == \'image\') {\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$data[\'option_values\'] = array();]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			 else {\n				$data[\'product_options\'][] = array(\n					\'product_option_id\' => $product_option[\'product_option_id\'],\n					\'option_id\'         => $product_option[\'option_id\'],\n					\'name\'              => $product_option[\'name\'],\n					\'type\'              => $product_option[\'type\'],\n					\'value\'             => $product_option[\'value\'],\n					//BOF Related Options\n					\'master_option\'			=> $product_option[\'master_option\'],\n					\'master_option_data\'		=> $master_option_data,\n					\'master_option_value\'		=> isset($product_option[\'master_option_value\']) ? $product_option[\'master_option_value\'] : 0,\n					//EOF Related Options\n					\'required\'          => $product_option[\'required\']\n				);\n			}\n		}\n		//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$this->response->setOutput($this->load->view(\'catalog/product_form\', $data));]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			//usort($data[\'product_options\'], function($a, $b) {\n			//	return $a[\'product_option_id\'] - $b[\'product_option_id\'];\n			//});\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getForm() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$this->load->model(\'design/layout\');]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			$data[\'product_id\'] = isset($this->request->get[\'product_id\']) ? $this->request->get[\'product_id\'] : 0;\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- autocomplete() -->\n		<operation error=\"skip\">\n			<search index=\"1\"><![CDATA[\'required\'             => $product_option[\'required\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option\'			=> $product_option[\'master_option\'],\n			\'master_option_data\'		=> isset($product_option[\'master_option_data\'])  ? $product_option[\'master_option_data\']  : array(),\n			\'master_option_value\'		=> isset($product_option[\'master_option_value\']) ? $product_option[\'master_option_value\'] : 0,\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<operation error=\"skip\">\n			<search><![CDATA[public function autocomplete() {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n	public function updaterelations() {\n\n		$this->load->language(\'catalog/product\');\n		$this->load->language(\'catalog/related_options\');\n\n		$json = array();\n		\n		if (!$this->user->hasPermission(\'modify\', \'catalog/product\')) {\n			$json[\'error\'] = $this->language->get(\'error_permission\');\n		}\n\n		$options = $this->request->post;\n\n		if (($product_id = $this->request->post[\'product_id\'] * 1) > 0 && !$json) {\n			$this->load->model(\'catalog/product\');\n			$this->model_catalog_product->editProductOptions($product_id, $options);\n\n			$data[\'row\'] = preg_replace (\"/[^0-9]/\", \"\", $options[\'active\']);\n			$data[\'user_token\'] = $this->session->data[\'user_token\'];\n\n			$data[\'text_form\'] = !isset($this->request->get[\'product_id\']) ? $this->language->get(\'text_add\') : $this->language->get(\'text_edit\');\n			//$data[\'text_enabled\'] = $this->language->get(\'text_enabled\');\n			//$data[\'text_disabled\'] = $this->language->get(\'text_disabled\');\n			//$data[\'text_none\'] = $this->language->get(\'text_none\');\n			//$data[\'text_yes\'] = $this->language->get(\'text_yes\');\n			//$data[\'text_no\'] = $this->language->get(\'text_no\');\n			//$data[\'text_plus\'] = $this->language->get(\'text_plus\');\n			//$data[\'text_minus\'] = $this->language->get(\'text_minus\');\n			//$data[\'text_default\'] = $this->language->get(\'text_default\');\n			//$data[\'text_option\'] = $this->language->get(\'text_option\');\n			//$data[\'text_option_value\'] = $this->language->get(\'text_option_value\');\n			//$data[\'text_select\'] = $this->language->get(\'text_select\');\n			//$data[\'text_percent\'] = $this->language->get(\'text_percent\');\n			//$data[\'text_amount\'] = $this->language->get(\'text_amount\');\n			//$data[\'text_select_all\'] = $this->language->get(\'text_select_all\');\n			//$data[\'text_unselect_all\'] = $this->language->get(\'text_unselect_all\');\n\n			//$data[\'entry_location\'] = $this->language->get(\'entry_location\');\n			//$data[\'entry_minimum\'] = $this->language->get(\'entry_minimum\');\n			//$data[\'entry_shipping\'] = $this->language->get(\'entry_shipping\');\n			//$data[\'entry_date_available\'] = $this->language->get(\'entry_date_available\');\n			//$data[\'entry_quantity\'] = $this->language->get(\'entry_quantity\');\n			//$data[\'entry_stock_status\'] = $this->language->get(\'entry_stock_status\');\n			//$data[\'entry_price\'] = $this->language->get(\'entry_price\');\n			//$data[\'entry_tax_class\'] = $this->language->get(\'entry_tax_class\');\n			//$data[\'entry_points\'] = $this->language->get(\'entry_points\');\n			//$data[\'entry_option_points\'] = $this->language->get(\'entry_option_points\');\n			//$data[\'entry_subtract\'] = $this->language->get(\'entry_subtract\');\n			//$data[\'entry_weight_class\'] = $this->language->get(\'entry_weight_class\');\n			//$data[\'entry_weight\'] = $this->language->get(\'entry_weight\');\n			//$data[\'entry_dimension\'] = $this->language->get(\'entry_dimension\');\n			//$data[\'entry_length_class\'] = $this->language->get(\'entry_length_class\');\n			//$data[\'entry_length\'] = $this->language->get(\'entry_length\');\n			//$data[\'entry_width\'] = $this->language->get(\'entry_width\');\n			//$data[\'entry_height\'] = $this->language->get(\'entry_height\');\n			//$data[\'entry_image\'] = $this->language->get(\'entry_image\');\n			//$data[\'entry_additional_image\'] = $this->language->get(\'entry_additional_image\');\n			//$data[\'entry_store\'] = $this->language->get(\'entry_store\');\n			//$data[\'entry_download\'] = $this->language->get(\'entry_download\');\n			//$data[\'entry_text\'] = $this->language->get(\'entry_text\');\n			//$data[\'entry_option\'] = $this->language->get(\'entry_option\');\n			//$data[\'entry_option_value\'] = $this->language->get(\'entry_option_value\');\n			//$data[\'entry_required\'] = $this->language->get(\'entry_required\');\n			//$data[\'entry_sort_order\'] = $this->language->get(\'entry_sort_order\');\n			//$data[\'entry_status\'] = $this->language->get(\'entry_status\');\n			//$data[\'entry_date_start\'] = $this->language->get(\'entry_date_start\');\n			//$data[\'entry_date_end\'] = $this->language->get(\'entry_date_end\');\n			//$data[\'entry_priority\'] = $this->language->get(\'entry_priority\');\n			//$data[\'entry_customer_group\'] = $this->language->get(\'entry_customer_group\');\n			//$data[\'entry_reward\'] = $this->language->get(\'entry_reward\');\n			//$data[\'entry_layout\'] = $this->language->get(\'entry_layout\');\n			//$data[\'entry_recurring\'] = $this->language->get(\'entry_recurring\');\n\n			//$data[\'button_view\'] = $this->language->get(\'button_view\');\n			//$data[\'button_save\'] = $this->language->get(\'button_save\');\n			//$data[\'button_cancel\'] = $this->language->get(\'button_cancel\');\n			//$data[\'button_option_add\'] = $this->language->get(\'button_option_add\');\n			//$data[\'button_option_value_add\'] = $this->language->get(\'button_option_value_add\');\n			//$data[\'button_remove\'] = $this->language->get(\'button_remove\');\n\n			//$data[\'tab_option\'] = $this->language->get(\'tab_option\');\n\n			//BOF Related Options\n			//$data[\'entry_master_option\'] = $this->language->get(\'entry_master_option\');\n			//$data[\'entry_master_option_value\'] = $this->language->get(\'entry_master_option_value\');\n			//EOF Related Options\n\n			// Options\n			$this->load->model(\'catalog/option\');\n\n			//BOF Related Options\n			$this->load->model(\'tool/image\');\n			$data[\'placeholder\'] = $this->model_tool_image->resize(\'no_image.png\', 100, 100);\n			//EOF Related Options\n\n			$product_options = $this->model_catalog_product->getProductOptions($product_id);\n\n			$data[\'product_options\'] = array();\n\n			foreach ($product_options as $product_option) {\n				$product_option_value_data = array();\n\n				//BOF Related Options\n				$master_option_data = array();\n				if (isset($product_option[\'master_option_data\'])) {\n					$master_option_data = $product_option[\'master_option_data\'];\n				} else {\n					if (!empty($product_option[\'master_option\'])) {\n						foreach ($product_options as $product_option1) {\n							if ($product_option1[\'option_id\'] == $product_option[\'master_option\']) {\n								foreach ($product_option1[\'product_option_value\'] as $key_option => $val_option) {\n									$option_name = $this->model_catalog_option->getOptionValue($val_option[\'option_value_id\']);\n									$product_option1[\'product_option_value\'][$key_option][\'name\'] = $option_name[\'name\'];\n								}\n								$master_option_data = $product_option1;\n							}\n						}\n					}\n				}\n\n				if ($product_option[\'type\'] == \'select\' || $product_option[\'type\'] == \'radio\' || $product_option[\'type\'] == \'checkbox\' || $product_option[\'type\'] == \'image\') {\n					//EOF Related Options\n					if (isset($product_option[\'product_option_value\'])) {\n						foreach ($product_option[\'product_option_value\'] as $product_option_value) {\n\n							//BOF Related Options\n							if (is_file(DIR_IMAGE . $product_option_value[\'option_image\'])) {\n								$product_option_value_image = $product_option_value[\'option_image\'];\n								$product_option_value_thumb = $product_option_value[\'option_image\'];\n							} else {\n								$product_option_value_image = \'\';\n								$product_option_value_thumb = \'no_image.png\';\n							}\n							//EOF Related Options\n\n							$product_option_value_data[] = array(\n								\'product_option_value_id\' => $product_option_value[\'product_option_value_id\'],\n								\'option_value_id\'         => $product_option_value[\'option_value_id\'],\n								\'quantity\'                => $product_option_value[\'quantity\'],\n								\'subtract\'                => $product_option_value[\'subtract\'],\n								\'price\'                   => $product_option_value[\'price\'],\n								\'price_prefix\'            => $product_option_value[\'price_prefix\'],\n								\'points\'                  => $product_option_value[\'points\'],\n								\'points_prefix\'           => $product_option_value[\'points_prefix\'],\n								\'weight\'                  => $product_option_value[\'weight\'],\n								//BOF Related Options\n								\'master_option_value\'     => $product_option_value[\'master_option_value\'],\n								\'option_image\'            => $product_option_value_image,\n								\'option_thumb\'            => $this->model_tool_image->resize($product_option_value_thumb, 100, 100),\n								//EOF Related Options\n								\'weight_prefix\'           => $product_option_value[\'weight_prefix\']\n							);\n						}\n					}\n\n					$data[\'product_options\'][] = array(\n						\'product_option_id\'    => $product_option[\'product_option_id\'],\n						\'product_option_value\' => $product_option_value_data,\n						\'option_id\'            => $product_option[\'option_id\'],\n						\'name\'                 => $product_option[\'name\'],\n						\'type\'                 => $product_option[\'type\'],\n						\'value\'                => isset($product_option[\'value\']) ? $product_option[\'value\'] : \'\',\n						//BOF Related Options\n						\'master_option\'        => $product_option[\'master_option\'],\n						\'master_option_data\'   => $master_option_data,\n						//EOF Related Options\n						\'required\'             => $product_option[\'required\']\n					);\n				} else {\n					$data[\'product_options\'][] = array(\n						\'product_option_id\' => $product_option[\'product_option_id\'],\n						\'option_id\'         => $product_option[\'option_id\'],\n						\'name\'              => $product_option[\'name\'],\n						\'type\'              => $product_option[\'type\'],\n						\'value\'      => $product_option[\'value\'],\n						//BOF Related Options\n						\'master_option\'			=> $product_option[\'master_option\'],\n						\'master_option_data\'		=> $master_option_data,\n						\'master_option_value\'		=> isset($product_option[\'master_option_value\']) ? $product_option[\'master_option_value\'] : 0,\n						//EOF Related Options\n						\'required\'          => $product_option[\'required\']\n					);\n				}\n			}\n			//EOF Related Options\n			$data[\'option_values\'] = array();\n\n			foreach ($data[\'product_options\'] as $product_option) {\n				if ($product_option[\'type\'] == \'select\' || $product_option[\'type\'] == \'radio\' || $product_option[\'type\'] == \'checkbox\' || $product_option[\'type\'] == \'image\') {\n					if (!isset($data[\'option_values\'][$product_option[\'option_id\']])) {\n						$data[\'option_values\'][$product_option[\'option_id\']] = $this->model_catalog_option->getOptionValues($product_option[\'option_id\']);\n					}\n				}\n			}\n\n			//BOF Related Options\n			//usort($data[\'product_options\'], function($a, $b) {\n			//	return $a[\'product_option_id\'] - $b[\'product_option_id\'];\n			//});\n			//EOF Related Options\n\n			$html = $this->load->view(\'extension/module/product_option\', $data);\n\n			// \"Minimizing\" server response size\n			$html = preg_replace(\'/[\\t ]{2,}/\', \' \', $html);\n			\n			$json[\'html\'] = $html;\n		} else {\n			if (!$json) {\n				$json[\'error\'] = $this->language->get(\'error_save_product\');\n			}\n		}\n\n		$this->response->addHeader(\'Content-Type: application/json\');\n		$this->response->setOutput(json_encode($json, JSON_UNESCAPED_UNICODE));\n	}\n	//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/model/catalog/product.php\">\n\n		<!-- getProductOptions() [Sort product options by oc_option.sort_order and oc_product_option.product_option_id] -->\n		<operation error=\"skip\">\n			<search><![CDATA[od.language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\'\"]]></search>\n			<add position=\"replace\"><![CDATA[od.language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\' ORDER BY o.sort_order ASC, po.product_option_id ASC\"]]></add>\n		</operation>\n\n		<!-- getProductOptions() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$product_option_value_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"product_option_value pov LEFT JOIN \" . DB_PREFIX . \"option_value ov ON(pov.option_value_id = ov.option_value_id) WHERE pov.product_option_id = \'\" . (int)$product_option[\'product_option_id\'] . \"\' ORDER BY ov.sort_order ASC\");]]></search>\n			<add position=\"replace\"><![CDATA[\n			//BOF Related Options\n			$product_option_value_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"product_option_value pov LEFT JOIN \" . DB_PREFIX . \"option_value ov ON(pov.option_value_id = ov.option_value_id) WHERE pov.product_option_id = \'\" . (int)$product_option[\'product_option_id\'] . \"\' ORDER BY pov.product_option_value_id ASC\");\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- addProduct(), editProduct() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$product_option_id = $this->db->getLastId();]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option SET master_option = \'\" . (int)$product_option[\'master_option\'] . \"\' WHERE product_option_id = \'\" . $product_option_id . \"\'\");\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- addProduct(), editProduct()  -->\n		<operation error=\"skip\">\n			<search><![CDATA[value = \'\" . $this->db->escape($product_option[\'value\']) . \"\', required = \'\" . (int)$product_option[\'required\'] . \"\'\");]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$product_option_id = $this->db->getLastId();\n\n			$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option SET master_option = \'\" . (int)$product_option[\'master_option\'] . \"\', master_option_value = \'\" . (int)$product_option[\'master_option_value\'] . \"\' WHERE product_option_id = \'\" . $this->db->getLastId() . \"\'\");\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- addProduct() [Like editProduct() + product copying fix] -->\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[\"\', weight_prefix = \'\" . $this->db->escape($product_option_value[\'weight_prefix\']) . \"\'\");]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$product_option_value_id = $this->db->getLastId();\n\n			if ((int)$product_option[\'master_option\']) {\n				$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET master_option_value = \'\" . (int)$product_option_value[\'master_option_value\'] . \"\' WHERE product_option_value_id = \'\" . $product_option_value_id . \"\'\");\n			}\n\n			if ($product_option_value[\'option_image\'] != \"\") {\n				$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET option_image = \'\" . $this->db->escape($product_option_value[\'option_image\']) . \"\' WHERE product_option_value_id = \'\" . $product_option_value_id . \"\'\");\n			}\n\n			// If copying products\n			if ($product_option_value[\'product_option_value_id\']) {\n				$old_id = $product_option_value[\'product_option_value_id\'];\n				$matching_table[$old_id][\'new_id\'] = $product_option_value_id;\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- editProduct() -->\n		<operation error=\"skip\">\n			<search index=\"1\"><![CDATA[\"\', weight_prefix = \'\" . $this->db->escape($product_option_value[\'weight_prefix\']) . \"\'\");]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$product_option_value_id = $this->db->getLastId();\n\n			if ((int)$product_option[\'master_option\']) {\n				$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET master_option_value = \'\" . (int)$product_option_value[\'master_option_value\'] . \"\' WHERE product_option_value_id = \'\" . $product_option_value_id . \"\'\");\n			}\n\n			if ($product_option_value[\'option_image\'] != \"\") {\n				$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET option_image = \'\" . $this->db->escape($product_option_value[\'option_image\']) . \"\' WHERE product_option_value_id = \'\" . $product_option_value_id . \"\'\");\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- addProduct() -->\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[if (isset($data[\'product_recurring\'])) {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			//The solution to the problem of copying products:\n			//value of the \"master_option_value\" field must be updated by writing new identifiers\n			if (isset($matching_table)) {\n\n				//Update oc_product_option table\n				$query = $this->db->query(\"SELECT product_option_id, master_option_value FROM \" . DB_PREFIX . \"product_option WHERE product_id = \'\" . (int)$product_id . \"\' AND master_option_value != \'0\' ORDER BY product_option_id ASC\");\n\n				if ($query->num_rows) {\n					foreach ($query->rows as $result) {\n						$old_id = $result[\'master_option_value\'];\n						$new_id = $matching_table[$old_id][\'new_id\'];\n\n						$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option SET master_option_value = \'\" . (int)$new_id . \"\' WHERE product_option_id = \'\" . (int)$result[\'product_option_id\'] . \"\'\");\n					}\n				}\n\n				//Update oc_product_option_value table\n				$query = $this->db->query(\"SELECT product_option_value_id, master_option_value FROM \" . DB_PREFIX . \"product_option_value WHERE product_id = \'\" . (int)$product_id . \"\' AND master_option_value != \'0\' ORDER BY product_option_value_id ASC\");\n\n				if ($query->num_rows) {\n					foreach ($query->rows as $result) {\n						$old_id = $result[\'master_option_value\'];\n						$new_id = $matching_table[$old_id][\'new_id\'];\n\n						$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET master_option_value = \'\" . (int)$new_id . \"\' WHERE product_option_value_id = \'\" . (int)$result[\'product_option_value_id\'] . \"\'\");\n					}\n				}\n\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getProductOptions() -->\n		<operation error=\"skip\">\n			<search><![CDATA[=> $product_option[\'required\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option\'             => $product_option[\'master_option\'],\n			\'master_option_value\'       => $product_option[\'master_option_value\'],\n			\'master_option_data\'        => $this->getProductOption($product_id, $product_option[\'master_option\']),\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getProductOptions() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'weight_prefix\'           => $product_option_value[\'weight_prefix\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option_value\'             => $product_option_value[\'master_option_value\'],\n			\'option_image\'                           => $product_option_value[\'option_image\'],\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<operation error=\"skip\">\n			<search><![CDATA[public function getProductImages($product_id)]]></search>\n			<add position=\"before\" offset=\"1\"><![CDATA[\n			//BOF Related Options\n	public function getProductOption($product_id, $option_id) {\n		$product_option_data = array();\n\n		$product_option_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"product_option po LEFT JOIN `\" . DB_PREFIX . \"option` o ON (po.option_id = o.option_id) LEFT JOIN \" . DB_PREFIX . \"option_description od ON (o.option_id = od.option_id) WHERE po.product_id = \'\" . (int)$product_id . \"\' AND od.language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\' AND po.option_id = \'\" . (int)$option_id . \"\' ORDER BY o.sort_order\");\n\n		$product_option = $product_option_query->row;\n		if ($product_option) {\n			if ($product_option[\'type\'] == \'select\' || $product_option[\'type\'] == \'radio\' || $product_option[\'type\'] == \'checkbox\' || $product_option[\'type\'] == \'image\') {\n				$product_option_value_data = array();\n\n				$product_option_value_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"product_option_value pov LEFT JOIN \" . DB_PREFIX . \"option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN \" . DB_PREFIX . \"option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_option_id = \'\" . (int)$product_option[\'product_option_id\'] . \"\' AND ovd.language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\' ORDER BY ov.sort_order\");\n\n				foreach ($product_option_value_query->rows as $product_option_value) {\n					$parent_name = \'\';\n					if ($product_option_value[\'master_option_value\'] > 0) {\n						$master_value_query = $this->db->query(\"SELECT ovd.name FROM \" . DB_PREFIX . \"option_value_description ovd LEFT JOIN \" . DB_PREFIX . \"product_option_value pov ON (ovd.option_value_id = pov.option_value_id) WHERE pov.product_option_value_id = \'\" . (int)$product_option_value[\'master_option_value\'] . \"\' AND language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\'\");\n						$parent_name = \' (\'.$master_value_query->row[\'name\'].\')\';\n					}\n					$product_option_value_data[] = array(\n						\'product_option_value_id\' => $product_option_value[\'product_option_value_id\'],\n						\'option_value_id\'         => $product_option_value[\'option_value_id\'],\n						\'name\'                    => $product_option_value[\'name\'] . $parent_name,\n						\'image\'                   => $product_option_value[\'image\'],\n						\'quantity\'                => $product_option_value[\'quantity\'],\n						\'subtract\'                => $product_option_value[\'subtract\'],\n						\'price\'                   => $product_option_value[\'price\'],\n						\'price_prefix\'            => $product_option_value[\'price_prefix\'],\n						\'points\'                  => $product_option_value[\'points\'],\n						\'points_prefix\'           => $product_option_value[\'points_prefix\'],\n						\'weight\'                  => $product_option_value[\'weight\'],\n						\'weight_prefix\'           => $product_option_value[\'weight_prefix\']\n					);\n				}\n\n				$product_option_data = array(\n					\'product_option_id\'    => $product_option[\'product_option_id\'],\n					\'option_id\'            => $product_option[\'option_id\'],\n					\'name\'                 => $product_option[\'name\'],\n					\'type\'                 => $product_option[\'type\'],\n					\'product_option_value\' => $product_option_value_data,\n					\'required\'             => $product_option[\'required\']\n				);\n			} else {\n				$product_option_data = array(\n					\'product_option_id\' => $product_option[\'product_option_id\'],\n					\'option_id\'         => $product_option[\'option_id\'],\n					\'name\'              => $product_option[\'name\'],\n					\'type\'              => $product_option[\'type\'],\n					\'option_value\'      => $product_option[\'value\'],\n					\'required\'          => $product_option[\'required\']\n				);\n			}\n		}\n\n		return $product_option_data;\n	}\n 			//EOF Related Options\n\n			//BOF Related Options\n	public function editProductOptions($product_id, $data) {\n\n		$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"product_option WHERE product_id = \'\" . (int)$product_id . \"\'\");\n		$this->db->query(\"DELETE FROM \" . DB_PREFIX . \"product_option_value WHERE product_id = \'\" . (int)$product_id . \"\'\");\n\n		if (isset($data[\'product_option\'])) {\n			foreach ($data[\'product_option\'] as $product_option) {\n				if ($product_option[\'type\'] == \'select\' || $product_option[\'type\'] == \'radio\' || $product_option[\'type\'] == \'checkbox\' || $product_option[\'type\'] == \'image\') {\n					if (isset($product_option[\'product_option_value\'])) {\n						$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_option SET product_option_id = \'\" . (int)$product_option[\'product_option_id\'] . \"\', product_id = \'\" . (int)$product_id . \"\', option_id = \'\" . (int)$product_option[\'option_id\'] . \"\', required = \'\" . (int)$product_option[\'required\'] . \"\'\");\n\n						$product_option_id = $this->db->getLastId();\n\n						//BOF Related Options\n						$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option SET master_option = \'\" . (int)$product_option[\'master_option\'] . \"\' WHERE product_option_id = \'\" . $product_option_id . \"\'\");\n						//EOF Related Options\n\n						foreach ($product_option[\'product_option_value\'] as $product_option_value) {\n							$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_option_value SET product_option_value_id = \'\" . (int)$product_option_value[\'product_option_value_id\'] . \"\', product_option_id = \'\" . (int)$product_option_id . \"\', product_id = \'\" . (int)$product_id . \"\', option_id = \'\" . (int)$product_option[\'option_id\'] . \"\', option_value_id = \'\" . (int)$product_option_value[\'option_value_id\'] . \"\', quantity = \'\" . (int)$product_option_value[\'quantity\'] . \"\', subtract = \'\" . (int)$product_option_value[\'subtract\'] . \"\', price = \'\" . (float)$product_option_value[\'price\'] . \"\', price_prefix = \'\" . $this->db->escape($product_option_value[\'price_prefix\']) . \"\', points = \'\" . (int)$product_option_value[\'points\'] . \"\', points_prefix = \'\" . $this->db->escape($product_option_value[\'points_prefix\']) . \"\', weight = \'\" . (float)$product_option_value[\'weight\'] . \"\', weight_prefix = \'\" . $this->db->escape($product_option_value[\'weight_prefix\']) . \"\'\");\n\n							//BOF Related Options\n							$product_option_value_id = $this->db->getLastId();\n\n							if ((int)$product_option[\'master_option\']) {\n								$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET master_option_value = \'\" . (int)$product_option_value[\'master_option_value\'] . \"\' WHERE product_option_value_id = \'\" . $product_option_value_id . \"\'\");\n							}\n\n							if ($product_option_value[\'option_image\'] != \"\") {\n								$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET option_image = \'\" . $this->db->escape($product_option_value[\'option_image\']) . \"\' WHERE product_option_value_id = \'\" . $product_option_value_id . \"\'\");\n							}\n							//EOF Related Options\n						}\n					}\n				} else {\n					$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_option SET product_option_id = \'\" . (int)$product_option[\'product_option_id\'] . \"\', product_id = \'\" . (int)$product_id . \"\', option_id = \'\" . (int)$product_option[\'option_id\'] . \"\', value = \'\" . $this->db->escape($product_option[\'value\']) . \"\', required = \'\" . (int)$product_option[\'required\'] . \"\'\");\n\n					//BOF Related Options\n					$product_option_id = $this->db->getLastId();\n					$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option SET master_option = \'\" . (int)$product_option[\'master_option\'] . \"\', master_option_value = \'\" . (int)$product_option[\'master_option_value\'] . \"\' WHERE product_option_id = \'\" . $this->db->getLastId() . \"\'\");\n					//EOF Related Options\n				}\n			}\n		}\n	}\n			//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n	\n	<file path=\"admin/view/template/catalog/product_form.twig\">\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'text\' %}]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n                    <div class=\"form-group\">\n                        <label class=\"col-sm-2 control-label\"> {{ entry_master_option }}</label>\n                        <div class=\"col-sm-10\">\n                            <select name=\"product_option[{{ option_row }}][master_option]\" class=\"form-control\">\n                                <option value=\"0\">{{ text_no }}</option>\n                                {% for product_option1 in product_options %}\n                                    {% if product_option1.type != \'select\' and product_option1.type != \'radio\' and product_option1.type != \'checkbox\' and product_option1.type != \'image\' %}\n                                    {% else %}\n                                    {% if product_option1.option_id != product_option.option_id %}\n                                        {% if product_option1.option_id  == product_option.master_option %}\n                                            <option value=\"{{ product_option1.option_id }}\" selected=\"selected\">{{ product_option1.name }}</option>\n                                        {% else %}\n                                            <option value=\"{{ product_option1.option_id }}\">{{ product_option1.name }}</option>\n                                        {% endif %}\n                                    {% endif %}\n                                    {% endif %}\n                                {% endfor %}\n                            </select>\n                        </div>\n                    </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'text\' %}]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                        <div class=\"form-group\">\n                            <label class=\"col-sm-2 control-label\">{{ entry_master_option_value }}</label>\n                            <div class=\"col-sm-10 col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"0\">\n                                {% if product_option.master_option %}\n                                <select name=\"product_option[{{ option_row }}][master_option_value]\" value=\"{{ product_option.value }}\" class=\"form-control\">\n                                    <option value=\"0\">{{ text_no }}</option>\n                                    {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                      {% if master_option_value.product_option_value_id == product_option.master_option_value %}\n                                          <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                      {% else %}\n                                          <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                      {% endif %}\n                                    {% endfor %}\n                                </select>\n                                {% else %}\n                                - <input type=\"hidden\" name=\"product_option[{{ option_row }}][master_option_value]\" value=\"0\">\n                                {% endif %}\n                            </div>\n                        </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'textarea\' %}]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                        <div class=\"form-group\">\n                            <label class=\"col-sm-2 control-label\">{{ entry_master_option_value }}</label>\n                            <div class=\"col-sm-10 col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"0\">\n                                {% if product_option.master_option %}\n                                <select name=\"product_option[{{ option_row }}][master_option_value]\" value=\"{{ product_option.option_value }}\" class=\"form-control\">\n                                    <option value=\"0\">{{ text_no }}</option>\n                                    {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                    {% if master_option_value.product_option_value_id == product_option.master_option_value %}\n                                    <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                    {% else %}\n                                    <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                    {% endif %}\n                                    {% endfor %}\n                                </select>\n                                {% else %}\n                                - <input type=\"hidden\" name=\"product_option[{{ option_row }}][master_option_value]\" value=\"0\">\n                                {% endif %}\n                            </div>\n                        </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'file\' %}]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                        <div class=\"form-group\">\n                            <label class=\"col-sm-2 control-label\">{{ entry_master_option_value }}</label>\n                            <div class=\"col-sm-10 col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"0\">\n                                {% if product_option.master_option %}\n                                    <select name=\"product_option[{{ option_row }}][master_option_value]\" value=\"{{ product_option.option_value }}\" class=\"form-control\">\n                                        <option value=\"0\">{{ text_no }}</option>\n                                        {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                            {% if master_option_value.product_option_value_id == product_option.master_option_value %}\n                                                <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                            {% else %}\n                                                <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                            {% endif %}\n                                        {% endfor %}\n                                    </select>\n                                {% else %}\n                                    - <input type=\"hidden\" name=\"product_option[{{ option_row }}][master_option_value]\" value=\"0\">\n                                {% endif %}\n                            </div>\n                        </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'date\' %}]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                      <div class=\"form-group\">\n                          <label class=\"col-sm-2 control-label\">{{ entry_master_option_value }}</label>\n                          <div class=\"col-sm-10 col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"0\">\n                              {% if product_option.master_option %}\n                              <select name=\"product_option[{{ option_row }}][master_option_value]\" value=\"{{ product_option.option_value }}\" class=\"form-control\">\n                                  <option value=\"0\">{{ text_no }}</option>\n                                  {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                  {% if master_option_value.product_option_value_id == product_option.master_option_value %}\n                                  <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                  {% else %}\n                                  <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                  {% endif %}\n                                  {% endfor %}\n                              </select>\n                              {% else %}\n                              - <input type=\"hidden\" name=\"product_option[{{ option_row }}][master_option_value]\" value=\"0\">\n                              {% endif %}\n                          </div>\n                      </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'time\' %}]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                      <div class=\"form-group\">\n                          <label class=\"col-sm-2 control-label\">{{ entry_master_option_value }}</label>\n                          <div class=\"col-sm-10 col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"0\">\n                              {% if product_option.master_option %}\n                              <select name=\"product_option[{{ option_row }}][master_option_value]\" value=\"{{ product_option.option_value }}\" class=\"form-control\">\n                                  <option value=\"0\">{{ text_no }}</option>\n                                  {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                  {% if master_option_value.product_option_value_id == product_option.master_option_value %}\n                                  <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                  {% else %}\n                                  <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                  {% endif %}\n                                  {% endfor %}\n                              </select>\n                              {% else %}\n                              - <input type=\"hidden\" name=\"product_option[{{ option_row }}][master_option_value]\" value=\"0\">\n                              {% endif %}\n                          </div>\n                      </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option.type == \'datetime\' %}]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                      <div class=\"form-group\">\n                          <label class=\"col-sm-2 control-label\">{{ entry_master_option_value }}</label>\n                          <div class=\"col-sm-10 col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"0\">\n                              {% if product_option.master_option %}\n                              <select name=\"product_option[{{ option_row }}][master_option_value]\" value=\"{{ product_option.option_value }}\" class=\"form-control\">\n                                  <option value=\"0\">{{ text_no }}</option>\n                                  {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                  {% if master_option_value.product_option_value_id == product_option.master_option_value %}\n                                  <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                  {% else %}\n                                  <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                  {% endif %}\n                                  {% endfor %}\n                              </select>\n                              {% else %}\n                              - <input type=\"hidden\" name=\"product_option[{{ option_row }}][master_option_value]\" value=\"0\">\n                              {% endif %}\n                          </div>\n                      </div>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[<td class=\"text-right\">{{ entry_weight }}</td>]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                              <td class=\"text-center\">{{ entry_image }}</td>\n                              <td class=\"text-left\">{{ entry_master_option_value }}</td>\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search index=\"0\"><![CDATA[<td colspan=\"6\"></td>]]></search>\n			<add position=\"replace\"><![CDATA[<td colspan=\"8\"></td>]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[html += \'        <td colspan=\"6\"></td>\';]]></search>\n			<add position=\"replace\"><![CDATA[html += \'        <td colspan=\"8\"></td>\';]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<!-- Regular expression for compatibility with Opencart versions <=3.0.3.1 and >=3.0.3.2 -->\n			<search regex=\"true\"><![CDATA[~(<input type=\"text\" name=\"product_option\\[{{ option_row }}]\\[product_option_value]\\[{{ option_value_row }}]\\[weight]\" value=\"{{ product_option_value\\.weight }}\" placeholder=\"{{ entry_weight }}\" class=\"form-control\" ?\\/><\\/td>)~]]></search>\n			<add position=\"after\"><![CDATA[\n			$1\n			<!--BOF Related Options-->\n                          <td class=\"text-center\">\n                              <a href=\"\" id=\"product-option-image-thumb{{ option_value_row }}\" data-toggle=\"image\" class=\"img-thumbnail\"><img src=\"{{ product_option_value.option_thumb }}\" alt=\"\" title=\"\" data-placeholder=\"{{ placeholder }}\" /></a>\n                              <input type=\"hidden\" name=\"product_option[{{ option_row }}][product_option_value][{{ option_value_row }}][option_image]\" value=\"{{ product_option_value.option_image }}\" id=\"product-option-image-input{{ option_value_row }}\" />\n                          </td>\n                          <td class=\"text-left col-master-{{ option_row }}\" data-col=\"{{ option_row }}\" data-row=\"{{ option_value_row }}\">\n                              {% if product_option.master_option %}\n                                <select name=\"product_option[{{ option_row }}][product_option_value][{{ option_value_row }}][master_option_value]\" class=\"form-control\">\n                                    <option value=\"0\">{{ text_no }}</option>\n                                    {% for master_option_value in product_option.master_option_data.product_option_value %}\n                                    {% if master_option_value.product_option_value_id == product_option_value.master_option_value %}\n                                    <option value=\"{{ master_option_value.product_option_value_id }}\" selected=\"selected\">{{ master_option_value.name }}</option>\n                                    {% else %}\n                                    <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                                    {% endif %}\n                                    {% endfor %}\n                                </select>\n                              {% else %}\n                          <center>-</center>\n                          <input type=\"hidden\" name=\"product_option[{{ option_row }}][product_option_value][{{ option_value_row }}][master_option_value]\" value=\"0\">\n                          {% endif %}\n                          </td>\n\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<select id=\"option-values{{ option_row }}\" style=\"display: none;\">]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n                        {% if product_option.master_option %}\n                        <select id=\"master-option-values{{ option_row }}\" style=\"display: none;\" class=\"form-control\">\n                            {% for master_option_value in product_option.master_option_data.product_option_value %}\n                            <option value=\"{{ master_option_value.product_option_value_id }}\">{{ master_option_value.name }}</option>\n                            {% endfor %}\n                        </select>\n                        {% endif %}\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[if (item[\'type\'] == \'text\') {]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n                html += \'	  <div class=\"form-group\">\';\n                html += \'         <label class=\"col-sm-2 control-label\">{{ entry_master_option }}</label>\';\n                html += \'       <div class=\"col-sm-10\"><select name=\"product_option[\' + option_row + \'][master_option]\" class=\"form-control\">\';\n                html += \'	    <option value=\"0\">{{ text_no }}</option>\';\n                \n                $(\'input[name$=\"[option_id]\"]\').each(function() {\n                var name = $(this).attr(\'name\').split(\'][\');\n                var num = name[0].split(\'[\');\n                num = num[1];\n                html += \'<option value=\"\'+ $(this).val() +\'\">\'+ $(\'input[name=\"product_option[\' + num + \'][name]\"]\').val() +\'</option>\';\n                });\n                html += \' </select></div>\';\n                html += \' </div>\';\n\n                if (item[\'type\'] != \'select\' && item[\'type\'] != \'radio\' && item[\'type\'] != \'checkbox\' && item[\'type\'] != \'image\') {\n                html += \'	<div class=\"form-group\">\';\n                html += \'	  <label class=\"col-sm-2 control-label\" for=\"input-value\' + option_row + \'\">{{ entry_master_option_value }}</label>\';\n                html += \'	  <div class=\"col-sm-10 col-master-\' + option_row +\'\" data-col=\"\' + option_row +\'\" data-row=\"0\">- <input type=\"hidden\" name=\"product_option[\' + option_row + \'][master_option_value]\" value=\"0\"></div>\';\n                html += \'	</div>\';\n                }\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[html += \'        <td class=\"text-right\">{{ entry_weight }}</td>\';]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n                        html += \'        <td class=\"text-center\">{{ entry_image }}</td>\';\n                        html += \'        <td class=\"text-left\">{{ entry_master_option_value }}</td>\';\n			<!--EOF Related Options-->\n			]]>\n			</add>\n		</operation>\n		<operation error=\"skip\">\n			<!-- Regular expression for compatibility with Opencart versions <=3.0.3.1 and >=3.0.3.2 -->\n			<search regex=\"true\"><![CDATA[~(html  ?= \'<div class=\"tab-pane\" id=\"tab-option\' \\+ option_row \\+ \'\">\';)~]]></search>\n			<add position=\"before\"><![CDATA[\n				if (item[\'type\'] == \'select\' || item[\'type\'] == \'radio\' || item[\'type\'] == \'checkbox\' || item[\'type\'] == \'image\') {\n					$(\'select[name$=\"[master_option]\"]\').append(\'<option value=\"\'+ item[\'value\'] +\'\">\'+ item[\'label\'] +\'</option>\');\n				}\n			$1\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[html += \'  <input type=\"text\" name=\"product_option[\' + option_row + \'][product_option_value][\' + option_value_row + \'][weight]\" value=\"\" placeholder=\"{{ entry_weight }}\" class=\"form-control\" /></td>\';]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n		html += \'  <td class=\"text-center\">\';\n		html += \'    <a href=\"\" id=\"product-option-image-thumb\' + option_value_row + \'\" data-toggle=\"image\" class=\"img-thumbnail\"><img src=\"{{ placeholder }}\" alt=\"\" title=\"\" data-placeholder=\"{{ placeholder }}\" /></a>\';\n		html += \'      <input type=\"hidden\" name=\"product_option[\' + option_row + \'][product_option_value][\' + option_value_row + \'][option_image]\" value=\"\" id=\"product-option-image-input\' + option_value_row + \'\" />\';\n		html += \'  </td>\';\n\n	if ($(\'#master-option-values\' + option_row).length > 0) {\n		html += \'    <td class=\"text-left col-master-\' + option_row +\'\" data-col=\"\' + option_row +\'\" data-row=\"\' + option_value_row +\'\"><select name=\"product_option[\' + option_row + \'][product_option_value][\' + option_value_row + \'][master_option_value]\" class=\"form-control\">\';\n		html += \'        <option value=\"0\">{{ text_no }}</option>\';\n		html += $(\'#master-option-values\' + option_row).html();\n		html += \'    </select></td>\';\n	} else {\n		html += \'<td class=\"text-left col-master-\' + option_row +\'\" data-col=\"\' + option_row +\'\" data-row=\"\' + option_value_row +\'\"><center>-</center><input type=\"hidden\" name=\"product_option[\' + option_row + \'][product_option_value][\' + option_value_row + \'][master_option_value]\" value=\"0\"></td>\';\n	}\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<li><a href=\"#tab-option{{ option_row }}\" data-toggle=\"tab\"><i class=\"fa fa-minus-circle\" onclick=\"$(\'a[href=\\\'#tab-option{{ option_row }}\\\']\').parent().remove(); $(\'#tab-option{{ option_row }}\').remove(); $(\'#option a:first\').tab(\'show\');\"></i> {{ product_option.name }}</a></li>]]></search>\n			<add position=\"replace\" trim=\"true\"><![CDATA[\n				<li><a href=\"#tab-option{{ option_row }}\" data-toggle=\"tab\"><i class=\"fa fa-minus-circle\" onclick=\"master_option_del({{option_row }}); $(\'a[href=\\\'#tab-option{{ option_row }}\\\']\').parent().remove(); $(\'#tab-option{{ option_row }}\').remove(); $(\'#option a:first\').tab(\'show\');\"></i> {{ product_option.name }}</a></li>\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[onclick=\"$(this).tooltip(\'destroy\');$(\'#option-value-row{{ option_value_row }}\').remove();\"]]></search>\n			<add position=\"replace\" trim=\"true\"><![CDATA[\n				onclick=\"$(this).tooltip(\'destroy\');$(\'#option-value-row{{ option_value_row }}\').remove(); master_option_ch({{ option_row }});\"\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[onclick=\" $(\\\'#option a:first\\\').tab(\\\'show\\\');$(\\\'a[href=\\\\\\\'#tab-option\' + option_row + \'\\\\\\\']\\\').parent().remove(); $(\\\'#tab-option\' + option_row + \'\\\').remove();\"]]></search>\n			<add position=\"replace\" trim=\"true\"><![CDATA[\n				onclick=\"master_option_del(\' + option_row + \'); $(\\\'#option a:first\\\').tab(\\\'show\\\');$(\\\'a[href=\\\\\\\'#tab-option\' + option_row + \'\\\\\\\']\\\').parent().remove(); $(\\\'#tab-option\' + option_row + \'\\\').remove();\"\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[onclick=\"$(this).tooltip(\\\'destroy\\\');$(\\\'#option-value-row\' + option_value_row + \'\\\').remove();\"]]></search>\n			<add position=\"replace\" trim=\"true\"><![CDATA[\n				onclick=\"$(this).tooltip(\\\'destroy\\\');$(\\\'#option-value-row\' + option_value_row + \'\\\').remove(); master_option_ch(\'+option_row+\');\"\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[$(\'[rel=tooltip]\').tooltip();]]></search>\n			<add position=\"after\"><![CDATA[\n				master_option(option_row, option_value_row);\n				master_option_ch(option_row);\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<link href=\"view/javascript/codemirror/lib/codemirror.css\"]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n				<style type=\"text/css\">\n					.rdo_popover_images a {\n						margin-top: 2px;\n						margin-right: 2px;\n					}\n					.rdo_popover_images img {\n						height: 40px;\n						width: 40px;\n					}\n				</style>\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n\n		<operation error=\"skip\">\n			<search><![CDATA[var option_value_row = {{ option_value_row }};]]></search>\n			<add position=\"before\"><![CDATA[\n\n			//START RDO BASIC FUNCTIONS\n\n			$(document).ready(function() {\n				$(\'#form-product\').on(\'change\', \'select[name$=\"[master_option]\"]\', function() {\n					var type_name = $(this).parent().parent().parent().children(\'input[type=hidden]:last\').attr(\'value\');\n					var name_parent = $(this).attr(\'name\').split(\'][\');\n					var num_parent = name_parent[0].split(\'[\');\n					var val_parent = $(\'#option-value\'+num_parent[1]).find(\'select:first\').val();\n					if (val_parent > 0){\n						updateProductOptions();\n					}\n					if (type_name != \'select\' && type_name != \'radio\' && type_name != \'checkbox\' && type_name != \'image\') {\n						updateProductOptions();\n					}\n				});\n\n				//$(\'#form-product\').on(\'change\', \'select[name$=\"[option_value_id]\"]\', function() {\n				   /// var name = $(this).attr(\'name\').split(\'][\');\n				   /// var num = name[0].split(\'[\');\n				   /// master_option_ch(num[1]);\n				   // updateProductOptions();\n				//});\n			});\n\n				function master_option(option_num, row, selected) {\n					var id = $(\'select[name=\"product_option[\'+ option_num  +\'][master_option]\"]\').val();\n					var type = $(\'input[name=\"product_option[\'+ option_num  +\'][type]\"]\').val();\n\n					if (id == 0) {\n						$(\'.col-master-\' + option_num).each(function() {\n							if (typeof(row) == \'undefined\' || row == $(this).data(\'row\')) {\n								if (type == \'select\' || type == \'radio\' || type == \'checkbox\' || type == \'image\') {\n									$(this).html(\'<center>-</center><input type=\"hidden\" name=\"product_option[\' + $(this).data(\'col\') + \'][product_option_value][\' + $(this).data(\'row\') + \'][master_option_value]\" value=\"0\">\');\n								} else {\n									$(this).html(\'- <input type=\"hidden\" name=\"product_option[\' + $(this).data(\'col\') + \'][master_option_value]\" value=\"0\">\');\n								}\n							}\n						});\n					} else {\n						\n					}\n				}\n\n				function master_option_ch(option_row) {\n					var option_id = $(\'input[name=\"product_option[\'+ option_row +\'][option_id]\"]\').val();\n					$(\'select[name$=\"[master_option]\"]\').each(function() {\n						if ($(this).val() == option_id) {\n							var name_1 = $(this).attr(\'name\').split(\'][\');\n							var num_1 = name_1[0].split(\'[\');\n\n							$(\'.col-master-\' + num_1[1]).each(function() {\n								master_option($(this).data(\'col\'), $(this).data(\'row\'), $(this).find(\'select\').val());\n							});\n						}\n					});\n				}\n\n				function master_option_del(option_row) {\n					var option_id = $(\'input[name=\"product_option[\'+ option_row +\'][option_id]\"]\').val();\n					$(\'select[name$=\"[master_option]\"]\').each(function() {\n						if ($(this).val() == option_id) {\n							$(this).val(0);\n							var name_1 = $(this).attr(\'name\').split(\'][\');\n							var num_1 = name_1[0].split(\'[\');\n							$(\'.col-master-\' + num_1[1]).each(function() {\n								master_option($(this).data(\'col\'));\n							});\n						}\n						$(this).find(\'option[value=\'+ option_id +\']\').remove();\n					});\n				}\n\n				function updateProductOptions() {\n					var data = {};\n					$(\'#form-product\').find(\'input, select, textarea\').each(function() {\n						data[this.name] = $(this).val();\n					});\n					data[\'product_id\'] = \'{{ product_id }}\';\n					data[\'active\'] = $(\'#option li.active > a:last\').attr(\'href\');\n\n					if(!data[\'active\'].length){\n						console.log(\'Active product option tab not found\');\n					}\n\n					if(data[\'product_id\'] == 0){\n						alert(\'{{error_save_product}}\');\n						return false;\n					}\n					//console.log(data[\'product_id\']);\n\n					$.ajax({\n						url: \'index.php?route=catalog/product/updaterelations&user_token={{ user_token }}\',\n						method: \'POST\',\n						data: data,\n						dataType: \"json\",\n						cache: false,\n						beforeSend: function() {\n							$(\'.tab-pane.active\').css(\'opacity\', \'0.6\');\n						},\n						success: function(json) {\n							if (!json) {\n								console.log(\'updateProductOptions() error\');\n							}\n							if (json[\'error\']) {\n								alert(json[\'error\']);\n							}\n							if (json[\'html\']) {\n								$(\'#tab-option\').html(json[\'html\']);\n							}\n						},\n						complete: function() {\n							$(\'.tab-pane.active\').css(\'opacity\', \'1\');\n						},\n						error: function(xhr, ajaxOptions, thrownError) {\n							alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);\n						}\n					});\n				}\n\n			//END RDO BASIC FUNCTIONS\n\n			//START RDO OPTION IMAGE CHANGE FUNCTIONS\n\n			$(document).ready(function() {\n\n				// Show additional images in a popover\n				$(document).on(\'click\', \'a[data-toggle=\\\'image\\\'][id ^= \"product-option-image-thumb\"]\', function() {\n					var $element = $(this);\n\n					// Get additional images\n					var $productImages = $(\'.previewImg\'),\n					     popoverImages = \"\";\n\n					if (!$productImages.length) {\n						console.log(\"RDO: Additional images not found\");\n						return false;\n					}\n\n					$productImages.each(function(index, element) {\n						thumbSrc = $(element).children(\'img\').attr(\'src\');\n						imageSrc = $(element).siblings(\'input[type=hidden]\').val();\n\n						popoverImages += \"<a href=\'\' class=\'img-thumbnail\'><img src=\'\" + thumbSrc + \"\' alt=\'\' data-original-image=\'\" + imageSrc + \"\'></a>\";\n					});\n\n					// Get popover\n					var $popoverContent = $(this).siblings(\'.popover\').find(\'.popover-content\');\n\n					if (!$popoverContent.length) {\n						console.log(\"RDO: Popover not found\");\n						return false;\n					}\n\n					// Add additional images block to popover\n					if (!$popoverContent.find(\'.rdo_popover_images\').length) {\n						$popoverContent.append(\'<div class=\"rdo_popover_images\"></div>\');\n					}\n\n					// Add additional images to popover\n					$popoverContent.find(\'.rdo_popover_images\').html(popoverImages);\n\n					// Change image\n					$(\'.rdo_popover_images a\').on(\'click\', function(e) {\n						e.preventDefault();\n\n						$element.find(\'img\').attr(\'src\', $(this).find(\'img\').attr(\'src\'));\n						$element.parent().find(\'input[type=hidden]\').val($(this).find(\'img\').attr(\'data-original-image\'));\n						$element.popover(\'destroy\');\n					});\n				});\n			});\n\n			//END RDO OPTION IMAGE CHANGE FUNCTIONS\n\n			]]></add>\n		</operation>\n\n		<operation error=\"skip\">\n			<search><![CDATA[option_value_row++;]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			//updateProductOptions();\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option_value.price_prefix == \'+\' %}]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n			{% if product_option_value.price_prefix == \'=\' %}\n				<option value=\"=\" selected=\"selected\">=</option>\n			{% else %}\n				<option value=\"=\">=</option>\n			{% endif %}\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option_value.points_prefix == \'+\' %}]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n			{% if product_option_value.points_prefix == \'=\' %}\n				<option value=\"=\" selected=\"selected\">=</option>\n			{% else %}\n				<option value=\"=\">=</option>\n			{% endif %}\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[{% if product_option_value.weight_prefix == \'+\' %}]]></search>\n			<add position=\"before\"><![CDATA[\n			<!--BOF Related Options-->\n			{% if product_option_value.weight_prefix == \'=\' %}\n				<option value=\"=\" selected=\"selected\">=</option>\n			{% else %}\n				<option value=\"=\">=</option>\n			{% endif %}\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[<option value=\"-\">-</option>\';]]></search>\n			<add position=\"after\"><![CDATA[\n			<!--BOF Related Options-->\n			html += \'    <option value=\"=\">=</option>\';\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"catalog/controller/product/product.php\">\n\n		<!-- index() -->\n		<operation error=\"skip\">\n			<search><![CDATA[foreach ($option[\'product_option_value\'] as $option_value) {]]></search>\n			<add position=\"after\"><![CDATA[\n					//BOF Related Options\n					if (isset($data[\'RDO_settings\'][\'show_out_of_stock\']) && $data[\'RDO_settings\'][\'show_out_of_stock\'] && $option_value[\'subtract\'] && ($option_value[\'quantity\'] <= 0)) {\n						$option_value[\'subtract\'] = false;\n					}\n					//EOF Related Options\n			]]></add>\n		</operation>\n		\n		<!-- index() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'required\'             => $option[\'required\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option\'          => $option[\'master_option\'],\n			\'master_option_value\'    => isset($option[\'master_option_value\']) ? $option[\'master_option_value\'] : null,\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- index() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$product_option_value_data[] = array(]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n						if ($option_value[\'option_image\']) {\n							// Maximum size\n							$option_image_popup = $this->model_tool_image->resize($option_value[\'option_image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_popup_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_popup_height\'));\n\n							// Preview size\n							$option_image_preview = $this->model_tool_image->resize($option_value[\'option_image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_thumb_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_thumb_height\'));\n\n							// Thumb size\n							//$option_image_additional_thumb = $this->model_tool_image->resize($option_value[\'option_image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_additional_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_additional_height\'));\n\n							// Standard option image size\n							//$option_image_thumb = $this->model_tool_image->resize($option_value[\'option_image\'], 50, 50);\n\n							$option_image_pathinfo[\'dn\']  = pathinfo($option_value[\'option_image\'], PATHINFO_DIRNAME);\n							$option_image_pathinfo[\'ds\']  = DIRECTORY_SEPARATOR;\n							$option_image_pathinfo[\'fn\']  = pathinfo($option_value[\'option_image\'], PATHINFO_FILENAME);\n							$option_image_pathinfo[\'ext\'] = pathinfo($option_value[\'option_image\'], PATHINFO_EXTENSION);\n\n							$product_option_value_images[$option_value[\'product_option_value_id\']] = array(\n								\'image_pathinfo\' => $option_image_pathinfo,\n								\'image\'          => $option_image_preview,\n								\'image_large\'    => $option_image_popup\n							);\n						}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- index() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'price_prefix\'            => $option_value[\'price_prefix\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'quantity\'     	          => $option_value[\'quantity\'],\n			\'master_option_value\'     => $option_value[\'master_option_value\'],\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- index() -->\n		<operation error=\"skip\">\n			<search><![CDATA[if ($product_info[\'minimum\']) {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			$json_flags = JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE;\n\n			$data[\'RDO_option_images\'] = isset($product_option_value_images) ? json_encode($product_option_value_images, $json_flags) : null;\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- index() -->\n		<!-- <search><![CDATA[$this->document->setTitle($product_info[\'meta_title\']]]></search> -->\n		<!-- <search><![CDATA[$this->document->addLink($this->url->link(\'product/product\',]]></search> -->\n		<!-- <search><![CDATA[$this->document->addStyle(\'catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css\');]]></search> -->\n		<!-- <search><![CDATA[$data[\'heading_title\'] = $product_info[\'name\']]]></search> -->\n		<operation error=\"skip\">\n			<search><![CDATA[$this->document->addStyle(\'catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css\');]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$data[\'RDO_settings\'] = $this->config->get(\'module_related_options_settings\');\n			$data[\'RDO_status\'] = $this->config->get(\'module_related_options_status\');\n			//EOF Related Options]]></add>\n		</operation>\n\n		<!-- index() -->\n		<operation error=\"skip\">\n			<search><![CDATA[$this->model_catalog_product->updateViewed($this->request->get[\'product_id\']);]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$json_flags = JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE;\n\n			$data[\'RDO_config\'] = json_encode(array(\n				\'price_animate_on\'    =>  (int)$data[\'RDO_settings\'][\'price_animate_on\'],\n				\'price_multiply\'      =>  (int)$data[\'RDO_settings\'][\'price_multiply\'],\n				\'option_selector\'     => isset($data[\'RDO_settings\'][\'option_selector\'])    ? html_entity_decode($data[\'RDO_settings\'][\'option_selector\'], ENT_QUOTES, \'UTF-8\')    : \'\',\n				\'price_selector\'      => isset($data[\'RDO_settings\'][\'price_selector\'])     ? html_entity_decode($data[\'RDO_settings\'][\'price_selector\'], ENT_QUOTES, \'UTF-8\')     : \'\',\n				\'price_old_selector\'  => isset($data[\'RDO_settings\'][\'price_old_selector\']) ? html_entity_decode($data[\'RDO_settings\'][\'price_old_selector\'], ENT_QUOTES, \'UTF-8\') : \'\',\n				\'quantity_selector\'   => isset($data[\'RDO_settings\'][\'quantity_selector\'])  ? html_entity_decode($data[\'RDO_settings\'][\'quantity_selector\'], ENT_QUOTES, \'UTF-8\')  : \'\'\n			), $json_flags);\n\n			$data[\'RDO_product_data\'] = json_encode(array(\n				\'model\'           => trim($data[\'model\']),\n				\'reward\'          => (int)$data[\'reward\'],\n				\'points\'          => (int)$data[\'points\'],\n				\'minimum\'         => (int)$data[\'minimum\'],\n				\'price\'           => $data[\'price\'], //$product_info[\'price\'],\n				\'special\'         => $data[\'special\'], //$product_info[\'special\'],\n				\'tax\'             => $data[\'tax\'], //(float)$product_info[\'special\'] ? $product_info[\'special\'] : $product_info[\'price\'],\n				\'decimal_point\'   => $this->language->get(\'decimal_point\'),\n				\'thousand_point\'  => $this->language->get(\'thousand_point\'),\n				\'symbol_left\'     => $this->currency->getSymbolLeft($this->session->data[\'currency\']),\n				\'symbol_right\'    => $this->currency->getSymbolRight($this->session->data[\'currency\']),\n				\'decimal_place\'   => (int)$this->currency->getDecimalPlace($this->session->data[\'currency\']),\n				\'discounts\'       => $data[\'discounts\']\n			), $json_flags);\n\n			$options_data = array();\n\n			foreach ($data[\'options\'] as $product_option) {\n				if (isset($product_option[\'product_option_value\']) && is_array($product_option[\'product_option_value\'])) {\n					foreach ($product_option[\'product_option_value\'] as $product_option_value) {\n						$id = $product_option_value[\'product_option_value_id\'];\n						$options_data[$id] = $product_option_value;\n					}\n				}\n			}\n\n			$json_flags = JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE;\n\n			$data[\'RDO_options_data\'] = json_encode($options_data, $json_flags);\n			//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"catalog/model/catalog/product.php\">\n\n		<!-- getProductOptions() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'weight_prefix\'           => $product_option_value[\'weight_prefix\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option_value\'             => $product_option_value[\'master_option_value\'],\n			\'option_image\'                    => $product_option_value[\'option_image\'],\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<operation error=\"skip\">\n			<search><![CDATA[\'image\'                   => $product_option_value[\'image\'],]]></search>\n			<add position=\"replace\"><![CDATA[\n			\'image\'                   => $product_option_value[\'option_image\'],\n			]]></add>\n		</operation>\n\n		<!-- getProductOptions() -->\n		<operation error=\"skip\">\n			<search><![CDATA[\'required\'             => $product_option[\'required\']]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'master_option\'          => $product_option[\'master_option\'],\n			\'master_option_value\'    => isset($product_option[\'master_option_value\']) ? $product_option[\'master_option_value\'] : null,\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n	</file>\n	\n	<file path=\"catalog/controller/checkout/cart.php\">\n		<operation error=\"skip\">\n			<search><![CDATA[if ($product_option[\'required\'] && empty($option[$product_option[\'product_option_id\']])) {]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			$error = true;\n\n			// если у текущей, незаполненной опции есть родительская опция\n			if ($product_option[\'master_option\'] > 0) {\n\n				// проверяем, возможно и не должна быть заполнена (например, если родительская опция не заполнена)\n				// проходим по всем опциям товара\n				foreach ($product_options as $product_option_parent) {\n\n					// если нашлась родительская опция\n					if ($product_option[\'master_option\'] == $product_option_parent[\'option_id\']) {\n\n						// проверяем, заполнена ли она\n						if (empty($option[ $product_option_parent[\'product_option_id\'] ])) {\n\n							// если родительская опция не заполнена - ошибки нет (текущая опция и не должна быть заполнена)\n							$error = false;\n							break;\n						}\n\n						// если родительская заполнена - проверяем, зависит ли хоть одно из значений незаполненной опции от выбранной родительской\n\n						// для опций с типом Radio / Checkbox / Select\n						if (!empty($product_option[\'product_option_value\'])) {\n\n							// проходим по незаполненной опции\n							foreach ($product_option[\'product_option_value\'] as $product_option_value) {\n								$error = false;\n\n								// тип опции - checkbox\n								// если значение незаполненной опции зависит от выбранных значений родительской - значит она обязательна к заполнению\n								if (is_array($option[ $product_option_parent[\'product_option_id\'] ]) && in_array($product_option_value[\'master_option_value\'], $option[ $product_option_parent[\'product_option_id\'] ])) {\n									$error = true;\n									break 2;\n								}\n\n								// тип опции - radio и select\n								// если значение незаполненной опции зависит от выбранного значения родительской - значит она обязательна к заполнению\n								if ($product_option_value[\'master_option_value\'] == $option[ $product_option_parent[\'product_option_id\'] ]) {\n									$error = true;\n									break 2;\n								}\n							}\n						} else {\n							// для опций с типом Text / Textarea / Button\n\n							// если опция не зависит от выбранного значения родительской - значит она не обязательна к заполнению (ошибки нет)\n							if ($product_option[\'master_option_value\'] != $option[ $product_option_parent[\'product_option_id\'] ]) {\n								$error = false;\n								break;\n							}\n						}\n					}\n				}\n			}\n\n			// ошибку заполненности для текущей опции отображать не требуется\n			if ($error === false) {\n				continue;\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- index() [Show option image in the cart] -->\n		<operation error=\"skip\">\n			<search><![CDATA[$value = $option[\'value\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			if(isset($option[\'option_image\']) && $option[\'option_image\'] != \"\") {\n				$image = $this->model_tool_image->resize($option[\'option_image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_height\'));\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"catalog/controller/common/cart.php\">\n\n		<!-- index() [Show option image in the cart] -->\n		<operation error=\"skip\">\n			<search><![CDATA[$value = $option[\'value\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			if(isset($option[\'option_image\']) && $option[\'option_image\'] != \"\") {\n				$image = $this->model_tool_image->resize($option[\'option_image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_height\'));\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"system/library/cart/cart.php\">\n\n		<!-- getProducts() -->\n		<operation error=\"skip\">\n			<search><![CDATA[po.option_id,]]></search>\n			<add position=\"replace\"><![CDATA[po.option_id, po.master_option, po.master_option_value,]]></add>\n		</operation>\n\n		<!-- getProducts() -->\n		<operation error=\"skip\">\n			<search><![CDATA[pov.weight_prefix]]></search>\n			<add position=\"replace\"><![CDATA[pov.weight_prefix, pov.master_option_value, pov.option_image, pov.option_model]]></add>\n		</operation>\n\n		<!-- getProducts() -->\n		<operation error=\"skip\">\n			<search index=\"0,1\"><![CDATA[\'name\'                    => $option_query->row[\'name\'],]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			\'option_image\'                => $option_value_query->row[\'option_image\'],\n			\'option_model\'                => $option_value_query->row[\'option_model\'],\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getProducts() [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[$option_price -= $option_value_query->row[\'price\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			} elseif ($option_value_query->row[\'price_prefix\'] == \'=\') {\n				$new_price = $option_value_query->row[\'price\'];\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getProducts() [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[$option_points -= $option_value_query->row[\'points\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			} elseif ($option_value_query->row[\'points_prefix\'] == \'=\') {\n				$new_points = $option_value_query->row[\'points\'];\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getProducts() [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[$option_weight -= $option_value_query->row[\'weight\'];]]></search>\n			<add position=\"after\"><![CDATA[\n			//BOF Related Options\n			} elseif ($option_value_query->row[\'weight_prefix\'] == \'=\') {\n				$new_weight = $option_value_query->row[\'weight\'];\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- getProducts() [Prefix \"=\" for product option values] -->\n		<operation error=\"skip\">\n			<search><![CDATA[$product_data[] = array(]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			$option_price  += (isset($new_price))  ? $new_price  - $price                        : 0;\n			$option_points += (isset($new_points)) ? $new_points - $product_query->row[\'points\'] : 0;\n			$option_weight += (isset($new_weight)) ? $new_weight - $product_query->row[\'weight\'] : 0;\n			//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n\n	<file path=\"catalog/view/theme/journal3/template/product/product.twig\">\n		<operation error=\"skip\">\n			<search><![CDATA[<div class=\"form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ \'OptionsPushSelect\') %}push-option{% endif %}\">]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<div class=\"rdo-option form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ \'OptionsPushSelect\') %}push-option{% endif %}\" master-option=\"{{ option.master_option }}\" option=\"{{ option.option_id }}\" id=\"option-{{ option.product_option_id }}\">\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<div class=\"form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ \'OptionsPushRadio\') %}push-option{% endif %}\">]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<div class=\"rdo-option form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ \'OptionsPushRadio\') %}push-option{% endif %}\" master-option=\"{{ option.master_option }}\" option=\"{{ option.option_id }}\" id=\"option-{{ option.product_option_id }}\">\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<div class=\"form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ \'OptionsPushCheckbox\') %}push-option{% endif %}\">]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<div class=\"rdo-option form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ \'OptionsPushCheckbox\') %}push-option{% endif %}\" master-option=\"{{ option.master_option }}\" option=\"{{ option.option_id }}\" id=\"option-{{ option.product_option_id }}\">\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<div class=\"form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}\">]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<div class=\"rdo-option form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}\" master-option=\"{{ option.master_option }}\" option=\"{{ option.option_id }}\" id=\"option-{{ option.product_option_id }}\">\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		\n\n		<operation error=\"skip\">\n			<search><![CDATA[<option value=\"{{ option_value.product_option_value_id }}\">{{ option_value.name }}]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<option value=\"{{ option_value.product_option_value_id }}\" master-option-value=\"{{ option_value.master_option_value }}\" option-value=\"{{option_value.product_option_value_id }}\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %}> {{ option_value.name }}\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<input type=\"radio\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option_value.product_option_value_id }}\" />]]></search>\n		<add position=\"replace\"><![CDATA[\n		<!--BOF Related Options-->\n			<input type=\"radio\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option_value.product_option_value_id }}\" id=\"option-value-{{ option_value.product_option_value_id }}\" master-option-value=\"{{ option_value.master_option_value }}\" option-value=\"{{option_value.product_option_value_id }}\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %} />\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<input type=\"checkbox\" name=\"option[{{ option.product_option_id }}][]\" value=\"{{ option_value.product_option_value_id }}\" />]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<input type=\"checkbox\" name=\"option[{{ option.product_option_id }}][]\" value=\"{{ option_value.product_option_value_id }}\" id=\"option-value-{{ option_value.product_option_value_id }}\" master-option-value=\"{{ option_value.master_option_value }}\" option-value=\"{{option_value.product_option_value_id }}\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %} />\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" placeholder=\"{{ option.name }}\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" />]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" placeholder=\"{{ option.name }}\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" master-option-value=\"{{ option.master_option_value }}\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %} />\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<textarea name=\"option[{{ option.product_option_id }}]\" rows=\"5\" placeholder=\"{{ option.name }}\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\">{{ option.value }}</textarea>]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<textarea name=\"option[{{ option.product_option_id }}]\" rows=\"5\" master-option-value=\"{{ option.master_option_value }}\" placeholder=\"{{ option.name }}\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %}>{{ option.value }}</textarea>\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" data-date-format=\"YYYY-MM-DD\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" />]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" data-date-format=\"YYYY-MM-DD\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" master-option-value=\"{{ option.master_option_value }}\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %} />\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" data-date-format=\"YYYY-MM-DD HH:mm\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" />]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" data-date-format=\"YYYY-MM-DD HH:mm\" id=\"input-option{{ option.product_option_id }}\" master-option-value=\"{{ option.master_option_value }}\" class=\"form-control\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option-value.quantity <= 0 %} disabled {% endif %} />\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" data-date-format=\"HH:mm\" id=\"input-option{{ option.product_option_id }}\" class=\"form-control\" />]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<input type=\"text\" name=\"option[{{ option.product_option_id }}]\" value=\"{{ option.value }}\" data-date-format=\"HH:mm\" id=\"input-option{{ option.product_option_id }}\" master-option-value=\"{{ option.master_option_value }}\" class=\"form-control\" {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %} />\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n		<operation error=\"skip\">\n			<search><![CDATA[<button type=\"button\" id=\"button-upload{{ option.product_option_id }}\" data-loading-text=\"{{ text_loading }}\" class=\"btn btn-default btn-block\"><i class=\"fa fa-upload\"></i> {{ button_upload }}</button>]]></search>\n			<add position=\"replace\"><![CDATA[\n			<!--BOF Related Options-->\n			<button type=\"button\" id=\"button-upload{{ option.product_option_id }}\" data-loading-text=\"{{ text_loading }}\" class=\"btn btn-default btn-block\" master-option-value={{ option.master_option_value }} {% if RDO_status and RDO_settings.buy_out_of_stock == 0 and option_value.quantity is defined and option_value.quantity <= 0 %} disabled {% endif %}><i class=\"fa fa-upload\"></i> {{ button_upload }}</button>\n			<!--EOF Related Options-->\n			]]></add>\n		</operation>\n\n\n		<operation error=\"skip\">\n			<search><![CDATA[$(\'#button-cart, [data-quick-buy]\').on(\'click\', function () {]]></search>\n			<add position=\"before\" offset=\"1\"><![CDATA[\n			{% if RDO_status %}\n			<!--BOF Related Options-->\n<script type=\"text/javascript\"> <!--\n\n	let RDO_productData, RDO_optionsData, RDO_optionImages = {};\n\n	{% if RDO_config        is not empty %}RDO_config        = {{ RDO_config }};{% endif %}\n\n	{% if RDO_product_data  is not empty %}RDO_productData   = {{ RDO_product_data }};{% endif %}\n\n	{% if RDO_options_data  is not empty %}RDO_optionsData   = {{ RDO_options_data }};{% endif %}\n\n	{% if RDO_option_images is not empty %}RDO_optionImages  = {{ RDO_option_images }};{% endif %}\n\n\n	$(document).ready(function() {\n\n	//START BASIC FUNCTIONS\n\n		$(\'.rdo-option[master-option!=0]\').hide();\n\n		// For smooth slideUp/slideDown animation\n		$(\'div.rdo-option, span.option-value\').each(function() {\n			$(this).css({\n				WebkitTransition : \'none\',\n				MozTransition    : \'none\',\n				MsTransition     : \'none\',\n				OTransition      : \'none\',\n				transition       : \'none\'\n			});\n		});\n\n		// SELECT OPTION\n		$(\'.rdo-option select\').on(\'change\', updateSelectOption);\n\n		// RADIO OPTION\n		$(\'.rdo-option input[type=radio]\').on(\'change\', updateRadioOption);\n\n		// CHECKBOX OPTION\n		$(\'.rdo-option input[type=checkbox]\').on(\'change\', updateCheckboxOption);\n\n		// TEXT INPUT AND TEXTAREA OPTION\n		$(\'.rdo-option input[type=text], .rdo-option textarea\').on(\'change\', updateTextAndTextareaOption);\n\n\n		function updateSelectOption() {\n			//console.log(\'updateSelectOption\');\n\n			let option_value = $(this).children(\'option:selected\').attr(\'option-value\');\n			let $related_options = $(\'.rdo-option[master-option=\' + $(this).parents(\'.rdo-option\').attr(\'option\') + \']\');\n\n			if ($(this).val() != \'\') {\n				updateOptionList($related_options, option_value);\n				changeImage(option_value);\n			} else {\n				$related_options.slideUp();\n			}\n\n			clearOption($related_options);\n		}\n\n		function updateRadioOption() {\n			//console.log(\'updateRadioOption\');\n\n			let option_value = $(this).attr(\'option-value\');\n			let $related_options = $(\'.rdo-option[master-option=\' + $(this).parents(\'.rdo-option\').attr(\'option\') + \']\');\n\n			if ($(\'input[name=\\\'\' + $(this).attr(\'name\') + \'\\\']:checked\').length != \'\') {\n				updateOptionList($related_options, option_value);\n				changeImage(option_value);\n			} else {\n				$related_options.slideUp();\n			}\n\n			clearOption($related_options);\n		}\n\n		function updateCheckboxOption() {\n			//console.log(\'updateCheckboxOption\');\n\n			let option_value_clicked = ($(this).is(\':checked\')) ? $(this).attr(\'option-value\') : null;\n			let option_value = [];\n\n			$(\'.rdo-option input[name=\\\'\' + $(this).attr(\'name\') + \'\\\']:checked\').each(function() {\n				option_value.push($(this).attr(\'option-value\'));\n			});\n\n			let $related_options = $(\'.rdo-option[master-option=\' + $(this).parents(\'.rdo-option\').attr(\'option\') + \']\');\n\n			if ($(\'input[name=\\\'\' + $(this).attr(\'name\') + \'\\\']:checked\').length != \'\') {\n				updateOptionList($related_options, option_value);\n				changeImage(option_value_clicked);\n			} else {\n				$related_options.slideUp();\n			}\n\n			clearOption($related_options);\n		}\n\n		function updateTextAndTextareaOption() {\n			//console.log(\'updateTextAndTextareaOption\');\n\n			let $related_options = $(\'.rdo-option[master-option=\' + $(this).parents(\'.rdo-option\').attr(\'option\') + \']\');\n\n			if ($(this).val() != \'\') {\n				$related_options.slideDown();\n			} else {\n				$related_options.slideUp();\n			}\n\n			clearOption($related_options);\n		}\n\n		function updateOptionList($related_options, option_value) {\n			//console.log(\'updateOptionList\');\n\n			//iPhone/iPad select option fix\n			$related_options.find(\'option[master-option-value!=0]\').each(function() {\n				if ($(this).parent(\'span\').length == 0) {\n					$(this).wrap(\"<span>\");\n				}\n			});\n			//End of fix\n\n			// ???\n			let attr = $related_options.find(\'input[type=hidden]\').attr(\'master-option-value\');\n		\n			if (typeof attr !== typeof undefined && attr !== false) {\n				$related_options.find(\'input[type=hidden][master-option-value!=0]\').prev().prop(\'disabled\', true);\n			}\n			// ???\n\n			$related_options.find(\'input[master-option-value!=0]\').hide();\n			$related_options.find(\'input[master-option-value!=0]\').parent(\'label\').parent(\'div\').hide();\n			$related_options.find(\'option[master-option-value][master-option-value!=0]\').hide(); // Hide all select options that have a master-option-value attribute and it is not equal to 0\n			$related_options.find(\'textarea[master-option-value!=0]\').hide();\n\n			if (typeof(option_value) == \"string\") {\n				option_value = [option_value];\n			}\n\n			for (let i in option_value) {\n				//iPhone/iPad select option fix\n				$related_options.find(\'option[master-option-value=\' + option_value[i] + \'], option[value=\\\'\\\']\').each(function() {\n					if ($(this).parent(\'span\').length != 0) {\n						$(this).unwrap();\n					}\n				});\n				//End of fix\n\n				$related_options.find(\'input[type=hidden][master-option-value=\' + option_value[i] + \']\').prev().prop(\'disabled\', false);\n\n				// If standard radio and checkboxes (uncomment this line and comment next)\n				//$related_options.find(\'input[master-option-value=\' + option_value[i] + \']\').show();\n\n				// If non-standard radio and checkboxes - do not display classic radio and checkboxes (uncomment this line and comment previous)\n				$related_options.find(\'input[master-option-value=\' + option_value[i] + \']\').not(\"input[type=radio], input[type=checkbox]\").show();\n\n				$related_options.find(\'input[master-option-value=\' + option_value[i] + \']\').parent(\'label\').parent(\'div\').show();\n\n				$related_options.find(\'option[master-option-value=\' + option_value[i] + \']\').show();\n\n				$related_options.find(\'textarea[master-option-value=\' + option_value[i] + \']\').show();\n			}\n\n			// If the block has no visible options - hide block, else show block\n			$related_options.each(function() {\n				let visible_options = 0;\n\n				for (let i in option_value) {\n					visible_options += $(this).find(\'[master-option-value=\' + option_value[i] + \']\').length * 1;\n					visible_options += $(this).find(\'[master-option-value=0]\').length * 1;\n				}\n\n				if ($(this).find(\'option, input, textarea\').length != 0 && visible_options == 0) {\n					$(this).slideUp();\n				} else {\n					$(this).slideDown();\n				}\n			});\n		}\n\n		function clearOption($option_container) {\n			//console.log(\'clearOption\');\n\n			/*\n			For templates without AJAX update price uncomment the lines with \".trigger(\"change\")\"\n			and comment the lines with \".each(update...)\".\n\n			For templates with AJAX update, uncomment the lines with \".each(update...)\"\n			and comment the lines with \".trigger(\"change\")\".\n			*/\n\n			//$option_container.find(\'select, li\').removeClass(\'selected\').val(\'\').trigger(\"change\");\n			$option_container.find(\'select, li\').removeClass(\'selected\').val(\'\').each(updateSelectOption);\n\n			//$option_container.find(\'input[type=radio]:checked, input[type=checkbox]:checked, li\').removeClass(\'selected\').removeAttr(\'checked\').trigger(\"change\");\n			$option_container.find(\'input[type=radio]:checked, li\').removeClass(\'selected\').removeAttr(\'checked\').each(updateRadioOption);\n			$option_container.find(\'input[type=checkbox]:checked, li\').removeClass(\'selected\').removeAttr(\'checked\').each(updateCheckboxOption);\n\n			//$option_container.find(\'input[type=text], textarea\').attr(\'value\', \'\').val(\'\').trigger(\"change\");\n			$option_container.find(\'input[type=text], textarea\').attr(\'value\', \'\').val(\'\').each(updateTextAndTextareaOption);\n\n			$option_container.find(\'input[type=hidden][name^=option], li\').removeClass(\'selected\').attr(\'value\', \'\');\n		\n	{% if RDO_settings.price_adjustment_on is defined and RDO_settings.price_adjustment_on %}\n			updatePrices();\n	{% endif %}\n		}\n\n	//END BASIC FUNCTIONS\n\n	//START PRICE ADJUSTMENT FUNCTIONS\n\n	{% if RDO_settings.price_adjustment_on is defined and RDO_settings.price_adjustment_on %}\n\n		const animatePriceEnabled  = {{ RDO_settings.price_animate_on }},\n		      multiplyPriceEnabled = {{ RDO_settings.price_multiply }};\n		const optionsWrapper   = (RDO_config.option_selector)    ? RDO_config.option_selector       : \'.product-options\',\n		      $priceWrapper    = (RDO_config.price_selector)     ? $(RDO_config.price_selector)     : $(\'.product-price-group .product-price:first, .product-price-group .product-price-new:first\'),\n		      $priceOldWrapper = (RDO_config.price_old_selector) ? $(RDO_config.price_old_selector) : $(\'.product-price-group .product-price-old:first\'),\n		      $quantityInput   = (RDO_config.quantity_selector)  ? $(RDO_config.quantity_selector)  : $(\'#product-quantity\'),\n		      $taxWrapper      = $(\'\'),\n		      $pointsWrapper   = $(\'\');\n\n		let currentPrice    = null,\n		    currentPriceOld = null;\n\n		$quantityInput.on(\'change keyup\', updatePrices);\n\n		// Main\n		function updatePrices() {\n			const PR = RDO_productData[\'price\'],\n			      SP = RDO_productData[\'special\'],\n			      MN = RDO_productData[\'minimum\'],\n			      DC = RDO_productData[\'decimal_place\'],\n			      DP = RDO_productData[\'decimal_point\'],\n			      TP = RDO_productData[\'thousand_point\'],\n			      SL = RDO_productData[\'symbol_left\'],\n			      SR = RDO_productData[\'symbol_right\'];\n\n			let quantity = 1;\n\n			if (multiplyPriceEnabled) {\n				quantity = +$quantityInput.val().trim();\n\n				if (isNaN(quantity) || quantity < MN) {\n					quantity = +MN;\n				}\n			}\n\n			let initialPrice             = (SP != false) ? extractPrice(SP) : extractPrice(PR),\n			    priceToSpecialDifference = (SP != false) ? extractPrice(PR) - extractPrice(SP) : 0;\n\n			let price = initialPrice + getAllOptionsPrices(initialPrice);\n			let priceOld = price + priceToSpecialDifference;\n\n			if (currentPrice == null) currentPrice = initialPrice * quantity;\n			if (currentPriceOld == null) currentPriceOld = (initialPrice + priceToSpecialDifference) * quantity;\n\n			if (animatePriceEnabled) {\n				animatePrice($priceWrapper, currentPrice, price * quantity);\n				animatePrice($priceOldWrapper, currentPriceOld, priceOld * quantity);\n			} else {\n				price    = formatPrice(price * quantity, DC, DP, TP, SL, SR);\n				priceOld = formatPrice(priceOld * quantity, DC, DP, TP, SL, SR);\n\n				showPrice($priceWrapper, price);\n				showPrice($priceOldWrapper, priceOld);\n			}\n\n			currentPrice = price * quantity;\n			currentPriceOld = priceOld * quantity;\n		}\n\n		// Calculation of the cost of all options\n		function getAllOptionsPrices(initialPrice = 0) {\n			let additionalPrice       =  0,\n			    additionalPricePrefix = \'\',\n			    productOptionValueId  =  0,\n			    difference            =  0;\n\n			$(optionsWrapper + \' input[type=\"radio\"]:checked, \' + optionsWrapper + \' input[type=\"checkbox\"]:checked, \' + optionsWrapper + \' select>option:selected\').each(function() {\n				productOptionValueId = $(this).attr(\'option-value\');\n\n				if (!productOptionValueId) {\n					return;\n				}\n\n				additionalPrice = extractPrice(RDO_optionsData[productOptionValueId].price);\n\n				if (additionalPrice === false || additionalPrice === undefined || additionalPrice === null || additionalPrice == \'\') {\n					return;\n				}\n\n				additionalPricePrefix = RDO_optionsData[productOptionValueId].price_prefix;\n\n				if (additionalPricePrefix == \'+\') {\n					difference += additionalPrice * 1;\n				} else if (additionalPricePrefix == \'-\') {\n					difference -= additionalPrice * 1;\n				} else if (additionalPricePrefix == \'=\') {\n					difference += additionalPrice * 1 - initialPrice;\n					initialPrice = +additionalPrice;\n				}\n			});\n\n			return difference;\n		}\n\n		// Price extraction, e.g. $1,499.99 -> 1499.99, 1 499,99р. -> 1499.99\n		function extractPrice(price = 0) {\n			if (!price) {\n				return 0;\n			}\n\n			return +price.split(RDO_productData[\'thousand_point\']).join(\'\')\n				     .replace(RDO_productData[\'symbol_left\'], \'\')\n				     .replace(RDO_productData[\'symbol_right\'], \'\')\n				     .replace(RDO_productData[\'decimal_point\'], \'.\');\n		}\n\n		// Formatting prices for regional settings, e.g. 1499.99 -> $1,499.99, 1499.99 -> 1 499,99р.\n		function formatPrice(price = 0, decimalPlaces = 2, decimalPoint = \'.\', thousandPoint = \'\', symbolLeft = \'\', symbolRight = \'\') {\n			let p     = price.toFixed(decimalPlaces).replace(\'-\', \'\').split(\'.\'),\n			    chars = p[0].split(\"\").reverse(),\n			    str   = \'\',\n			    count = 0;\n\n			for (let i in chars) {\n				count++;\n\n				if (count%3 == 1 && count != 1) {\n					str = chars[i] + thousandPoint + str;\n				} else {\n					str = chars[i] + str;\n				}\n			}\n\n			let formattedPrice = 0;\n\n			if (decimalPlaces > 0) {\n				formattedPrice = str + decimalPoint + p[1];\n			} else {\n				formattedPrice = str;\n			}\n\n			if (price >= 0) {\n				return symbolLeft + formattedPrice + symbolRight;\n			} else {\n				return \'-\' + symbolLeft + formattedPrice + symbolRight;\n			}\n		}\n\n		// Function that displays the price (without animation)\n		function showPrice(wrapper, price) {\n			wrapper.text(price);\n		}\n\n		// Recursive function that animates price changes\n		function animatePrice(wrapper, priceStart, PriceEnd, step = 0) {\n			if (priceStart == PriceEnd) {\n				return;\n			}\n\n			const DC = RDO_productData[\'decimal_place\'],\n			      DP = RDO_productData[\'decimal_point\'],\n			      TP = RDO_productData[\'thousand_point\'],\n			      SL = RDO_productData[\'symbol_left\'],\n			      SR = RDO_productData[\'symbol_right\'];\n\n			let stepCount = 15,\n			    stepDelay = 40, //ms between steps\n			    price     = priceStart;\n\n			if (!step) {\n				step = +((PriceEnd - priceStart) / stepCount).toFixed(DC);\n			}\n\n			price += step;\n\n			if ((PriceEnd > priceStart && price >= PriceEnd) || (PriceEnd < priceStart && price <= PriceEnd) || !step) {\n				priceFormatted = formatPrice(PriceEnd, DC, DP, TP, SL, SR);\n				showPrice(wrapper, priceFormatted);\n			} else {\n				priceFormatted = formatPrice(price, DC, DP, TP, SL, SR);\n				showPrice(wrapper, priceFormatted);\n				setTimeout(animatePrice, stepDelay, wrapper, price, PriceEnd, step);\n			}\n		}\n\n	{% endif %}\n\n	//END PRICE ADJUSTMENT FUNCTIONS\n\n	//START OPTION IMAGE CHANGE FUNCTIONS\n	\n	{% if RDO_settings.option_image_change is defined and RDO_settings.option_image_change  %}\n\n	let $mainImages       = $(\'.main-image .swiper-slide\');\n	let $additionalImages = $(\'.additional-images .additional-image\');\n	let $imageSwiper      = null;\n	let slideIndex        = null;\n\n	// If the Swiper has not loaded yet, check every 0.5 sec\n	let timerId = setInterval(function() {\n		$imageSwiper = $(\'.main-image\').data(\'swiper\');\n\n		if($imageSwiper && $imageSwiper.length) {\n			clearInterval(timerId);\n		}\n	}, 500);\n\n	// Stop checking after 15 seconds\n	setTimeout(function() {\n		clearInterval(timerId);\n	}, 15000);\n\n	function changeImage(optionValueId) {\n		if(optionValueId in RDO_optionImages) {\n\n			//TODO: Refactor all code\n\n			let imageData     = RDO_optionImages[optionValueId];\n			let imagePathInfo = imageData[\'image_pathinfo\'];\n			let image         = imageData.image;\n\n			let $slide = $mainImages.find(\'img[src=\"\' + image + \'\"] \').parent();\n\n			// If the Journal version is 3.0.46 or higher\n			// Instead of \"image_1-550x550.jpg\", the Journal creates \"image_1-550x550w.jpg\" or \"image_1-550x550h.jpg\" or \"image_1-550x550w.jpg.webp\"\n			if (!$slide.length) {\n				let imageExtensions = [\'webp\', \'jpg\', \'jpeg\', \'jpe\', \'png\', \'gif\', \'bmp\', \'tiff\', \'tif\', \'svg\', \'svgz\'];\n\n				let path = image.slice(0, image.lastIndexOf(\'/\') + 1);\n				let filename = image.slice(image.lastIndexOf(\'/\') + 1);\n\n				// Trim file extension\n				filename = filename.slice(0, filename.lastIndexOf(\'.\'));\n\n				// If filename has two extensions, for example \"image_1-550x550h.jpg.webp\"\n				if (filename.split(\'.\').length > 1 && imageExtensions.includes( filename.split(\'.\').pop() )) {\n					// Trim file extension\n					filename = filename.slice(0, filename.lastIndexOf(\'.\'));\n				}\n\n				// Get the image path/filename (without the last unnecessary letter \"w\" or \"h\")\n				path = path + filename;\n				//path = path.slice(0, path.length - 1);\n\n				$slide = $mainImages.find(\'img[src^=\"\' + path + \'\"] \').parent();\n			}\n\n			// Show option image\n			if ($slide.length) {\n				slideIndex = undefined;\n\n				if ($slide.data(\'index\') != undefined) {\n					//PRODUCT PAGE\n					slideIndex = $slide.data(\'index\');\n\n				} else if (imagePathInfo != undefined) {\n					//QUICKVIEW\n\n					// Path: \"/catalog/image_1\"\n					path = String(imagePathInfo.ds) + String(imagePathInfo.dn) + String(imagePathInfo.ds) + String(imagePathInfo.fn);\n					//console.log(path);\n\n					// Path: \"https://site.com/image/cache/catalog/image_1-\"\n					path = image.slice(0, image.indexOf(path)) + path + \'-\';\n					//console.log(path);\n\n					$slide = $additionalImages.find(\'img[src^=\"\' + path + \'\"] \').parent();\n\n					slideIndex = $slide.data(\'index\');\n					//console.log(slideIndex);\n				}\n\n				if (slideIndex != undefined) {\n					if ($imageSwiper.params.loop) {\n						$imageSwiper.slideToLoop(slideIndex, 0);\n					} else {\n						$imageSwiper.slideTo(slideIndex, 0);\n					}\n				}\n			} else {\n				// Create new slide (image container) by copying an existing one\n				//$slide = $mainImages.first().clone(true);\n				//$slide.removeClass(\'swiper-slide-prev swiper-slide-next swiper-slide-visible swiper-slide-active\');\n				//$slide.attr(\'data-index\', $mainImages.length);\n\n				// Change product image\n				//$slide.children(\'img\').attr(\'src\', optionImages[optionValueId].image);\n				//$slide.children(\'img\').attr(\'data-largeimg\', optionImages[optionValueId].image_large);\n				//$slide.children(\'img\').attr(\'srcset\', optionImages[optionValueId].image + \' 1x, \' + optionImages[optionValueId].image_large + \' 2x\');\n\n				//$slide.appendTo(\'.main-image .swiper-wrapper\');\n\n				// Add image to gallery (for full size opening)\n				//let lightgalleryProductImages = JSON.parse($(\'.lightgallery-product-images\').attr(\'data-images\'));\n				//lightgalleryProductImages[$mainImages.length] = {src:optionImages[optionValueId].image_large, thumb:optionImages[optionValueId].image};\n				//$(\'.lightgallery-product-images\').attr(\'data-images\', JSON.stringify(lightgalleryProductImages));\n\n				// Show image\n				//$imageSwiper.preloadImages();\n				//$imageSwiper.slideTo($slide.attr(\'data-index\'), 0);\n			}\n		}\n	}\n\n	{% else %}\n	\n	function changeImage() {\n		return true;\n	}\n\n	{% endif %}\n	\n	//END OPTION IMAGE CHANGE FUNCTIONS\n\n	});\n\n//--></script>\n			<!--EOF Related Options-->\n			{% endif %}\n			]]></add>\n		</operation>\n	</file>\n\n	<!-- <file path=\"catalog/view/theme/journal3/template/common/footer.twig\">\n\n		<operation error=\"skip\">\n			<search><![CDATA[{% if j3.canLiveReload() %}]]></search>\n			<add position=\"before\" trim=\"true\"><![CDATA[\n{% if j3.document.getPageRoute() == \'product/product\' %}\n\n<script type=\"text/javascript\">\n	$(document).ready(function() {\n		// Cancel Journal3 auto select first option\n		if ((Journal[\'isPopup\'] ? Journal[\'quickviewPageStyleOptionsSelect\'] : Journal[\'productPageStyleOptionsSelect\']) === \'all\') {\n			$(\'.product-options .form-group .radio:first-child input, .product-options .form-group .checkbox:first-child input\').prop(\'checked\', false);\n			$(\'.product-options .form-group select option:eq(1)\').prop(\'selected\', false);\n		}\n\n		if ((Journal[\'isPopup\'] ? Journal[\'quickviewPageStyleOptionsSelect\'] : Journal[\'productPageStyleOptionsSelect\']) === \'required\') {\n			$(\'.product-options .form-group.required .radio:first-child input, .product-options .form-group.required .checkbox:first-child input\').prop(\'checked\', false);\n			$(\'.product-options .form-group.required select option:eq(1)\').prop(\'selected\', false);\n		}\n\n		$(\'#product-quantity\').trigger(\'change\');\n	});\n</script>\n\n{% endif %}\n			]]></add>\n		</operation>\n	</file> -->\n\n	<file path=\"catalog/controller/journal3/price.php\">\n\n		<!-- [Prefix \"=\" for product option values (Journal ajax live price update)] -->\n		<operation error=\"skip\">\n			<search><![CDATA[if ($product_option_value[\'price_prefix\'] === \'+\') {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			if ($product_option_value[\'price_prefix\'] === \'=\') {\n				$new_price = (float)$product_option_value[\'price\'];\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values (Journal ajax live price update)] -->\n		<operation error=\"skip\">\n			<search><![CDATA[if ($product_option_value[\'weight_prefix\'] === \'+\') {]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			if ($product_option_value[\'weight_prefix\'] === \'=\') {\n				$new_weight = (float)$product_option_value[\'weight\'];\n			}\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values (Journal ajax live price update)] -->\n		<operation error=\"skip\">\n			<search><![CDATA[// price]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			$options_price  += (isset($new_price))  ? $new_price - (float)$base_price : 0;\n			//EOF Related Options\n			]]></add>\n		</operation>\n\n		<!-- [Prefix \"=\" for product option values (Journal ajax live price update)] -->\n		<operation error=\"skip\">\n			<search><![CDATA[// weight]]></search>\n			<add position=\"before\"><![CDATA[\n			//BOF Related Options\n			$options_weight += (isset($new_weight)) ? $new_weight - (float)$product_info[\'weight\'] : 0;\n			//EOF Related Options\n			]]></add>\n		</operation>\n	</file>\n\n</modification>\n', 1, '2025-09-13 16:07:09');
INSERT INTO `ac_modification` (`modification_id`, `extension_install_id`, `name`, `code`, `author`, `version`, `link`, `xml`, `status`, `date_added`) VALUES
(52, 54, 'DearSoft Pathao Merchant Delivery', 'dearsoft_pathao_oc3', 'DearSoft', '1.1.0', 'https://dev.deargroup.co', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>DearSoft Pathao Merchant Delivery</name>\r\n    <code>dearsoft_pathao_oc3</code>\r\n    <version>1.1.0</version>\r\n    <author>DearSoft</author>\r\n    <link>https://dev.deargroup.co</link>\r\n    <description>OpenCart 3 shipping extension for Pathao Courier Merchant API with OAuth token management, automatic order creation, and Send to Pathao button on the dashboard.</description>\r\n</modification>\r\n', 1, '2026-07-22 11:34:24'),
(27, 28, 'Dear Soft Service Module', 'dearsoft_service_module', 'Dear Soft', '3.0.0', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>Dear Soft Service Module</name>\r\n    <code>dearsoft_service_module</code>\r\n    <version>3.0.0</version>\r\n    <author>Dear Soft</author>\r\n    <link>https://dearsoft.bd</link>\r\n</modification>\r\n', 1, '2026-02-15 21:51:32'),
(21, 22, 'REDS Perfect Admin Login', 'reds_perfect_admin_login', 'DearSoft', '3.0.0', 'https://www.dearsoft.bd/', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<modification>\n	<name><![CDATA[REDS Perfect Admin Login]]></name>\n	<code><![CDATA[reds_perfect_admin_login]]></code>\n	<version><![CDATA[3.0.0]]></version>\n	<author><![CDATA[DearSoft]]></author>\n	<link><![CDATA[https://www.dearsoft.bd/]]></link>\n	\n	<file path=\"admin/controller/common/login.php\">\n        <operation info=\"modifica qual arquivo buscar\">\n            <search><![CDATA[\n				$this->response->setOutput($this->load->view(\'common/login\', $data));\n			]]></search>\n            <add position=\"replace\"><![CDATA[\n				$this->response->setOutput($this->load->view(\'extension/extension/login2\', $data));\n			]]></add>\n		</operation>\n	</file>\n</modification>', 0, '2026-02-03 19:36:07'),
(22, 23, 'OCMOD Editor for OpenCart 3.0.x', 'ocmod-editor', 'DearSoft', '3.4.1', 'https://dearsoft.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>OCMOD Editor for OpenCart 3.0.x</name>\r\n    <code>ocmod-editor</code>\r\n    <version>3.4.1</version>\r\n    <author>OpenCart Brasil</author>\r\n    <link>https://dearsoft.bd</link>\r\n    <file path=\"admin/controller/startup/permission.php\">\r\n        <operation>\r\n            <search>\r\n                <![CDATA[$extension = array(]]>\r\n            </search>\r\n            <add position=\"after\">\r\n                <![CDATA[\'extension/modification\',]]>\r\n            </add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"admin/controller/marketplace/modification.php\">\r\n        <operation>\r\n            <search>\r\n                <![CDATA[public function index() {]]>\r\n            </search>\r\n            <add position=\"after\">\r\n                <![CDATA[\r\n                $this->load->model(\'extension/modification/editor\');\r\n\r\n                if (!$this->user->hasPermission(\'modify\', \'extension/modification/search\')) {\r\n                    $this->load->model(\'user/user_group\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'access\', \'extension/modification/editor\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'modify\', \'extension/modification/editor\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'access\', \'extension/modification/error_log\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'modify\', \'extension/modification/error_log\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'access\', \'extension/modification/files\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'modify\', \'extension/modification/files\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'access\', \'extension/modification/diff\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'modify\', \'extension/modification/diff\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'access\', \'extension/modification/search\');\r\n                    $this->model_user_user_group->addPermission($this->user->getGroupId(), \'modify\', \'extension/modification/search\');\r\n                }\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search>\r\n                <![CDATA[$data[\'refresh\'] = $this->url->link(\'marketplace/modification/refresh\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);]]>\r\n            </search>\r\n            <add position=\"before\">\r\n                <![CDATA[\r\n                $data[\'log_error\'] = $this->url->link(\'extension/modification/error_log\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);\r\n                $data[\'files\'] = $this->url->link(\'extension/modification/files\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);\r\n                $data[\'new\'] = $this->url->link(\'extension/modification/editor\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);\r\n                $data[\'search\'] = $this->url->link(\'extension/modification/search\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search>\r\n                <![CDATA[$data[\'modifications\'][] = array(]]>\r\n            </search>\r\n            <add position=\"after\">\r\n                <![CDATA[\r\n                \'edit\' => $this->url->link(\'extension/modification/editor\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&modification_id=\' . $result[\'modification_id\'], true),\r\n                \'download\' => $this->url->link(\'extension/modification/editor/download\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&modification_id=\' . $result[\'modification_id\'], true),\r\n                \'file_url\' => isset($result[\'extension_install_id\']) ? $this->model_extension_modification_editor->getExtensionInstallByExtensionInstallId($result[\'extension_install_id\']) : \'\',\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search>\r\n                <![CDATA[public function index() {]]>\r\n            </search>\r\n            <add position=\"after\">\r\n                <![CDATA[$this->load->language(\'extension/modification/editor\');]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search index=\"1\">\r\n                <![CDATA[$this->response->redirect($this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));]]>\r\n            </search>\r\n            <add position=\"replace\">\r\n                <![CDATA[\r\n                if (isset($this->request->get[\'modification_editor\'])) {\r\n                    echo $this->session->data[\'success\'];\r\n                    exit;\r\n                } else {\r\n                    $this->response->redirect($this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));\r\n                }\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"admin/view/template/marketplace/modification.twig\">\r\n        <operation>\r\n            <search>\r\n                <![CDATA[<div class=\"pull-right\">]]>\r\n            </search>\r\n            <add position=\"after\">\r\n                <![CDATA[<a href=\"{{ search }}\" data-toggle=\"tooltip\" title=\"{{ button_search }}\" class=\"btn btn-default\"><i class=\"fa fa-search\"></i></a> <a href=\"{{ log_error }}\" data-toggle=\"tooltip\" title=\"{{ button_log_error }}\" class=\"btn btn-default\"><i class=\"fa fa-exclamation-triangle\"></i></a> <a href=\"{{ files }}\" data-toggle=\"tooltip\" title=\"{{ button_files }}\" class=\"btn btn-default\"><i class=\"fa fa-list-alt\"></i></a> <a href=\"{{ new }}\" data-toggle=\"tooltip\" title=\"{{ button_new }}\" class=\"btn btn-primary\"><i class=\"fa fa-plus\"></i></a>]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search>\r\n                <![CDATA[{% if not modification.enabled %}]]>\r\n            </search>\r\n            <add position=\"before\">\r\n                <![CDATA[\r\n                <a href=\"{{ modification.edit }}\" data-toggle=\"tooltip\" title=\"{{ button_edit }}\" class=\"btn btn-primary\"><i class=\"fa fa-pencil\"></i></a>\r\n                <a href=\"{{ modification.download }}\" data-toggle=\"tooltip\" title=\"{{ button_download }}\" class=\"btn btn-success\"><i class=\"fa fa-cloud-download\"></i></a>\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search>\r\n                <![CDATA[<td class=\"text-left\">{{ modification.name }}</td>]]>\r\n            </search>\r\n            <add position=\"replace\">\r\n                <![CDATA[<td class=\"text-left\"><b>{{ modification.name }}</b><br><small><i>{{ modification.file_url }}</i></small></td>]]>\r\n            </add>\r\n        </operation>\r\n    </file>\r\n</modification>', 1, '2026-02-04 01:56:11'),
(24, 25, 'DearSoft Auto URL Admin', 'acrescentar-url-amigavel-automaticamente-a-marcas-categorias-pro', 'DearSoft', '1.4.4', 'http://dearsoft.bd', '﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<modification>\r\n	<name>DearSoft Auto URL Admin</name>\r\n	<code>acrescentar-url-amigavel-automaticamente-a-marcas-categorias-produtos-informacoes</code>\r\n	<version>1.4.4</version>\r\n	<author>DearSoft</author>\r\n	<link>http://dearsoft.bd</link>\r\n\r\n	<file path=\"admin/controller/catalog/product.php|admin/controller/catalog/category.php|admin/controller/catalog/information.php\">\r\n		<operation>\r\n			<search><![CDATA[$data[\'languages\']]]></search>\r\n			<add position=\"after\">\r\n				<![CDATA[\r\n					$data[\'active_language\'] = $this->config->get(\'config_language_id\');\r\n				]]>\r\n			</add>\r\n		</operation>\r\n	</file>\r\n\r\n	<file path=\"admin/view/template/common/header.twig\">\r\n		<operation>\r\n			<search><![CDATA[</head>]]></search>\r\n			<add position=\"before\">\r\n				<![CDATA[\r\n					<script type=\"text/javascript\" src=\"view/javascript/stringToSlug/speakingurl.min.js\"></script>\r\n					<script type=\"text/javascript\" src=\"view/javascript/stringToSlug/jquery.stringToSlug.min.js\"></script>\r\n				]]>\r\n			</add>\r\n		</operation>\r\n	</file>\r\n\r\n	<file path=\"admin/view/template/catalog/product_form.twig\">\r\n		<operation>\r\n			<search><![CDATA[var attribute_row = {{ attribute_row }};]]></search>\r\n			<add position=\"after\">\r\n				<![CDATA[\r\n					$(document).ready( function() {\r\n						{% for language in languages %}\r\n						var langS{{ language.language_id }} = \'{{ language.code }}\'.substr(0, 2);\r\n						$(\'#title-slug{{ language.language_id }}\').stringToSlug({\r\n							setEvents: \'keyup keydown blur\',\r\n							getPut: \'#slug-result{{ language.language_id }}\',\r\n							options: {\r\n								lang: langS{{ language.language_id }},\r\n								titleCase: false\r\n							}\r\n						});\r\n						$(\'#title-slug{{ language.language_id }}\').stringToSlug({\r\n							setEvents: \'keyup keydown blur\',\r\n							space: \' \',\r\n							options: {\r\n								lang: langS{{ language.language_id }},\r\n								titleCase: true\r\n							},\r\n							callback: function(str) {\r\n								$(\'.cMeta{{ language.language_id }}\').val($(\'#title-slug{{ language.language_id }}\').val());\r\n							}\r\n						});\r\n						{% endfor %}\r\n					});\r\n				]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"product_description[{{ language.language_id }}][name]\"]]></search>\r\n			<add position=\"replace\">\r\n				<![CDATA[id=\"title-slug{{ language.language_id }}\" name=\"product_description[{{ language.language_id }}][name]\"]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[id=\"input-meta-title{{ language.language_id }}\" class=\"form-control\"]]></search>\r\n			<add position=\"replace\">\r\n				<![CDATA[id=\"input-meta-title{{ language.language_id }}\" class=\"form-control cMeta{{ language.language_id }}\"]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"product_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></search>\r\n			<add position=\"replace\"><![CDATA[id=\"slug-result{{ language.language_id }}\" name=\"product_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></add>\r\n		</operation>\r\n	</file>\r\n\r\n	<file path=\"admin/view/template/catalog/category_form.twig\">\r\n		<operation>\r\n			<search index=\"0\"><![CDATA[<script type=\"text/javascript\">]]></search>\r\n			<add position=\"after\">\r\n				<![CDATA[\r\n					$(document).ready( function() {\r\n					  {% for language in languages %}\r\n					  var langS{{ language.language_id }} = \'{{ language.code }}\'.substr(0, 2);\r\n            $(\'#title-slug{{ language.language_id }}\').stringToSlug({\r\n							setEvents: \'keyup keydown blur\',\r\n							getPut: \'#slug-result{{ language.language_id }}\',\r\n							options: {\r\n								lang: langS{{ language.language_id }},\r\n								titleCase: false\r\n							}\r\n						});\r\n						$(\'#title-slug{{ language.language_id }}\').stringToSlug({\r\n							setEvents: \'keyup keydown blur\',\r\n							space: \' \',\r\n							options: {\r\n								lang: langS{{ language.language_id }},\r\n								titleCase: true\r\n							},\r\n							callback: function(str) {\r\n								$(\'.cMeta{{ language.language_id }}\').val($(\'#title-slug{{ language.language_id }}\').val());\r\n							}\r\n						});\r\n						{% endfor %}\r\n					});\r\n				]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"category_description[{{ language.language_id }}][name]\"]]></search>\r\n			<add position=\"replace\">\r\n				<![CDATA[id=\"title-slug{{ language.language_id }}\" name=\"category_description[{{ language.language_id }}][name]\"]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[id=\"input-meta-title{{ language.language_id }}\" class=\"form-control\"]]></search>\r\n			<add position=\"replace\">\r\n				<![CDATA[id=\"input-meta-title{{ language.language_id }}\" class=\"form-control cMeta{{ language.language_id }}\"]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"category_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></search>\r\n			<add position=\"replace\"><![CDATA[id=\"slug-result{{ language.language_id }}\" name=\"category_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></add>\r\n		</operation>\r\n	</file>\r\n\r\n	<file path=\"admin/controller/catalog/manufacturer.php\">\r\n		<operation>\r\n			<search><![CDATA[protected function getForm() {]]></search>\r\n			<add position=\"after\">\r\n				<![CDATA[$data[\'lang\'] = $this->language->get(\'code\');]]>\r\n			</add>\r\n		</operation>\r\n	</file>\r\n\r\n	<file path=\"admin/view/template/catalog/manufacturer_form.twig\">\r\n		<operation>\r\n			<search><![CDATA[{{ footer }}]]></search>\r\n			<add position=\"before\">\r\n				<![CDATA[\r\n					<script type=\"text/javascript\">\r\n						$(document).ready( function() {\r\n						var langS = \'{{ lang }}\'.substr(0, 2);\r\n							$(\'#title-slug{{ lang }}\').stringToSlug({\r\n								setEvents: \'keyup keydown blur\',\r\n								getPut: \'.slug-result{{ lang }}\',\r\n								options: {\r\n									lang: langS,\r\n									titleCase: false\r\n								}\r\n							});\r\n							$(\'#title-slug{{ lang }}\').stringToSlug({\r\n								setEvents: \'keyup keydown blur\',\r\n								space: \' \',\r\n								options: {\r\n									lang: langS,\r\n									titleCase: true\r\n								},\r\n								callback: function(str) {\r\n									$(\'.cMeta{{ lang }}\').val($(\'#title-slug{{ lang }}\').val());\r\n								}\r\n							});\r\n						});\r\n					</script>\r\n				]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"name\"]]></search>\r\n			<add position=\"replace\"><![CDATA[id=\"title-slug{{ lang }}\" name=\"name\"]]></add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"manufacturer_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></search>\r\n			<add position=\"replace\"><![CDATA[class=\"form-control slug-result{{ lang }}\" name=\"manufacturer_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></add>\r\n		</operation>\r\n	</file>\r\n\r\n	<file path=\"admin/view/template/catalog/information_form.twig\">\r\n		<operation>\r\n			<search><![CDATA[<script type=\"text/javascript\">]]></search>\r\n			<add position=\"after\">\r\n				<![CDATA[\r\n					$(document).ready( function() {\r\n						{% for language in languages %}\r\n					  var langS{{ language.language_id }} = \'{{ language.code }}\'.substr(0, 2);\r\n						$(\"#title-slug{{ language.language_id }}\").stringToSlug({\r\n							setEvents: \'keyup keydown blur\',\r\n							getPut: \'#slug-result{{ language.language_id }}\',\r\n							options: {\r\n								lang: langS{{ language.language_id }},\r\n								titleCase: false\r\n							}\r\n						});\r\n						$(\"#title-slug{{ language.language_id }}\").stringToSlug({\r\n							setEvents: \'keyup keydown blur\',\r\n							space: \' \',\r\n							options: {\r\n								lang: langS{{ language.language_id }},\r\n								titleCase: true\r\n							},\r\n							callback: function(str) {\r\n								$(\'.cMeta{{ language.language_id }}\').val($(\"#title-slug{{ language.language_id }}\").val());\r\n							}\r\n						});\r\n						{% endfor %}\r\n					});\r\n				]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"information_description[{{ language.language_id }}][title]\"]]></search>\r\n			<add position=\"replace\">\r\n				<![CDATA[id=\"title-slug{{ language.language_id }}\" name=\"information_description[{{ language.language_id }}][title]\"]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[id=\"input-meta-title{{ language.language_id }}\" class=\"form-control\"]]></search>\r\n			<add position=\"replace\">\r\n				<![CDATA[id=\"input-meta-title{{ language.language_id }}\" class=\"form-control cMeta{{ language.language_id }}\"]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[name=\"information_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></search>\r\n			<add position=\"replace\"><![CDATA[id=\"slug-result{{ language.language_id }}\" name=\"information_seo_url[{{ store.store_id }}][{{ language.language_id }}]\"]]></add>\r\n		</operation>\r\n	</file>\r\n</modification>', 1, '2026-02-04 11:17:41'),
(25, 26, 'Order Status - Color Code', 'DearSoft__OrderStatusColor', '<span style=\"color: #E5BC7A;\"><b>DearSoft</b></span>', '1.0', 'http://dearsoft.bd', '<modification>\r\n	\r\n	<name>DearSoft - Color Code</name>\r\n	<version>1.0</version>\r\n	<author><![CDATA[<span style=\"color: #E5BC7A;\"><b>DearSoft</b></span>]]></author>\r\n	<link>dearsoft.bd</link>\r\n	<code>DearSoft__OrderStatusColor</code>\r\n	\r\n	<file path=\"catalog/view/theme/porto/template/account/order_list.tpl\">\r\n		<operation error=\"skip\">\r\n			<search><![CDATA[echo $order[\'status\'];]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n		if ($order[\'status\'] == \'Shipped\') { echo \'<span style=\"color:orange\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Pending\') { echo \'<span style=\"color:red\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Complete\') { echo \'<span style=\"color:green\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Collected\') { echo \'<span style=\"color:green\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Processing\') { echo \'<span style=\"color:blue\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Store Collection\') { echo \'<span style=\"color:orange\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Pre-order\') { echo \'<span style=\"color:orange\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Canceled\') { echo \'<span style=\"color:red\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Voided\') { echo \'<span style=\"color:red\">\'.$order[\'status\'].\'</span>\'; }\r\n			elseif ($order[\'status\'] == \'Processed\') { echo \'<span style=\"color:#0096ff\">\'.$order[\'status\'].\'</span>\'; }\r\n			else { echo $order[\'status\']; }\r\n				]]></add>\r\n		</operation>\r\n	</file>\r\n	\r\n	<file path=\"admin/view/template/extension/dashboard/recent_info.twig\">\r\n		<operation error=\"skip\">\r\n			<search><![CDATA[<td>{{ order.status }}</td>]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n		{% if order.status == \'Shipped\' %} <td><span style=\"color:orange\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Pending\' %} <td><span style=\"color:red\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Complete\' %} <td><span style=\"color:green\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Collected\' %} <td><span style=\"color:green\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Processing\' %} <td><span style=\"color:blue\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Store Collection\' %} <td><span style=\"color:orange\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Pre-order\' %} <td><span style=\"color:orange\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Canceled\' %} <td><span style=\"color:red\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Refunded\' %} <td><span style=\"color:red\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Voided\' %} <td><span style=\"color:red\">{{ order.status }}</span></td>\r\n		{% elseif order.status == \'Processed\' %} <td><span style=\"color:#0096ff\">{{ order.status }}</span></td>\r\n		{% elseif order.status == null %} <td><span style=\"color:fuchsia\">Missing Order</span></td>\r\n		{% else %} <td>{{ order.status }}</td>\r\n		{% endif %}\r\n				]]></add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"admin/view/template/sale/order_list.twig\">\r\n		<operation error=\"skip\">\r\n			<search><![CDATA[<td class=\"text-left\">{{ order.order_status }}</td>]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n		{% if order.order_status == \'Shipped\' %} <td class=\"text-left\"><span style=\"color:orange\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Pending\' %} <td class=\"text-left\"><span style=\"color:red\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Complete\' %} <td class=\"text-left\"><span style=\"color:green\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Collected\' %} <td class=\"text-left\"><span style=\"color:green\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Processing\' %} <td class=\"text-left\"><span style=\"color:blue\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Store Collection\' %} <td class=\"text-left\"><span style=\"color:orange\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Pre-order\' %} <td class=\"text-left\"><span style=\"color:orange\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Canceled\' %} <td class=\"text-left\"><span style=\"color:red\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Refunded\' %} <td class=\"text-left\"><span style=\"color:red\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Voided\' %} <td class=\"text-left\"><span style=\"color:red\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Processed\' %} <td class=\"text-left\"><span style=\"color:#0096ff\">{{ order.order_status }}</span></td>\r\n		{% elseif order.order_status == \'Missing Orders\' %} <td class=\"text-left\"><span style=\"color:fuchsia\">{{ order.order_status }}</span></td>\r\n		{% else %} <td class=\"text-left\">{{ order.order_status }}</td>\r\n		{% endif %}\r\n			]]></add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"admin/view/template/sale/order_history.twig\">\r\n		<operation error=\"skip\">\r\n			<search><![CDATA[<td class=\"text-left\">{{ history.status }}</td>]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n		{% if history.status == \'Shipped\' %} <td class=\"text-left\"><span style=\"color:orange\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Pending\' %} <td class=\"text-left\"><span style=\"color:red\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Complete\' %} <td class=\"text-left\"><span style=\"color:green\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Collected\' %} <td class=\"text-left\"><span style=\"color:green\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Processing\' %} <td class=\"text-left\"><span style=\"color:blue\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Store Collection\' %} <td class=\"text-left\"><span style=\"color:orange\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Pre-order\' %} <td class=\"text-left\"><span style=\"color:orange\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Canceled\' %} <td class=\"text-left\"><span style=\"color:red\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Refunded\' %} <td class=\"text-left\"><span style=\"color:red\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Voided\' %} <td class=\"text-left\"><span style=\"color:red\">{{ history.status }}</span></td>\r\n		{% elseif history.status == \'Processed\' %} <td class=\"text-left\"><span style=\"color:#0096ff\">{{ history.status }}</span></td>\r\n		{% else %} <td class=\"text-left\">{{ history.status }}</td>\r\n		{% endif %}\r\n			]]></add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"admin/view/template/sale/order_info.twig\">\r\n		<operation error=\"skip\">\r\n			<search><![CDATA[<td>{{ other_order.order_status }}</td>]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n		{% if other_order.order_status == \'Shipped\' %} <td><span style=\"color:orange\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Pending\' %} <td><span style=\"color:red\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Complete\' %} <td><span style=\"color:green\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Collected\' %} <td><span style=\"color:green\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Processing\' %} <td><span style=\"color:blue\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Store Collection\' %} <td><span style=\"color:orange\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Pre-order\' %} <td><span style=\"color:orange\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Canceled\' %} <td><span style=\"color:red\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Refunded\' %} <td><span style=\"color:red\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Voided\' %} <td><span style=\"color:red\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'Processed\' %} <td><span style=\"color:#0096ff\">{{ other_order.order_status }}</span></td>\r\n		{% elseif other_order.order_status == \'\' %} <td><span style=\"color:fuchsia\">Missing Order</span></td>\r\n		{% else %} <td>{{ other_order.order_status }}</td>\r\n		{% endif %}\r\n			]]></add>\r\n		</operation>\r\n	</file>\r\n\r\n</modification>', 0, '2026-02-04 11:17:57'),
(26, 27, 'invoiceno-in-orderlist', 'Invoice No. in Admin Order List', 'Wayne Stams', '1.00', '', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<modification>\r\n	<name>invoiceno-in-orderlist</name>\r\n	<version>1.00</version>\r\n	<author>Wayne Stams</author>\r\n	<code>Invoice No. in Admin Order List</code>\r\n	<file path=\"admin/controller/sale/order.php\">\r\n		<operation>\r\n			<search trim=\"true\" index=\"0\"><![CDATA[foreach ($results as $result) {]]></search>\r\n			<add position=\"after\">\r\n				<![CDATA[\r\n					$invoice_no = $result[\'invoice_no\'];\r\n					$invoice_pre = $result[\'invoice_prefix\'];\r\n\r\n					$show_invoice = $invoice_no > 0;\r\n				]]>\r\n			</add>\r\n		</operation>\r\n		<operation>\r\n			<search trim=\"true\"><![CDATA[\'edit\'          => $this->url->link(\'sale/order/edit\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&order_id=\' . $result[\'order_id\'] . $url, true)]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n			    \'edit\'          => $this->url->link(\'sale/order/edit\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&order_id=\' . $result[\'order_id\'] . $url, true),\r\n                \'invoice_url\'   => $this->url->link(\'sale/order/invoice\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&order_id=\' . $result[\'order_id\'] . $url, true),\r\n                \'invoice_no\'    => $invoice_pre . $invoice_no,\r\n                \'show_invoice\'  => $show_invoice,\r\n			]]>\r\n			</add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"admin/view/template/sale/order_list.twig\">\r\n		<operation>\r\n			<search trim=\"true\"><![CDATA[<td class=\"text-right\">{{ order.order_id }}</td>]]></search>\r\n			<add position=\"replace\"><![CDATA[<td class=\"text-right\">{{ order.order_id }}{% if order.show_invoice %} <br/> <a target=\"_blank\" href=\"{{ order.invoice_url }}\">{{ order.invoice_no }}</a> {% endif %}</td>]]></add>\r\n		</operation>\r\n	</file>\r\n    <file path=\"admin/model/sale/order.php\">\r\n        <operation>\r\n            <search trim=\"true\"><![CDATA[$sql = \"SELECT o.order_id, CONCAT(o.firstname, \' \', o.lastname) AS customer, (SELECT os.name FROM \" . DB_PREFIX . \"order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\') AS order_status, o.shipping_code, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `\" . DB_PREFIX . \"order` o\";]]></search>\r\n            <add position=\"replace\"><![CDATA[$sql = \"SELECT o.order_id, CONCAT(o.firstname, \' \', o.lastname) AS customer, (SELECT os.name FROM \" . DB_PREFIX . \"order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\') AS order_status, o.shipping_code, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified, o.invoice_no, o.invoice_prefix FROM `\" . DB_PREFIX . \"order` o\";]]></add>\r\n        </operation>\r\n    </file>\r\n</modification>', 0, '2026-02-04 11:26:59'),
(47, 48, 'Order List Product Image', 'dearsoft_order_list_image', 'DearSoft', '1.0.3', 'https://dev.deargroup.co', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>Order List Product Image</name>\n    <code>dearsoft_order_list_image</code>\n    <version>1.0.3</version>\n    <author>DearSoft</author>\n    <link>https://dev.deargroup.co</link>\n\n    <!--\n        1.0.3: two changes.\n\n        (a) Fix column misalignment on the Order List page: the \"Image\"\n        header (inserted right after the checkbox header) and the image\n        CELL (previously inserted right before the customer cell, i.e. AFTER\n        the order_id cell) were one column position apart from each other -\n        so \"Image\" as a header sat above the order_id data, and \"Order ID\"\n        sat above the image thumbnail. Fixed by anchoring the row\'s image\n        cell on the checkbox cell\'s closing tag instead, so it lands in the\n        same relative position as the header.\n\n        (b) Add the same product-image column to the admin dashboard\'s\n        \"Latest Orders\" widget (admin/controller/extension/dashboard/\n        recent.php + admin/view/template/extension/dashboard/recent_info.twig),\n        positioned after Order ID (no checkbox column exists there).\n    -->\n\n    <!-- ===== CONTROLLER: admin/controller/sale/order.php ===== -->\n    <file path=\"admin/controller/sale/order.php\">\n\n        <operation error=\"skip\">\n            <search trim=\"true\" index=\"0\"><![CDATA[$this->load->model(\'sale/order\');]]></search>\n            <add position=\"after\"><![CDATA[\n		$this->load->model(\'tool/image\');\n		$this->load->model(\'catalog/product\');]]></add>\n        </operation>\n\n        <operation error=\"skip\">\n            <search trim=\"true\" index=\"0\"><![CDATA[foreach ($results as $result) {]]></search>\n            <add position=\"after\"><![CDATA[\n			$order_product_image = \'\';\n			$order_products_for_image = $this->model_sale_order->getOrderProducts($result[\'order_id\']);\n			if (!empty($order_products_for_image) && !empty($order_products_for_image[0][\'product_id\'])) {\n				$order_first_product = $this->model_catalog_product->getProduct($order_products_for_image[0][\'product_id\']);\n				if ($order_first_product && !empty($order_first_product[\'image\'])) {\n					$order_product_image = $this->model_tool_image->resize(html_entity_decode($order_first_product[\'image\'], ENT_QUOTES, \'UTF-8\'), 50, 50);\n				}\n			}]]></add>\n        </operation>\n\n        <operation error=\"skip\">\n            <search trim=\"true\" index=\"0\"><![CDATA[$data[\'orders\'][] = array(]]></search>\n            <add position=\"after\"><![CDATA[\n				\'product_image\' => $order_product_image,]]></add>\n        </operation>\n\n    </file>\n\n    <!-- ===== VIEW: admin/view/template/sale/order_list.twig ===== -->\n    <file path=\"admin/view/template/sale/order_list.twig\">\n\n        <operation error=\"skip\">\n            <search trim=\"true\"><![CDATA[<td style=\"width: 1px;\" class=\"text-center\"><input type=\"checkbox\" onclick=\"$(\'input[name*=\\\'selected\\\']\').prop(\'checked\', this.checked);\" /></td>]]></search>\n            <add position=\"after\"><![CDATA[\n                    <td class=\"text-center\" style=\"width:60px;\">Image</td>]]></add>\n        </operation>\n\n        <!-- Row image cell: anchored on the checkbox cell\'s closing tag (not\n             \"before order.customer\") so it lands directly after the checkbox\n             cell, in the same column position as the \"Image\" header above -\n             fixes the 1.0.2 misalignment. -->\n        <operation error=\"skip\">\n            <search trim=\"true\"><![CDATA[<input type=\"hidden\" name=\"shipping_code[]\" value=\"{{ order.shipping_code }}\" /></td>]]></search>\n            <add position=\"after\"><![CDATA[\n              <td class=\"text-center\">\n                {% if order.product_image %}\n                  <img src=\"{{ order.product_image }}\" alt=\"\" width=\"50\" height=\"50\" style=\"border-radius:4px; object-fit:cover; border:1px solid #ddd;\">\n                {% else %}\n                  <span style=\"color:#ccc;\">-</span>\n                {% endif %}\n              </td>]]></add>\n        </operation>\n\n    </file>\n\n    <!-- ===== DASHBOARD \"Latest Orders\" widget ===== -->\n    <file path=\"admin/controller/extension/dashboard/recent.php\">\n\n        <operation error=\"skip\">\n            <search trim=\"true\" index=\"0\"><![CDATA[$this->load->model(\'sale/order\');]]></search>\n            <add position=\"after\"><![CDATA[\n		$this->load->model(\'tool/image\');\n		$this->load->model(\'catalog/product\');]]></add>\n        </operation>\n\n        <operation error=\"skip\">\n            <search trim=\"true\" index=\"0\"><![CDATA[foreach ($results as $result) {]]></search>\n            <add position=\"after\"><![CDATA[\n			$order_product_image = \'\';\n			$order_products_for_image = $this->model_sale_order->getOrderProducts($result[\'order_id\']);\n			if (!empty($order_products_for_image) && !empty($order_products_for_image[0][\'product_id\'])) {\n				$order_first_product = $this->model_catalog_product->getProduct($order_products_for_image[0][\'product_id\']);\n				if ($order_first_product && !empty($order_first_product[\'image\'])) {\n					$order_product_image = $this->model_tool_image->resize(html_entity_decode($order_first_product[\'image\'], ENT_QUOTES, \'UTF-8\'), 50, 50);\n				}\n			}]]></add>\n        </operation>\n\n        <operation error=\"skip\">\n            <search trim=\"true\" index=\"0\"><![CDATA[$data[\'orders\'][] = array(]]></search>\n            <add position=\"after\"><![CDATA[\n				\'product_image\' => $order_product_image,]]></add>\n        </operation>\n\n    </file>\n\n    <file path=\"admin/view/template/extension/dashboard/recent_info.twig\">\n\n        <operation error=\"skip\">\n            <search trim=\"true\"><![CDATA[<td class=\"text-right\">{{ column_order_id }}</td>]]></search>\n            <add position=\"after\"><![CDATA[\n          <td class=\"text-center\" style=\"width:60px;\">Image</td>]]></add>\n        </operation>\n\n        <operation error=\"skip\">\n            <search trim=\"true\"><![CDATA[<td class=\"text-right\">{{ order.order_id }}</td>]]></search>\n            <add position=\"after\"><![CDATA[\n          <td class=\"text-center\">\n            {% if order.product_image %}\n              <img src=\"{{ order.product_image }}\" alt=\"\" width=\"40\" height=\"40\" style=\"border-radius:4px; object-fit:cover; border:1px solid #ddd;\">\n            {% else %}\n              <span style=\"color:#ccc;\">-</span>\n            {% endif %}\n          </td>]]></add>\n        </operation>\n\n    </file>\n\n</modification>\n', 1, '2026-07-12 04:26:23');
INSERT INTO `ac_modification` (`modification_id`, `extension_install_id`, `name`, `code`, `author`, `version`, `link`, `xml`, `status`, `date_added`) VALUES
(46, 47, 'DearSoft for OpenCart', 'dearsoft', 'DearSoft', '1.0.0', 'https://www.dearsoft.com.bd', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>DearSoft for OpenCart</name>\n    <version>1.0.0</version>\n    <author>DearSoft</author>\n    <link>https://www.dearsoft.com.bd</link>\n    <code>dearsoft</code>\n\n    <!--\n        Most of this extension\'s behaviour comes from files placed directly\n        into the upload/ directory structure and the catalog/footer/after\n        event registered on install — no XML modification needed for those.\n\n        The operations below wire up the \"AI Write Assistant\" — an \"Ask AI\"\n        helper injected into admin content forms (product, category,\n        information, attribute, review, contact). It calls back into the\n        existing dearsoft module controller (extension/module/dearsoft) and\n        is gated by the \"Enable AI Write Assistant\" toggle on the AI Write\n        Assistant settings tab.\n    -->\n\n    <file path=\"admin/controller/catalog/product.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/product_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_writer\'] = $this->load->controller(\'extension/module/dearsoft/init_form\', array(\'form_type\' => \'product\'));\n                $data[\'dearsoft_bgremover\'] = $this->load->controller(\'extension/module/dearsoft/init_bgremover\');\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/product_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_writer }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <!--\n        Review Assistant — adds a \"Review Assistant\" tab to the product edit\n        page (enable per product, override the Google/Facebook review URLs,\n        get a per-product QR code/link) and persists it alongside the normal\n        product save. Anchors confirmed against stock OpenCart 3.0.5.0 core\n        source: getForm()\'s setOutput() call and editProduct() are unique,\n        literal lines in admin/controller/catalog/product.php; the tab-seo\n        <li> and pane are stable, unique markers in product_form.twig.\n    -->\n    <file path=\"admin/controller/catalog/product.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/product_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $reviewTab = $this->load->controller(\'extension/module/dearsoft/init_review_tab\', array(\n                    \'product_id\' => isset($this->request->get[\'product_id\']) ? (int)$this->request->get[\'product_id\'] : 0\n                ));\n                $data[\'dearsoft_review\'] = $reviewTab[\'html\'];\n                $data[\'dearsoft_review_tab_label\'] = $reviewTab[\'label\'];\n            ]]></add>\n        </operation>\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->model_catalog_product->editProduct($this->request->get[\'product_id\'], $this->request->post);\n            ]]></search>\n            <add position=\"after\" trim=\"true\" offset=\"0\"><![CDATA[\n                $this->load->model(\'extension/module/dearsoft\');\n                $this->model_extension_module_dearsoft->saveReviewProductSettings((int)$this->request->get[\'product_id\'], $this->request->post);\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/product_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                <a href=\"#tab-seo\" data-toggle=\"tab\">{{ tab_seo }}</a></li>\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                <li><a href=\"#tab-review-assistant\" data-toggle=\"tab\">{{ dearsoft_review_tab_label }}</a></li>\n            ]]></add>\n        </operation>\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                <div class=\"tab-pane\" id=\"tab-seo\">\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_review|default(\'\')|raw }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <!--\n        Key Feature Writer — adds a \"Generate Features (AI)\" button next to\n        the (separate, pre-existing, third-party) \"DearSoft Short Description\n        Attribute\" extension\'s Featured Text table on the product edit page.\n\n        Deliberately does NOT anchor on that extension\'s own injected button\n        markup: this modification and that extension\'s are two independent\n        ocmod entries (different <code>), and their relative compile order\n        isn\'t guaranteed — anchoring on content ANOTHER modification injects\n        is order-dependent and silently no-ops if this one compiles first.\n        Instead, keyfeature.js finds the #short-attribute table at runtime\n        (a stable DOM id, confirmed on this site\'s live rendered page) and\n        inserts the button client-side, after both extensions\' server-\n        rendered HTML already exists in the DOM — order-independent by\n        construction. The only ocmod anchor here is the always-present,\n        stock {{ footer }} line.\n    -->\n    <file path=\"admin/controller/catalog/product.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/product_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_keyfeature_enabled\'] = $this->config->get(\'module_dearsoft_keyfeature_enabled\') !== \'0\';\n                $data[\'dearsoft_keyfeature_url\'] = $this->url->link(\'extension/module/dearsoft/keyFeatureGenerate\', \'user_token=\' . $this->session->data[\'user_token\'], true);\n                $data[\'dearsoft_keyfeature_js_version\'] = @filemtime(DIR_APPLICATION . \'view/javascript/dearsoft/keyfeature.js\') ?: time();\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/product_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {% if dearsoft_keyfeature_enabled %}\n                <script type=\"text/javascript\">\n                    var dearsoftKeyfeatureUrl = {{ dearsoft_keyfeature_url|replace({\'&amp;\': \'&\'})|json_encode|raw }};\n                </script>\n                <script type=\"text/javascript\" src=\"view/javascript/dearsoft/keyfeature.js?v={{ dearsoft_keyfeature_js_version }}\"></script>\n                {% endif %}\n            ]]></add>\n        </operation>\n    </file>\n\n    <!--\n        Review Assistant — storefront \"Write a Review\" button embedded\n        directly into the product page (in addition to the QR/link and the\n        optional floating site-wide button). Anchor confirmed against this\n        site\'s actual live theme files (both journal3 — the active theme —\n        and default, for portability): {% if minimum > 1 %} is a stable,\n        unique marker right after the add-to-cart button in both, outside\n        any theme-specific conditional block, in catalog/controller/product/\n        product.php\'s setOutput() call and the two product.twig files.\n    -->\n    <file path=\"catalog/controller/product/product.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'product/product\', $data));\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_review_button\'] = $this->load->controller(\'extension/module/dearsoft_review/productButton\', array(\n                    \'product_id\' => (int)$this->request->get[\'product_id\']\n                ));\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/view/theme/journal3/template/product/product.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {% if minimum > 1 %}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_review_button|default(\'\')|raw }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"catalog/view/theme/default/template/product/product.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {% if minimum > 1 %}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_review_button|default(\'\')|raw }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/controller/catalog/category.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/category_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_writer\'] = $this->load->controller(\'extension/module/dearsoft/init_form\', array(\'form_type\' => \'category\'));\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/category_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_writer }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <!--\n        Review Assistant — category-wise scope. Same shape as the product-tab\n        hook above (init_category_review_tab / saveReviewCategorySettings),\n        anchored on category\'s own editCategory() call and its tab-seo\n        <li>/pane — confirmed against the live category.php/category_form.twig\n        (same tab set as product: general/data/seo/design).\n    -->\n    <file path=\"admin/controller/catalog/category.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/category_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $categoryReviewTab = $this->load->controller(\'extension/module/dearsoft/init_category_review_tab\', array(\n                    \'category_id\' => isset($this->request->get[\'category_id\']) ? (int)$this->request->get[\'category_id\'] : 0\n                ));\n                $data[\'dearsoft_category_review\'] = $categoryReviewTab[\'html\'];\n                $data[\'dearsoft_category_review_tab_label\'] = $categoryReviewTab[\'label\'];\n            ]]></add>\n        </operation>\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->model_catalog_category->editCategory($this->request->get[\'category_id\'], $this->request->post);\n            ]]></search>\n            <add position=\"after\" trim=\"true\" offset=\"0\"><![CDATA[\n                $this->load->model(\'extension/module/dearsoft\');\n                $this->model_extension_module_dearsoft->saveReviewCategorySettings((int)$this->request->get[\'category_id\'], $this->request->post);\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/category_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                <a href=\"#tab-seo\" data-toggle=\"tab\">{{ tab_seo }}</a></li>\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                <li><a href=\"#tab-review-assistant\" data-toggle=\"tab\">{{ dearsoft_category_review_tab_label }}</a></li>\n            ]]></add>\n        </operation>\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                <div class=\"tab-pane\" id=\"tab-seo\">\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_category_review|default(\'\')|raw }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/controller/catalog/information.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/information_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_writer\'] = $this->load->controller(\'extension/module/dearsoft/init_form\', array(\'form_type\' => \'information\'));\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/information_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_writer }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/controller/catalog/attribute.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/attribute_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_writer\'] = $this->load->controller(\'extension/module/dearsoft/init_form\', array(\'form_type\' => \'attribute\'));\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/attribute_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_writer }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/controller/catalog/review.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'catalog/review_form\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_writer\'] = $this->load->controller(\'extension/module/dearsoft/init_form\', array(\'form_type\' => \'review\'));\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/catalog/review_form.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_writer }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/controller/marketing/contact.php\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                $this->response->setOutput($this->load->view(\'marketing/contact\'\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                $data[\'dearsoft_writer\'] = $this->load->controller(\'extension/module/dearsoft/init_form\', array(\'form_type\' => \'contact\'));\n            ]]></add>\n        </operation>\n    </file>\n\n    <file path=\"admin/view/template/marketing/contact.twig\">\n        <operation>\n            <search trim=\"true\" index=\"0\"><![CDATA[\n                {{ footer }}\n            ]]></search>\n            <add position=\"before\" trim=\"true\" offset=\"0\"><![CDATA[\n                {{ dearsoft_writer }}\n            ]]></add>\n        </operation>\n    </file>\n\n    <!-- ============================================================ -->\n    <!-- DearSoft Products Image Manager (merged module)               -->\n    <!-- ============================================================ -->\n\n<!--for version 3.x view twig modif-->\n<file path=\"admin/view/template/catalog/product_form.twig\" error=\"skip\">\n  <operation info=\"view html modif\">\n  <search regex=\"true\" limit=\"1\"><![CDATA[/(<div[^>]*?id[^>]*?tab-image[^>]*?>).*(<div[^>]*?id[^>]*?tab-reward[^>]*?>)/s]]></search>\n  <add position=\"replace\"><![CDATA[\n              <div class=\"tab-pane\" id=\"tab-image\">\n                <div class=\"table-responsive\">\n                <!--DS PRODUCTS IMAGE MANAGER-->\n                  <!-- Drop zone -->\n                  <div id=\"drop-files\" >\n                    <p style=\"\">{{pim_data[\'lang\'][\'dad_an_image\']}}</p>\n                    <i>{{pim_data[\'lang\'][\'select_below\']}}</i>\n                    <div id=\"frm\" >\n                      <input type=\"file\" id=\"file-input\" multiple=\"multiple\" accept=\"image/jpeg,image/png,image/gif,image/bmp\">\n                      <label id=\"byPc\" for=\"file-input\" style=\"\">\n                        <i class=\"fa fa-cloud-upload\" aria-hidden=\"true\"></i><br>\n                        {{pim_data[\'lang\'][\'upload\']}}\n                      </label><button type=\"button\" id=\"bySer\">\n                        <label>\n                          <i class=\"fa fa-cloud\" aria-hidden=\"true\"></i><br>\n                          {{pim_data[\'lang\'][\'server\']}}\n                        </label>\n                      </button><label id=\"byUrl\" for=\"url-input\" >\n                        <i class=\"fa fa-external-link-square\" aria-hidden=\"true\"></i><br>\n                        {{pim_data[\'lang\'][\'link\']}}\n                      </label>\n                      <div id=\"url-input\">\n                        <span>\n                          <input type=\"text\" placeholder =\"http://dearsoft.com.bd/image.jpg\">\n                          <button class=\"btn btn-info\" type=\"button\"  >Ok</button>\n                        </span>\n                      </div>\n                    </div>\n                    {% if pim_data[\'permission\'] %}\n                    <!-- settings button -->\n                    <button id=\"pim_settings\" type=\"button\" class=\"pim-settings btn btn-default\"><i class=\"fa fa-cog\" aria-hidden=\"true\"></i></button>\n                    {% endif %}\n                  </div>\n                  <!-- View zone -->\n                  <div id=\"images\" >\n                    <div  id=\"list-view\">\n                      {% set image_row = 0 %}\n                      {% set product_images = [{\"image\":image,\"thumb\":thumb,\"sort_order\": 0}]|merge(product_images) %}\n                      {% if image %}\n                      {% for key, product_image in product_images %}\n                      <div class=\"image old\" {% if (poip_installed ?? false) and ( (poip_global_settings[\'options_images_edit\'] ?? 0) == 1 ) %} data-poip = {{ product_image|json_encode }} {% endif %} >\n                        <span class=\'previewImg\'><img src =\'{{product_image.thumb}}\' /></span>\n                        <span class=\"btm_img\">\n                          <i class=\"fa fa-search-plus\" data-toggle=\"tooltip\" title=\"{{pim_data[\'lang\'][\'zoom\']}}\" aria-hidden=\"true\"></i><i class=\"fa fa-times\" data-toggle=\"tooltip\" title=\"{{pim_data[\'lang\'][\'delete\']}}\" aria-hidden=\"true\" ></i>\n                          <i class=\"fa fa-del-all fa-flip-horizontal\" data-toggle=\"tooltip\" data-original-title=\"{{pim_data[\'lang\'][\'delete_all\']}}\" aria-hidden=\"true\" ></i>\n                          <i class=\"fa fa-magic dearsoft-analyze-img\" data-toggle=\"tooltip\" title=\"Analyze with AI\" data-image-url=\"{{product_image.thumb}}\" aria-hidden=\"true\"></i>\n                        </span>\n                        <input  {% if image_row == 0 %} id=\"input-image\" {% endif %} class = \"img-input\" value=\"{{product_image.image}}\"  type=\"hidden\" >\n                      </div>\n                      {% set image_row = key + 1 %}\n                      {% endfor %}\n                      {% endif %}\n                    </div >\n                  </div>\n                  {{ dearsoft_bgremover|default(\'\')|raw }}\n                <!--/DS PRODUCTS IMAGE MANAGER-->\n                </div>\n              </div>\n              $2]]></add>\n  </operation>\n  <operation info=\"view scripts\">\n  <search ><![CDATA[{{ footer }}]]></search>\n  <add position=\"before\" ><![CDATA[\n   <!--DS PRODUCTS IMAGE MANAGER-->\n  {% if poip_global_settings and poip_global_settings[\'options_images_edit\'] %}\n  	<script type=\"text/javascript\" src=\"view/template/extension/ds_products_image_manager/js/poip-support.js\"></script>\n  {% endif %}\n  <script type=\"text/javascript\">pimJson = {{pim_data|json_encode()}}</script>\n  <script type=\"text/javascript\" src=\"view/template/extension/ds_products_image_manager/js/jquery-ui.js\"></script>\n  <script type=\"text/javascript\" src=\"view/template/extension/ds_products_image_manager/js/pim.js?v=3.1.2\"></script>\n   <!--/DS PRODUCTS IMAGE MANAGER-->\n  ]]></add>\n  </operation>\n</file>\n\n<!--for version 2.x view tpl modif-->\n<file path=\"admin/view/template/catalog/product_form.tpl\" error=\"skip\">\n  <operation info=\"view html modif\">\n  <search regex=\"true\" limit=\"1\"><![CDATA[/(<div[^>]*?id[^>]*?tab-image[^>]*?>).*(<div[^>]*?id[^>]*?tab-reward[^>]*?>)/s]]></search>\n  <add position=\"replace\"><![CDATA[\n              <div class=\"tab-pane\" id=\"tab-image\">\n                <div class=\"table-responsive\">\n                <!--DS PRODUCTS IMAGE MANAGER-->\n                  <!-- Drop zone -->\n                  <div id=\"drop-files\" >\n                    <p style=\"\"><?php echo $pim_data[\'lang\'][\'dad_an_image\'] ?></p>\n                    <i><?php echo $pim_data[\'lang\'][\'select_below\'] ?></i>\n                    <div id=\"frm\" >\n                      <input type=\"file\" id=\"file-input\" multiple=\"multiple\" accept=\"image/jpeg,image/png,image/gif,image/bmp\">\n                      <label id=\"byPc\" for=\"file-input\" style=\"\">\n                        <i class=\"fa fa-cloud-upload\" aria-hidden=\"true\"></i><br>\n                        <?php echo $pim_data[\'lang\'][\'upload\'] ?>\n                      </label><button type=\"button\" id=\"bySer\">\n                        <label>\n                          <i class=\"fa fa-cloud\" aria-hidden=\"true\"></i><br>\n                          <?php echo $pim_data[\'lang\'][\'server\'] ?>\n                        </label>\n                      </button><label id=\"byUrl\" for=\"url-input\" >\n                        <i class=\"fa fa-external-link-square\" aria-hidden=\"true\"></i><br>\n                        <?php echo $pim_data[\'lang\'][\'link\'] ?>\n                      </label>\n                      <div id=\"url-input\">\n                        <span>\n                          <input type=\"text\" placeholder =\"http://dearsoft.com.bd/image.jpg\">\n                          <button class=\"btn btn-info\" type=\"button\"  >Ok</button>\n                        </span>\n                      </div>\n                    </div>\n                    <?php if($pim_data[\'permission\']) : ?>\n                    <!-- settings button -->\n                    <button id=\"pim_settings\" type=\"button\" class=\"pim-settings btn btn-default\"><i class=\"fa fa-cog\" aria-hidden=\"true\"></i></button>\n                    <?php endif; ?>\n                  </div>\n                  <!-- View zone -->\n                  <div id=\"images\" >\n                    <div  id=\"list-view\">\n                    <?php $image_row = 0; ?>\n                    <?php array_unshift($product_images,array(\"image\" =>$image,\"thumb\" =>$thumb,\"sort_order\" => 0)); ?>\n                    <?php if($image) : ?>\n                    <?php foreach ($product_images as $key=> $val) : ?>\n                      <div class=\"image old\" <?php if( isset($poip_installed) and $poip_global_settings[\'options_images_edit\'] ) echo \'data-poip =\"\' . json_encode($product_image) . \'\"\'; ?> >\n                        <span class=\'previewImg\'><img src =\"<?php echo $val[\'thumb\']; ?>\" /></span>\n                        <span class=\"btm_img\">\n                          <i class=\"fa fa-search-plus\" data-toggle=\"tooltip\" title=\"<?php echo $pim_data[\'lang\'][\'zoom\'] ?>\" aria-hidden=\"true\"></i><i class=\"fa fa-times\" data-toggle=\"tooltip\" title=\"<?php echo $pim_data[\'lang\'][\'delete\'] ?>\" aria-hidden=\"true\" ></i>\n                          <i class=\"fa fa-del-all fa-flip-horizontal\" data-toggle=\"tooltip\" data-original-title=\"<?php echo $pim_data[\'lang\'][\'delete_all\'] ?>\" aria-hidden=\"true\" ></i>\n                          <i class=\"fa fa-magic dearsoft-analyze-img\" data-toggle=\"tooltip\" title=\"Analyze with AI\" data-image-url=\"<?php echo $val[\'thumb\']; ?>\" aria-hidden=\"true\"></i>\n                        </span>\n                        <input  <?php echo $image_row == 0 ? \'id=\"input-image\"\' : \'\'; ?> class = \"img-input\" value=\"<?php echo $val[\'image\']; ?>\"  type=\"hidden\" >\n                      </div>\n                    <?php $image_row = $key + 1; ?>\n                    <?php endforeach; ?>\n                    <?php endif; ?>\n                    </div >\n                  </div>\n                  <?php echo isset($dearsoft_bgremover) ? $dearsoft_bgremover : \'\'; ?>\n                <!--/DS PRODUCTS IMAGE MANAGER-->\n                </div>\n              </div>\n              $2]]></add>\n   </operation>\n  <operation info=\"view scripts\">\n  <search ><![CDATA[<?php echo $footer; ?>]]></search>\n  <add position=\"before\" ><![CDATA[\n  <!--DS PRODUCTS IMAGE MANAGER-->\n  	<?php if(isset($poip_global_settings) and $poip_global_settings[\'options_images_edit\']) : ?>\n  		<script type=\"text/javascript\" src=\"view/template/extension/ds_products_image_manager/js/poip-support.js\"></script>\n	<?php endif ?>\n    <script type=\"text/javascript\">pimJson = <?php echo json_encode($pim_data); ?></script>\n    <script type=\"text/javascript\" src=\"view/template/extension/ds_products_image_manager/js/jquery-ui.js\"></script>\n    <script type=\"text/javascript\" src=\"view/template/extension/ds_products_image_manager/js/pim.js?v=3.1.2\"></script>\n  <!--/DS PRODUCTS IMAGE MANAGER-->\n   ]]></add>\n   </operation>\n</file>\n\n<!-- controller php modif -->\n<file path=\"admin/controller/catalog/product.php\">\n  <operation info=\"pim main methods\" error = \"log\" >\n  <search ><![CDATA[public function add() {]]></search>\n  <add position=\"before\" >\n     <![CDATA[\n    //DS PRODUCTS IMAGE MANAGER->\n      public function encodeLinkImage()\n      {\n        if(!empty($_POST[\'urls\']))\n        {\n          $url = $_POST[\'urls\'];\n\n          if(@getimagesize($_POST[\'urls\']))\n          {\n            $prop = preg_replace(\"#(\\.(jpe?g|png|gif|bmp)).*|\\W((?<!-|\\/))#i\", \'$1\', $url);\n            $prop = pathinfo($prop);\n\n            if(isset($prop[\'extension\']))\n            {\n              $type = $prop[\'extension\'];\n              $name = $prop[\'basename\'];\n            }\n            else\n            {\n              $type = \'jpeg\';\n              $name = $prop[\'basename\'] . \'.\' . $type;\n            }\n\n            echo  json_encode([\'src\'=>\'data:image/\' . $type . \';base64,\'.base64_encode(file_get_contents($url)),\'name\'=>$name]);\n          }\n          else\n          {\n            echo json_encode([\'src\'=>\'\',\'name\'=>\'\']);\n          }\n        }\n      }\n\n      public function productsImageManagerSettings($inner = false, $data = [])\n      {\n\n        if(empty($_POST[\'settings\']) && !$inner)\n        {\n          return false;\n        }\n        elseif($inner)\n        {\n          $content = $inner;\n        }\n        else\n        {\n          $content = $_POST[\'settings\'];\n        }\n\n        $this->load->language(\'catalog/product\');\n\n        $pimLang = (array) $this->language->get(\'ds_pim\');\n\n        $__ = function ($key) use ($pimLang)\n        {\n          return isset($pimLang[$key]) ? $pimLang[$key] : $key;\n        };\n\n        $permission  = $this->user->hasPermission(\'modify\', \'setting/setting\');\n\n        $response[\'content\'] = [\'max_images\'=>20,\'image_size\'=>2,\'image_quality\'=>10,\'image_name\'=>\'default\',\'upload_folder\'=>\'{monufacturer}|products_{year}\',\'remove_images\'=>3];\n\n        $dir = rtrim(DIR_APPLICATION . \"view/template/extension/ds_products_image_manager/include/\");\n\n        // Find image link\n        if (!empty($this->request->server[\'HTTPS\']))\n        {\n          $server = HTTPS_CATALOG;\n          $serverAdmin = HTTPS_SERVER;\n        }\n        else\n        {\n          $server = HTTP_CATALOG;\n          $serverAdmin = HTTP_SERVER;\n        }\n\n        //get setting\n\n        if($content === \'modal.html\' || $content === \'settings.json\')\n        {\n          if($permission)\n          {\n            if (is_file($dir . $content))\n            {\n              $response[\'content\'] = strpos($content, \'.json\') ? json_decode(file_get_contents($dir . $content),true) : file_get_contents($dir . $content);\n              $response[\'success\'] = \' Success: \' .  $__(\'received_success\') . date(\"Y-m-d - H:i:s\");\n            }\n            else\n            {\n              $response[\'error\'] = \' Error: \' . $__(\'file_error\') . $dir . $content;\n            }\n          }\n          elseif (!$inner)\n          {\n            $response[\'error\'] = \' Warning: \' . $__(\'permission_error\');\n          }\n\n          if($inner)\n          {\n\n            if (is_file($dir . $content))\n            {\n              $response[\'content\'] = strpos($content, \'.json\') ? json_decode(file_get_contents($dir . $content),true) : file_get_contents($dir . $content);\n            }\n\n            $tokenKey = intval(VERSION) > 2 ? \'user_token\' : \'token\';\n\n            $response[\'lang\'] = $pimLang;\n            $response[\'permission\'] = $permission;\n            $response[\'token\'] =  \"&$tokenKey=\" . $this->session->data[$tokenKey];\n            $response[\'images_path\'] =  $server . \'image/\';\n            $response[\'wm_bg\'] = $serverAdmin . \'view/template/extension/ds_products_image_manager/include/wm_bg.png\';\n            $response[\'year\']  =  date(\'Y\');\n            $response[\'month\'] =  date(\'m\');\n            $response[\'day\']   =  date(\'d\');\n            $response[\'product_id\']  =  !isset($this->request->get[\'product_id\']) ? 0 : $this->request->get[\'product_id\'];\n\n            return $response;\n          }\n\n          echo json_encode($response);\n          return;\n        }\n\n\n\n        //save setting and watermark\n        if ($content && !$inner && $permission)\n        {\n          parse_str(html_entity_decode($content), $set);\n\n          if(isset($set[\'max_images\'],$set[\'image_size\'],$set[\'image_quality\'],$set[\'image_name\'],$set[\'upload_folder\'],$set[\'remove_images\']))\n          {\n            empty($set[\'max_images\']) ? $set[\'max_images\'] = 1 : null;\n\n            if (!isset($set[\'watermark\'],$set[\'watermark_status\']))\n            {\n              $set[\'watermark_status\'] = false;\n            }\n            //watermark image upload\n            else if(!strpos($set[\'watermark\'][\'src\'], \'watermark.png\'))\n            {\n              $src = $set[\'watermark\'][\'src\'];\n\n              $watermark = $server . \'image/watermark.png\' . \'?v=\' . time();\n\n              if(strpos($src, \'data:image/png;base64\') === 0)\n              {\n                $src = base64_decode(str_replace(\'data:image/png;base64,\', \'\', $src));\n\n                file_put_contents(DIR_IMAGE . \'watermark.png\', $src);\n              }\n              elseif(@getimagesize($src))\n              {\n                file_put_contents(DIR_IMAGE . \'watermark.png\', file_get_contents($src));\n              }\n              else\n              {\n                $watermark = \'\';\n              }\n\n\n              $set[\'watermark\'][\'src\'] = $watermark;\n            }\n\n            if(is_dir($dir))\n            {\n              //file write\n              $settingsFile = fopen($dir . \'settings.json\',\'w\');\n\n              fwrite($settingsFile,json_encode($set));\n\n              fclose($settingsFile);\n\n              $response[\'content\'] = $set;\n              $response[\'success\'] = \' Success: \' . $__(\'save_success\') . \' \' . date(\"Y-m-d - H:i:s\");\n            }\n            else\n            {\n              $response[\'error\'] = \' Error: \' . $__(\'nodir_error\') . \' (\' . $dir . \')\';\n            }\n\n          }\n          else\n          {\n            $response[\'error\'] = \' Error: \' . $__(\'save_error\');\n          }\n\n          echo json_encode($response);\n\n        }\n      }\n\n\n      public function uploadNewImage()\n      {\n        if(strtolower($_SERVER[\'REQUEST_METHOD\'])==\'post\')\n        {\n\n          if(!empty($_POST[\"dels\"]))\n          {\n            $this->delProductImage($_POST[\"dels\"]);\n          }\n\n          if(!empty($_FILES))\n          {\n            $dir = rtrim(DIR_IMAGE.$_POST[\"catalog\"]);\n\n            if(!is_dir($dir))\n            {\n              mkdir($dir,0755,true);\n            }\n\n            foreach($_FILES as $file)\n            {\n              move_uploaded_file($file[\"tmp_name\"],$dir.$file[\"name\"]);\n            }\n          }\n        }\n      }\n\n      public function imageExist()\n      {\n        if(isset($_POST))\n        {\n          header(\'Content-Type: application/json\');\n          $imgpath=rtrim($_POST[\"name\"]);\n          $namearr=preg_split(\'/\\.(?=[^.]*$)/i\',$imgpath);\n          $nIdx=0;\n\n          do\n          {\n            $filepath=$nIdx!=0 ? $namearr[0].\'-\'.$nIdx.\'.\'.$namearr[1] : $imgpath;\n\n            if(!is_file(DIR_IMAGE.$filepath))\n            {\n              echo json_encode(array(\"newname\"=>preg_replace(\"/\\S*\\/(?=\\S*$)/i\",\"\",$filepath),\"status\"=>$nIdx));\n\n              break;\n            }\n          }\n\n          while(++$nIdx);\n        }\n\n        die();\n      }\n\n      public function delProductImage($delInfo)\n      {\n        $this->load->model(\'catalog/product\');\n        if(!is_array($delInfo))\n        {\n          $unlikUrls=array();\n          $parsedProductImage = $this->model_catalog_product->parseProductImage($delInfo);\n\n          foreach($parsedProductImage as $key=>$value)\n          {\n            if(isset($value[\"description\"]))\n            {\n              $search = preg_replace(\'/\\S*(?=(\\\\\\\\)\\/\\S*\\/\\S*\\/$)/i\',\"\",preg_replace(\"/\\\\\\|\\//\",\"\\/\",DIR_IMAGE));\n\n              preg_match_all(\"/(?<=\".$search.\")\\S*(?=&quot;)/im\",$value[\"description\"],$newUrls);\n              $unlikUrls=array_merge($newUrls[0],$unlikUrls);\n            }\n            else\n            {\n              $unlikUrls[]=$value[\"image\"];\n            }\n          }\n\n          $delInfo=array(\'id\'=>$delInfo,\'value\'=>array_unique($unlikUrls));\n        }\n\n        foreach($delInfo[\"value\"] as $value)\n        {\n          $imgIs=$this->model_catalog_product->getUnlikUrls($delInfo[\"id\"],$value)->rows[\"0\"][\"result\"];\n\n          if($imgIs==0  &&  $value  &&  file_exists(DIR_IMAGE.$value))\n          {\n            unlink(DIR_IMAGE.$value);\n          }\n        }\n      }\n    //<-DS PRODUCTS IMAGE MANAGER\n  ]]>\n  </add>\n  </operation>\n\n  <operation info=\"thumb images size modif\">\n        <search regex=\"true\"  ><![CDATA[/resize\\((.*?), 100, 100\\)/]]></search>\n        <add position=\"replace\" ><![CDATA[resize($1, 200, 200)/*DS PRODUCTS IMAGE MANAGER-> replace 100x100 to 200x200*/]]></add>\n  </operation>\n\n  <operation info=\"on product del remove images status\">\n   <search ><![CDATA[public function delete() {]]></search>\n  <add position=\"after\"><![CDATA[\n      //DS PRODUCTS IMAGE MANAGER->\n      $settings = $this->productsImageManagerSettings(\'settings.json\');\n      //<-DS PRODUCTS IMAGE MANAGER\n    ]]></add>\n  </operation>\n\n  <operation info=\"on product del remove images method call\">\n   <search ><![CDATA[$this->model_catalog_product->deleteProduct($product_id);]]></search>\n  <add position=\"before\"><![CDATA[\n          //DS PRODUCTS IMAGE MANAGER->\n          if($settings[\'content\'][\'remove_images\'] == \'1\' || $settings[\'content\'][\'remove_images\'] == \'3\')\n          {\n            $this->delProductImage($product_id);\n          }\n          //<-DS PRODUCTS IMAGE MANAGER\n    ]]></add>\n  </operation>\n\n  <operation info=\"view datas\">\n              <search ><![CDATA[protected function getForm() {]]></search>\n  <add position=\"after\"><![CDATA[\n      //DS PRODUCTS IMAGE MANAGER->\n      $this->document->addStyle(\'view/template/extension/ds_products_image_manager/css/pim.css?v=3.0.8\');\n      $data[\'pim_data\'] = $this->productsImageManagerSettings(\'settings.json\');\n      //<-DS PRODUCTS IMAGE MANAGER\n  ]]></add>\n  </operation>\n</file>\n\n<!-- model.php modif -->\n<file path=\"admin/model/catalog/product.php\">\n  <operation info=\"model methods\">\n  <search><![CDATA[public function deleteProduct($product_id)]]></search>\n  <add position=\"before\"><![CDATA[\n  //DS PRODUCTS IMAGE MANAGER ->\n    public function getUnlikUrls($id,$value)\n    {\n      $query=$this->db->query(\"SELECT EXISTS(\n      SELECT DISTINCT image FROM \".DB_PREFIX.\"product_image WHERE image LIKE \'%$value%\' AND product_id!=$id\n      UNION SELECT DISTINCT image FROM \".DB_PREFIX.\"product WHERE image LIKE \'%$value%\' AND product_id!=$id\n      UNION SELECT DISTINCT image FROM \".DB_PREFIX.\"manufacturer WHERE image LIKE \'%$value%\'\n      UNION SELECT DISTINCT image FROM \".DB_PREFIX.\"banner_image WHERE image LIKE \'%$value%\'\n      UNION SELECT DISTINCT image FROM \".DB_PREFIX.\"category WHERE image LIKE \'%$value%\'\n      UNION SELECT DISTINCT image FROM \".DB_PREFIX.\"option_value WHERE image LIKE \'%$value%\'\n      UNION SELECT DISTINCT description FROM \".DB_PREFIX.\"product_description WHERE description LIKE \'%$value%\' AND product_id!=$id\n      UNION SELECT DISTINCT description FROM \".DB_PREFIX.\"information_description WHERE description LIKE \'%$value%\'\n      UNION SELECT DISTINCT description FROM \".DB_PREFIX.\"category_description WHERE description LIKE \'%$value%\') AS result\"); return $query;\n    }\n    public function parseProductImage($id)\n    {\n      $query=$this->db->query(\"SELECT DISTINCT image FROM \".DB_PREFIX.\"product_image WHERE product_id=$id\n      UNION SELECT DISTINCT image FROM \".DB_PREFIX.\"product WHERE product_id=$id\");\n      $query_d=$this->db->query(\"SELECT DISTINCT description FROM \".DB_PREFIX.\"product_description WHERE product_id=$id\");\n      $query->rows[]=$query_d->rows[0]; return $query->rows;\n    }\n  //<-DS PRODUCTS IMAGE MANAGER\n  ]]></add>\n  </operation>\n</file>\n\n\n<!-- language add -->\n<file path=\"admin/language/en*/catalog/product.php\">\n  <operation info=\"language\">\n  <search ><![CDATA[<?php]]></search>\n  <add position=\"after\"><![CDATA[\n  //DS PRODUCTS IMAGE MANAGER ->\n    //pim drop zone lang\n    $_[\'ds_pim\'][\'u_up_max\']    = \'Upload a maximum of\';\n    $_[\'ds_pim\'][\'images\']        = \'images\';\n    $_[\'ds_pim\'][\'dad_an_image\']  = \'Drag & Drop an image\';\n    $_[\'ds_pim\'][\'image_damaged\'] = \'This image is damaged!\';\n    $_[\'ds_pim\'][\'select_below\']  = \'or select an option below\';\n    $_[\'ds_pim\'][\'zoom\']          = \'Zoom\';\n    $_[\'ds_pim\'][\'upload\']        = \'Upload\';\n    $_[\'ds_pim\'][\'link\']          = \'Link\';\n    $_[\'ds_pim\'][\'server\']        = \'Server\';\n    $_[\'ds_pim\'][\'loading\']       = \'Loading \';\n    $_[\'ds_pim\'][\'exist\']         = \'Image already exists!\';\n    $_[\'ds_pim\'][\'keep_old\']      = \'Take old\';\n    $_[\'ds_pim\'][\'keep_both\']     = \'Keep both\';\n    $_[\'ds_pim\'][\'replace\']       = \'Replace\';\n    $_[\'ds_pim\'][\'delete\']        = \'Remove\';\n    $_[\'ds_pim\'][\'delete_all\']    = \'Remove next all\';\n    $_[\'ds_pim\'][\'mAdd\']          = \'Multiple Add\';\n\n    //pim modal lang\n    $_[\'ds_pim\'][\'pim\']             = \'Products image manager\';\n    $_[\'ds_pim\'][\'settings\']        = \'Settings\';\n    $_[\'ds_pim\'][\'max_images\']      = \'Max images\';\n    $_[\'ds_pim\'][\'max_image_size\']  = \'Reduce size\';\n    $_[\'ds_pim\'][\'resolution\']      = \'Resolution\';\n    $_[\'ds_pim\'][\'image_quality\']   = \'Reduce quality\';\n    $_[\'ds_pim\'][\'remove_images\']   = \'Remove images\';\n    $_[\'ds_pim\'][\'when_should\']     = \'When should remove images from the server\';\n    $_[\'ds_pim\'][\'do_not\']          = \'Do not\';\n    $_[\'ds_pim\'][\'when_pro_is_del\'] = \'When product is deleted\';\n    $_[\'ds_pim\'][\'when_rem_4_pro\']  = \'When removed from product\';\n    $_[\'ds_pim\'][\'anyway\']          = \'Anyway\';\n    $_[\'ds_pim\'][\'image_name\']      = \'Image name\';\n    $_[\'ds_pim\'][\'default\']         = \'Default\';\n    $_[\'ds_pim\'][\'random\']          = \'Random\';\n    $_[\'ds_pim\'][\'translit\']        = \'Translit\';\n    $_[\'ds_pim\'][\'example\']         = \'Example\';\n    $_[\'ds_pim\'][\'upload_folder\']   = \'Upload folder\';\n    $_[\'ds_pim\'][\'ask_me\']          = \'Ask me\';\n    $_[\'ds_pim\'][\'top_left\']        = \'Top left\';\n    $_[\'ds_pim\'][\'bottom_left\']     = \'Bottom left\';\n    $_[\'ds_pim\'][\'top_right\']       = \'Top right\';\n    $_[\'ds_pim\'][\'bottom_right\']    = \'Bottom right\';\n    $_[\'ds_pim\'][\'center\']          = \'Center\';\n    $_[\'ds_pim\'][\'multiple\']        = \'Multiple\';\n    $_[\'ds_pim\'][\'position\']        = \'Position\';\n    $_[\'ds_pim\'][\'text_or_url\']     = \'Insert an image url or a text\';\n    $_[\'ds_pim\'][\'size\']            = \'Size\';\n    $_[\'ds_pim\'][\'opacity\']         = \'Opacity\';\n    $_[\'ds_pim\'][\'dimensions\']      = \'Dimensions\';\n    $_[\'ds_pim\'][\'transmittance\']   = \'Transmittance\';\n    $_[\'ds_pim\'][\'watermark\']       = \'Watermark\';\n    $_[\'ds_pim\'][\'watermark_not_found\']= \'Watermark image not found: Please try another image link or use any text!\';\n\n    //text  success\n    $_[\'ds_pim\'][\'save_success\']    = \'You have modified settings!\';\n    $_[\'ds_pim\'][\'received_success\']= \'Content received!\';\n\n    //text error\n    $_[\'ds_pim\'][\'nodir_error\']     = \'Undefined directory\';\n    $_[\'ds_pim\'][\'save_error\']      = \'You did not modify the DS PIM settings!\';\n    $_[\'ds_pim\'][\'file_error\']      = \'Undefined file\';\n    $_[\'ds_pim\'][\'permission_error\']= \'You do not have permission to modify the DS PIM settings!\';\n  //<-DS PRODUCTS IMAGE MANAGER\n  ]]></add>\n  </operation>\n</file>\n\n</modification>\n', 1, '2026-07-11 21:25:58'),
(48, 49, 'DearSoft Anti-Spam Order Guard', 'dearsoft_antispam_orders', 'DearSoft', '1.1.0', 'https://dev.deargroup.co', '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>DearSoft Anti-Spam Order Guard</name>\n    <code>dearsoft_antispam_orders</code>\n    <version>1.1.0</version>\n    <author>DearSoft</author>\n    <link>https://dev.deargroup.co</link>\n\n    <!--\n        Rate-limits at the exact moment a Cash On Delivery order gets\n        CONFIRMED (order_status transitions from draft/0 to a real status) -\n        not at Journal3\'s continuous checkout-step auto-save, which creates/\n        updates a draft order row on every address/shipping-method change and\n        would falsely trip a limit for a normal customer filling out the\n        checkout form. This only fires once, when the customer actually\n        finalizes the order.\n\n        Threshold: 3 confirmed orders from the same IP within 10 minutes.\n        Adjust the \"3\" / \"10 MINUTE\" below if this proves too strict/loose\n        in practice.\n    -->\n    <file path=\"catalog/controller/extension/payment/cod.php\">\n        <operation>\n            <search trim=\"true\"><![CDATA[if (isset($this->session->data[\'payment_method\'][\'code\']) && $this->session->data[\'payment_method\'][\'code\'] == \'cod\') {]]></search>\n            <add position=\"after\"><![CDATA[\n			$dearsoft_antispam_ip = $this->request->server[\'REMOTE_ADDR\'];\n			$dearsoft_antispam_check = $this->db->query(\"SELECT COUNT(*) AS cnt FROM `\" . DB_PREFIX . \"order` WHERE ip = \'\" . $this->db->escape($dearsoft_antispam_ip) . \"\' AND date_added > DATE_SUB(NOW(), INTERVAL 10 MINUTE) AND order_status_id > 0\");\n			if ($dearsoft_antispam_check->row[\'cnt\'] >= 3) {\n				$json[\'error\'] = \'Too many orders placed recently from this connection. Please wait a few minutes and try again, or contact us directly.\';\n				$this->response->addHeader(\'Content-Type: application/json\');\n				$this->response->setOutput(json_encode($json));\n				return;\n			}\n]]></add>\n        </operation>\n    </file>\n\n    <!--\n        1.1.0: two checkout-form changes on the same site\'s Journal3 quick\n        checkout (catalog/controller/journal3/checkout.php):\n\n        (a) Email is made optional for GUEST checkout (still validated for\n            format if the shopper does type one, and still required+checked-\n            for-duplicates when actually creating an account, since a login\n            needs a real email). Telephone was already required by this\n            theme\'s own default (quickCheckoutAccountTelephoneField, see\n            system/library/journal3/data/settings/skin/page/checkout.json) -\n            no change needed there.\n\n        (b) Registration rate-limit: blocks creating more than 2 new customer\n            accounts from the same IP within 30 minutes - this is what would\n            have caught the earlier incident where two accounts were created\n            13 minutes apart from the same IP/phone number and both landed\n            with a broken customer_id.\n    -->\n    <file path=\"catalog/controller/journal3/checkout.php\">\n        <operation>\n            <search trim=\"true\"><![CDATA[// email\n		if ((utf8_strlen(Arr::get($this->request->post, \'order_data.email\')) > 96) || !filter_var(Arr::get($this->request->post, \'order_data.email\'), FILTER_VALIDATE_EMAIL)) {\n			$error[\'email\'] = $this->language->get(\'error_email\');\n		} else if (($this->session->data[\'account\'] === \'register\') && $this->model_account_customer->getTotalCustomersByEmail(Arr::get($this->request->post, \'order_data.email\'))) {\n			$error[\'email\'] = $this->language->get(\'error_exists\');\n		}]]></search>\n            <add position=\"replace\"><![CDATA[// email — optional for guest checkout; still required+validated when\n		// actually registering an account, since login needs a real email.\n		$dearsoft_email_value = Arr::get($this->request->post, \'order_data.email\');\n		if ($this->session->data[\'account\'] === \'register\' || $dearsoft_email_value !== \'\') {\n			if ((utf8_strlen($dearsoft_email_value) > 96) || !filter_var($dearsoft_email_value, FILTER_VALIDATE_EMAIL)) {\n				$error[\'email\'] = $this->language->get(\'error_email\');\n			} else if (($this->session->data[\'account\'] === \'register\') && $this->model_account_customer->getTotalCustomersByEmail($dearsoft_email_value)) {\n				$error[\'email\'] = $this->language->get(\'error_exists\');\n			}\n		}]]></add>\n        </operation>\n\n        <operation>\n            <search trim=\"true\"><![CDATA[// passwords\n		if ($this->session->data[\'account\'] === \'register\') {]]></search>\n            <add position=\"after\"><![CDATA[\n			$dearsoft_reg_ip = $this->request->server[\'REMOTE_ADDR\'];\n			$dearsoft_reg_check = $this->db->query(\"SELECT COUNT(*) AS cnt FROM \" . DB_PREFIX . \"customer WHERE ip = \'\" . $this->db->escape($dearsoft_reg_ip) . \"\' AND date_added > DATE_SUB(NOW(), INTERVAL 30 MINUTE)\");\n			if ($dearsoft_reg_check->row[\'cnt\'] >= 2) {\n				$error[\'email\'] = \'Too many accounts created recently from this connection. Please wait a while and try again, or continue as a guest.\';\n			}\n]]></add>\n        </operation>\n    </file>\n\n</modification>\n', 1, '2026-07-11 19:13:06');

-- --------------------------------------------------------

--
