Fixes to option editing
							parent
							
								
									7070cdef7e
								
							
						
					
					
						commit
						2055f74278
					
				|  | @ -225,8 +225,8 @@ $(document).ready(function (){ | ||||||
| 
 | 
 | ||||||
|         $.ajax({ |         $.ajax({ | ||||||
|             method: 'POST', |             method: 'POST', | ||||||
|             url: '/admin/settings/option/remove/', |             url: '/admin/product/removeoption', | ||||||
|             data: { productId: $('#frmProductId').val(), optName: name } |             data: { productId: $('#productId').val(), optName: name } | ||||||
|         }) |         }) | ||||||
|         .done(function(msg){ |         .done(function(msg){ | ||||||
|             showNotification(msg.message, 'success', true); |             showNotification(msg.message, 'success', true); | ||||||
|  | @ -245,7 +245,7 @@ $(document).ready(function (){ | ||||||
|         var optOptions = $('#product_optOptions').val(); |         var optOptions = $('#product_optOptions').val(); | ||||||
| 
 | 
 | ||||||
|         var optJson = {}; |         var optJson = {}; | ||||||
|         if($('#productOptions').val() !== ''){ |         if($('#productOptions').val() !== '' && $('#productOptions').val() !== '"{}"'){ | ||||||
|             optJson = JSON.parse($('#productOptions').val()); |             optJson = JSON.parse($('#productOptions').val()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -567,7 +567,7 @@ $(document).ready(function (){ | ||||||
|         $.ajax({ |         $.ajax({ | ||||||
|             method: 'POST', |             method: 'POST', | ||||||
|             url: '/admin/product/setasmainimage', |             url: '/admin/product/setasmainimage', | ||||||
|             data: { product_id: $('#frmProductId').val(), productImage: $(this).attr('data-id') } |             data: { product_id: $('#productId').val(), productImage: $(this).attr('data-id') } | ||||||
|         }) |         }) | ||||||
| 		.done(function(msg){ | 		.done(function(msg){ | ||||||
|             showNotification(msg.message, 'success', true); |             showNotification(msg.message, 'success', true); | ||||||
|  | @ -581,7 +581,7 @@ $(document).ready(function (){ | ||||||
|         $.ajax({ |         $.ajax({ | ||||||
|             method: 'POST', |             method: 'POST', | ||||||
|             url: '/admin/product/deleteimage', |             url: '/admin/product/deleteimage', | ||||||
|             data: { product_id: $('#frmProductId').val(), productImage: $(this).attr('data-id') } |             data: { product_id: $('#productId').val(), productImage: $(this).attr('data-id') } | ||||||
|         }) |         }) | ||||||
| 		.done(function(msg){ | 		.done(function(msg){ | ||||||
|             showNotification(msg.message, 'success', true); |             showNotification(msg.message, 'success', true); | ||||||
|  | @ -597,7 +597,7 @@ $(document).ready(function (){ | ||||||
|             $.ajax({ |             $.ajax({ | ||||||
|                 method: 'POST', |                 method: 'POST', | ||||||
|                 url: '/admin/api/validate_permalink', |                 url: '/admin/api/validate_permalink', | ||||||
|                 data: { 'permalink': $('#productPermalink').val(), 'docId': $('#frmProductId').val() } |                 data: { permalink: $('#productPermalink').val(), docId: $('#productId').val() } | ||||||
|             }) |             }) | ||||||
|             .done(function(msg){ |             .done(function(msg){ | ||||||
|                 console.log('msg', msg); |                 console.log('msg', msg); | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -138,7 +138,7 @@ | ||||||
|                                 {{#ifCond this.productImage '==' true}} |                                 {{#ifCond this.productImage '==' true}} | ||||||
|                                     <span class="label label-info">main image</span> |                                     <span class="label label-info">main image</span> | ||||||
|                                 {{else}} |                                 {{else}} | ||||||
|                                     <a data-id="{{this.path}}" class="set-as-main-image btn btn-sm btn-success">Set as main image</a> |                                     <a data-id="{{../this.path}}" class="set-as-main-image btn btn-sm btn-success">Set as main image</a> | ||||||
|                                 {{/ifCond}} |                                 {{/ifCond}} | ||||||
|                             </p> |                             </p> | ||||||
|                             <img src="{{this.path}}" class="product-main-image img-responsive"> |                             <img src="{{this.path}}" class="product-main-image img-responsive"> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue