Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <modification>
- <id><![CDATA[Open Selected Option in pop-up]]></id>
- <version><![CDATA[1.0]]></version>
- <vqmver><![CDATA[2.1.7]]></vqmver>
- <author><![CDATA[[email protected]]]></author>
- <file name="admin/view/template/catalog/option_form.tpl">
- <operation error="log">
- <search position="replace" error="log" ><![CDATA[<?php echo $entry_type; ?>]]></search>
- <add><![CDATA[Open in popup:</td><td><?php if($popup==1) { $check1='checked="checked"'; $check2="";} else {$check1=""; $check2='checked="checked"';} ?><input type="radio" name="popup" value="0" id="popup0" <?php echo $check2; ?>>NO <input type="radio" name="popup" value="1" id="popup1" <?php echo $check1; ?>>YES</td></tr><tr><td><?php echo $entry_type; ?>]]></add>
- </operation>
- </file>
- <file name="admin/model/catalog/option.php">
- <operation error="log">
- <search position="replace" error="log"><![CDATA[$data['sort_order']]]></search>
- <add><![CDATA[$data['sort_order'] . "' , popup = '" . $data['popup'] ]]></add>
- </operation>
- </file>
- <file name="admin/controller/catalog/option.php">
- <operation error="log">
- <search position="replace" error="log"><![CDATA[$result['name'],]]></search>
- <add><![CDATA[$result['name'],
- 'popup' => $result['popup'],
- ]]></add>
- </operation>
- <operation error="log">
- <search position="replace" error="log"><![CDATA[if (isset($this->request->post['sort_order'])) {]]></search>
- <add><![CDATA[
- if (isset($this->request->post['popup'])) {
- $this->data['popup'] = $this->request->post['popup'];
- } elseif (!empty($option_info)) {
- $this->data['popup'] = $option_info['popup'];
- } else {
- $this->data['popup'] = '';
- }
- if (isset($this->request->post['sort_order'])) {]]></add>
- </operation>
- </file>
- <file name="catalog/controller/product/product.php">
- <operation error="log">
- <search position="after" error="log"><![CDATA[$option['product_option_id'],]]></search>
- <add><![CDATA['popup' => $option['popup'],]]></add>
- </operation>
- </file>
- <file name="catalog/model/catalog/product.php">
- <operation error="log">
- <search position="after" error="log"><![CDATA[$product_option['type'],]]></search>
- <add><![CDATA['popup' => $product_option['popup'],]]></add>
- </operation>
- </file>
- <file name="catalog/view/theme/*/template/common/header.tpl">
- <operation error="log">
- <search position="before" error="log"><![CDATA[</head>]]></search>
- <add><![CDATA[
- <style>
- .overlay {
- background-color: rgba(0, 0, 0, 0.6);
- bottom: 0;
- cursor: default;
- left: 0;
- opacity: 0;
- position: fixed;
- right: 0;
- top: 0;
- visibility: hidden;
- z-index: 99999;
- -webkit-transition: opacity .5s;
- -moz-transition: opacity .5s;
- -ms-transition: opacity .5s;
- -o-transition: opacity .5s;
- transition: opacity .5s;
- }
- .overlay:target {
- visibility: visible;
- opacity: 99999;
- }
- .popup {
- background-color: #fff;
- border: 3px solid #fff;
- display: inline-block;
- left: 50%;
- opacity: 0;
- padding: 15px;
- position: fixed;
- text-align: justify;
- top: 40%;
- visibility: hidden;
- z-index: 99999;
- -webkit-transform: translate(-50%, -50%);
- -moz-transform: translate(-50%, -50%);
- -ms-transform: translate(-50%, -50%);
- -o-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- -ms-border-radius: 10px;
- -o-border-radius: 10px;
- border-radius: 10px;
- -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
- -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
- -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
- -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
- box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
- -webkit-transition: opacity .5s, top .5s;
- -moz-transition: opacity .5s, top .5s;
- -ms-transition: opacity .5s, top .5s;
- -o-transition: opacity .5s, top .5s;
- transition: opacity .5s, top .5s;
- }
- .overlay:target+.popup {
- top: 60%;
- opacity: 1;
- visibility: visible;
- min-height:75px;
- font-size:14px;
- }
- .close {
- background-color: rgba(0, 0, 0, 0.8);
- height: 30px;
- line-height: 30px;
- position: absolute;
- right: 0;
- text-align: center;
- text-decoration: none;
- bottom: 5px;
- right: 5px;
- width: 70px;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- -ms-border-radius: 15px;
- -o-border-radius: 15px;
- border-radius: 15px;
- }
- .close:before {
- color: rgba(255, 255, 255, 0.9);
- content: "Ga verder";
- font-size: 14px;
- text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
- }
- .close:hover {
- background-color: rgba(64, 128, 128, 0.8);
- }
- </style>
- ]]></add>
- </operation>
- </file>
- <file name="catalog/view/theme/*/template/product/product.tpl">
- <operation error="log">
- <search position="replace" error="log"><![CDATA[<div id="option-<?php echo $option['product_option_id']; ?>" class="option">]]></search>
- <add><![CDATA[<?php
- if($option['popup']=="1") {
- $rtest="";
- if($option['type']=='radio') {
- $rtest='style="width:980px;"';
- print('
- <script>
- function updateRadio'.$option['product_option_id'].'() {
- var radioVal = [];
- var checkTest = "";
- $(\'#option-'.$option['product_option_id'].' :checked\').each(function() {
- radioVal.push($(this).next(\'label\').html());
- checkTest = $(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').find(\'img\').attr(\'src\');
- });
- $(\'#t-'.$option['product_option_id'].'\').html(\' \'+ radioVal.join("<br />") +\' \');
- $( ".image-additional" ).append(\' <div id="rphoto'.$option['product_option_id'].'" style="display:inline; position:relative;"></div> \');
- //if($(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html()) $(\'#rphoto'.$option['product_option_id'].'\').html(\' \'+ $(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html() +\' \');
- if($(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html()) $(\'#rphoto'.$option['product_option_id'].'\').html(\'<a href="\'+ checkTest +\'" rel="prettyPhoto[pp_gal]" title="a" ><img src="\'+ checkTest +\'" title="a" alt="a" style="width:138px; height:138px;" ></a>\');
- $("a[rel^=\'prettyPhoto\']").prettyPhoto({animation_speed: \'fast\', /* fast/slow/normal */
- slideshow: 5000,
- autoplay_slideshow: false,
- opacity: 0.80,
- show_title: true,
- allow_resize: true,
- default_width: 500,
- default_height: 344,
- counter_separator_label: "/",
- theme: \'dark_rounded\',
- horizontal_padding: 20,
- hideflash: false,
- wmode: \'opaque\',
- autoplay: true,
- modal: false,
- deeplinking: false,
- overlay_gallery: true,
- keyboard_shortcuts: true,
- changepicturecallback: function(){},
- callback: function(){},
- ie6_fallback: true
- });
- }
- $(function() {
- $(\'#option-'.$option['product_option_id'].' input\').click(updateRadio'.$option['product_option_id'].');
- updateRadio'.$option['product_option_id'].'();
- });
- </script>
- ');}
- if($option['type']=='checkbox') {
- print('
- <script>
- function updateCheck'.$option['product_option_id'].'() {
- var checkVals = [];
- var checkImg = [];
- var checkTest = "";
- $(\'#option-'.$option['product_option_id'].' :checked\').each(function() {
- checkVals.push($(this).next(\'label\').html());
- //checkImg.push($(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html());
- checkTest = $(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').find(\'img\').attr(\'src\');
- checkImg.push(\'<a href="\'+ checkTest +\'" rel="prettyPhoto[pp_gal]" title="a" ><img src="\'+ checkTest +\'" title="a" alt="a" style="width:138px; height:138px;" ></a>\');
- });
- $(\'#t-'.$option['product_option_id'].'\').html(\' \'+ checkVals.join("<br />") +\' \');
- $( ".image-additional" ).append(\' <div id="cphoto'.$option['product_option_id'].'" style="display:inline; position:relative; "></div> \');
- //$(\'#cphoto'.$option['product_option_id'].'\').html(\' \'+ checkVals +\'\');
- $(\'#cphoto'.$option['product_option_id'].'\').html(\' \'+ checkImg.join("") +\' \');
- $("a[rel^=\'prettyPhoto\']").prettyPhoto({animation_speed: \'fast\', /* fast/slow/normal */
- slideshow: 5000,
- autoplay_slideshow: false,
- opacity: 0.80,
- show_title: true,
- allow_resize: true,
- default_width: 500,
- default_height: 344,
- counter_separator_label: "/",
- theme: \'dark_rounded\',
- horizontal_padding: 20,
- hideflash: false,
- wmode: \'opaque\',
- autoplay: true,
- modal: false,
- deeplinking: false,
- overlay_gallery: true,
- keyboard_shortcuts: true,
- changepicturecallback: function(){},
- callback: function(){},
- ie6_fallback: true
- });
- //$(\'#cphoto'.$option['product_option_id'].'\').html(\' \'+ checkImg +\' \');
- }
- $(function() {
- $(\'#option-'.$option['product_option_id'].' input\').click(updateCheck'.$option['product_option_id'].');
- updateCheck'.$option['product_option_id'].'();
- });
- </script>
- ');}
- print('<a href="'.$_SERVER['REQUEST_URI'].'#popup-'.$option['product_option_id'].'">'.$option['name'].'</a><br /><div id="t-'.$option['product_option_id'].'"></div><br /><a href="'.$_SERVER['REQUEST_URI'].'#x" class="overlay" id="popup-'.$option['product_option_id'].'"></a><div class="popup" '.$rtest.'><div id="option-'.$option['product_option_id'].'" class="option">');} else { print('<div id="option-'.$option['product_option_id'].'" class="option">');}
- ?>]]></add>
- </operation>
- <operation error="log">
- <search position="before" error="log" offset="3" index="2,3,4,5,6,7,8,9"><![CDATA[<?php if ($option['type']]]></search>
- <add><![CDATA[<?php if($option['popup']=="1") print('<a class="close" href="'.$_SERVER['REQUEST_URI'].'#close"></a></div>'); ?>]]></add>
- </operation>
- </file>
- </modification>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement