Page 1 of 1

opencart 3x converting extension 2x to 3x Help

Posted: Wed Apr 14, 2021 10:30 pm
by sdd
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();
				});

Re: opencart 3x converting extension 2x to 3x Help

Posted: Wed Apr 14, 2021 10:31 pm
by straightlight
Are you submitting this request as a custom job?

Re: opencart 3x converting extension 2x to 3x Help

Posted: Wed Apr 14, 2021 10:43 pm
by sdd
No im trying to run this but its from the old 2x version i now have the 3x version

Re: opencart 3x converting extension 2x to 3x Help

Posted: Wed Apr 14, 2021 11:55 pm
by straightlight
I thought I did posted here before. Anyways, as I was saying there is this topic has been posted in the wrong section. However, it has now been moved to another location.

Re: opencart 3x converting extension 2x to 3x Help

Posted: Sun Apr 18, 2021 2:15 am
by sdd
Hi, thanks for your reply but i just talked to a web developer to help me to avoid spending more money on this.