Post by sdd » Wed Apr 14, 2021 10:30 pm

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();
				});

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by straightlight » Wed Apr 14, 2021 10:31 pm

Are you submitting this request as a custom job?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by sdd » Wed Apr 14, 2021 10:43 pm

No im trying to run this but its from the old 2x version i now have the 3x version

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by straightlight » Wed Apr 14, 2021 11:55 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by sdd » Sun Apr 18, 2021 2:15 am

Hi, thanks for your reply but i just talked to a web developer to help me to avoid spending more money on this.

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am
Who is online

Users browsing this forum: No registered users and 102 guests