NoteStar 5 år sedan
förälder
incheckning
f3c0f82558

+ 56 - 9
appfront/theme/terry/theme01/catalog/product/index.php

@@ -75,6 +75,53 @@
 							<?= Yii::$service->page->widget->render($optionsView,$optionsParam); ?>
 						
 						</div>
+
+                        <!-- 自定义界面Star -->
+                        <div class="product_custom_options">
+                            <div class="product_options" id="user_custom">
+
+                                <?php if(is_array($groupAttrArr)): ?>
+                                    <?php   unset($groupAttrArr['color']);
+                                    unset($groupAttrArr['size']);
+                                    unset($groupAttrArr['weight']);
+                                    unset($groupAttrArr['volume weight']);
+                                    ?>
+                                    <?php  echo "<table>"; ?>
+                                    <?php foreach($groupAttrArr as $k => $v): ?>
+                                        <?= "<tr><td>".$k."</td><td>".$v."</td></tr>"; ?>
+                                    <?php endforeach; ?>
+                                    <?php  echo "</table>"; ?>
+                                <?php endif; ?>
+
+                            </div>
+                            <div id="user_custom_content" style="display: none;">
+
+                                <?php if(is_array($groupAttrArr)): ?>
+                                    <?php   unset($groupAttrArr['color']);
+                                    unset($groupAttrArr['size']);
+                                    unset($groupAttrArr['weight']);
+                                    unset($groupAttrArr['volume weight']);
+                                    ?>
+                                    <?php  echo "<table>"; ?>
+                                    <?php foreach($groupAttrArr as $k => $v): ?>
+
+
+                                        <?= "<tr><td>".$k."</td><td>"; ?>
+                                        <input class="custom_op" type="number" min="1" max="500" attr="<?=$k?>" style="width: 50px;">cm
+
+                                        <?= "</td></tr>"; ?>
+
+
+                                    <?php endforeach; ?>
+                                    <?php  echo "</table>"; ?>
+                                <?php endif; ?>
+
+                            </div>
+                        </div>
+
+                        <!-- 自定义界面End -->
+
+
 						
 						<div class="product_qty pg">
 							<div class="label"><?= Yii::$service->page->translate->__('Qty:'); ?></div>
@@ -155,15 +202,6 @@
 				</div>  
 				<div id="text">  
 					<div class="text-description" style="">
-                        <?php if(is_array($groupAttrArr)): ?>
-                            <table>
-                            <?php foreach($groupAttrArr as $k => $v): ?>
-                                <tr><td><?= $k ?></td><td><?= $v ?></td></tr>
-                            <?php endforeach; ?>
-                            </table>
-                            <br/>
-                        <?php endif; ?>
-                        
 						<?= $description; ?>
                         
                         <div class="img-section">
@@ -219,6 +257,15 @@
 	// add to cart js	
 	<?php $this->beginBlock('add_to_cart') ?>
 	$(document).ready(function(){
+
+        //自定义JS
+        var a = $(".current.sizebj span").text();
+        if(a == 'CustomSize'){
+            alert(a);
+            $("#user_custom").css('display','none');
+            $("#user_custom_content").css('display','block');
+        }
+
 		$(".addProductToCart").click(function(){
 			i = 1;
 			$(".product_custom_options .pg .rg ul.required").each(function(){

+ 1 - 1
appfront/theme/terry/theme01/catalog/product/index/custom_option.php

@@ -30,7 +30,7 @@
 				</li>
 			<?php   	else: ?>
 				<li>
-					<a attr="<?= $attr ?>" class="noimgshow active_v" value="<?= $key ?>"><?= Yii::$service->page->translate->__($val); ?></a>
+					<a attr="<?= $attr ?>" class="noimgshow active_v <?= $attr ?>bj" value="<?= $key ?>"><?= Yii::$service->page->translate->__($val); ?></a>
 					<b></b>
 				</li>
 <?php   				endif;  ?>

+ 4 - 4
common/config/fecshop_local_services/Product.php

@@ -30,7 +30,7 @@ return [
                  *	  您可以查看演示地址:http://fecshop.appfront.fancyecommerce.com/index.php/reindeer-pattern-glitter-christmas-dress-86519596
                  * 您可以给产品属性组添加的属性类型就上面几种,在后台编辑产品的时候,选择不同的属性组,就会加载相应的属性出来。
                  */
-                'spu_attr' => [  // spu用来区分sku的属性,譬如下面的属性的不同,对应不同的sku,进而是不同的库存
+                /*'spu_attr' => [  // spu用来区分sku的属性,譬如下面的属性的不同,对应不同的sku,进而是不同的库存
                     // 第一个属性会被用户当做图片来显示。
                     'color'      => [
                         'dbtype'     => 'String',
@@ -78,7 +78,7 @@ return [
                             'type'    => 'select',
                             'data'    => [
                                 # 产品的spu属性的顺序,会按照下面的顺序进行排序。
-                                'one-size',
+                                'CustomSize',
                                 'S',
                                 'M',
                                 'L',
@@ -91,7 +91,7 @@ return [
                         //'default' => 2,
                     ],
                     
-                ],
+                ],*/
                 'general_attr' => [
                     // 这是input type='text' 的类型
                     'my_remark' => [
@@ -252,7 +252,7 @@ return [
                             'data'    => [
                                 's',
                                 'm' ,
-                                '0.6',
+                                'CustomSize',
                                 'l',
                                 'xl',
                                 'xxl',

+ 3 - 3
common/config/fecshop_local_services/Search.php

@@ -40,9 +40,9 @@ return [
                 
             ], 
             'xunSearch'  => [
-                'enableService' => true, // xunSearch 开启前,先安装xunsearch。
-                'fuzzy'         => true,  // 是否开启模糊查询
-                'synonyms'      => true, //是否开启同义词翻译
+                'enableService' => false, // xunSearch 开启前,先安装xunsearch。
+                'fuzzy'         => false,  // 是否开启模糊查询
+                'synonyms'      => false, //是否开启同义词翻译
                 
                 'searchLang'    => [
                     'zh' => 'chinese',