Post by sdd » Wed Apr 14, 2021 6:12 am

Im currently running opencart 3.0.2.0

i need help converting this old extension to 3x

Code: Select all

				
	<file path="admin/view/template/catalog/product_list.tpl">
        <operation>
            <search><![CDATA[<form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form-product">]]></search> 
            <add position="before"><![CDATA[
				<div class="well">
					<div class="row">
						<div class="col-sm-4">
							<div class="form-group">
								<input type="text" name="category" value="" placeholder="Category" id="input-category" class="form-control" />
								<input type="hidden" name="category_id" value=""/>
							</div>
						</div>
						<div class="col-sm-4">	
							<div class="form-group">
								<label class="control-label" for="input-status">Delete previous categories</label>
								<input type="checkbox" name="delete_categories" value="1"/>
								<button type="button" id="button-addtocategory" class="btn btn-primary pull-right"><i class="fa fa-link"></i> Bulk Products To Category</button>
							</div>
						</div>
					</div>
				</div>
            ]]></add>
        </operation>
    </file>  
	<file path="admin/view/template/catalog/product_list.tpl">
        <operation>
            <search><![CDATA[$('input[name=\'filter_model\']').autocomplete({]]></search> 
            <add position="before"><![CDATA[
				$('input[name=\'category\']').autocomplete({
					'source': function(request, response) {
						$.ajax({
							url: 'index.php?route=catalog/category/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
							dataType: 'json',			
							success: function(json) {
								response($.map(json, function(item) {
									return {
										label: item['name'],
										value: item['category_id']
									}
								}));
							}
						});
					}
					,
					'select': function(item) {
						$('input[name=\'category\']').val(item['label']);
						$('input[name=\'category_id\']').val(item['value']);
					}
				});

				$('#button-addtocategory').on('click', function() {
					var url = 'index.php?route=catalog/product/addtocategory&token=<?php echo $token; ?>';

					var category_id = $('input[name=\'category_id\']').val();

					if (category_id) {
						url += '&category_id=' + encodeURIComponent(category_id);
					}
					
					var delete_categories = $('input[name=\'delete_categories\']:checked').val();

					if (delete_categories) {
						url += '&delete_categories=' + encodeURIComponent(delete_categories);
					}
					
					$('#form-product').attr('action', url); 
					$('#form-product').submit();
				});

sdd
New member
Online

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by thekrotek » Wed Apr 14, 2021 6:15 am

Create a topic in Commercial Support question, if you can not do it yourself.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by straightlight » Wed Apr 14, 2021 8:50 am

As an alternative, contact the extension developer to resolve this issue.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 16 guests