Post by padred123 » Sat Apr 10, 2010 5:36 am

I installed the Admin Product Filter By Category module but now I can't delete products that aren't in any categories. I don't get any errors when I try to delete but when I go to edit the products without categories I get this error:


2010-04-09 21:29:56 - PHP Notice: Undefined index: model in D:\www\antique\admin\controller\catalog\product.php on line 636
2010-04-09 21:29:56 - PHP Notice: Undefined index: sku in D:\www\antique\admin\controller\catalog\product.php on line 644
2010-04-09 21:29:56 - PHP Notice: Undefined index: location in D:\www\antique\admin\controller\catalog\product.php on line 652
2010-04-09 21:29:56 - PHP Notice: Undefined index: keyword in D:\www\antique\admin\controller\catalog\product.php on line 660
2010-04-09 21:29:56 - PHP Notice: Undefined index: image in D:\www\antique\admin\controller\catalog\product.php on line 668
2010-04-09 21:29:56 - PHP Notice: Undefined index: image in D:\www\antique\admin\controller\catalog\product.php on line 675
2010-04-09 21:29:56 - PHP Notice: Undefined index: manufacturer_id in D:\www\antique\admin\controller\catalog\product.php on line 688
2010-04-09 21:29:56 - PHP Notice: Undefined index: shipping in D:\www\antique\admin\controller\catalog\product.php on line 696
2010-04-09 21:29:56 - PHP Notice: Undefined index: date_available in D:\www\antique\admin\controller\catalog\product.php on line 704
2010-04-09 21:29:56 - PHP Notice: Undefined index: quantity in D:\www\antique\admin\controller\catalog\product.php on line 712
2010-04-09 21:29:56 - PHP Notice: Undefined index: stock_status_id in D:\www\antique\admin\controller\catalog\product.php on line 724
2010-04-09 21:29:56 - PHP Notice: Undefined index: price in D:\www\antique\admin\controller\catalog\product.php on line 732
2010-04-09 21:29:56 - PHP Notice: Undefined index: status in D:\www\antique\admin\controller\catalog\product.php on line 740
2010-04-09 21:29:56 - PHP Notice: Undefined index: tax_class_id in D:\www\antique\admin\controller\catalog\product.php on line 752
2010-04-09 21:29:56 - PHP Notice: Undefined index: weight in D:\www\antique\admin\controller\catalog\product.php on line 760
2010-04-09 21:29:56 - PHP Notice: Undefined index: weight_class_id in D:\www\antique\admin\controller\catalog\product.php on line 772
2010-04-09 21:29:56 - PHP Notice: Undefined index: length in D:\www\antique\admin\controller\catalog\product.php on line 780
2010-04-09 21:29:56 - PHP Notice: Undefined index: width in D:\www\antique\admin\controller\catalog\product.php on line 788
2010-04-09 21:29:56 - PHP Notice: Undefined index: height in D:\www\antique\admin\controller\catalog\product.php on line 796
2010-04-09 21:29:56 - PHP Notice: Undefined index: measurement_class_id in D:\www\antique\admin\controller\catalog\product.php on line 808
Last edited by padred123 on Fri May 07, 2010 7:11 am, edited 5 times in total.

New member

Posts

Joined
Wed Mar 24, 2010 6:05 am

Post by padred123 » Sat Apr 10, 2010 6:17 am

After a lil research it looks the problem is with admin/model/catalog/products.php because i dont get the same issues when I replace that file with the original backed up file. Although I cant sort by category when its switched.

New member

Posts

Joined
Wed Mar 24, 2010 6:05 am

Post by padred123 » Fri Apr 30, 2010 9:10 am

Ok.. I haven't fixed the problem but know what it is. It will only delete/edit products that have a category attached to them. So as long as all your products are in a category you won't notice anything wrong. Now, if you enter a product without a category and want to edit or delete it you'll have to put it in a category manually with phpMyAdmin.

The easiest way of doing it is once your in phpMyAdmin goto the product description table and click the search tab.
Under the name field change the operator form LIKE to LIKE%...%.
Then type the name of your product and click go.
Now once you found your product id number goto the products_to_category table.
Look for any category number in the category_id field to add your product to.
Then, click the insert tab at the top.
Enter the category id you picked from the last step and the product id of your product, then click go.

That should do it! Look for your product in the admin section and edit/delete it.

New member

Posts

Joined
Wed Mar 24, 2010 6:05 am

Post by vojtech25 » Wed May 19, 2010 2:40 am

Thank you very much for your issue !! I did not know, that there could be a problem like this... Now I tried to edit product without category and it really writes the same warnings like you wrote... I will try to sort out this problem without using mysql...

There is one more problem with this module.. If you edit some product and you want to be in more categories.. So you check for example 3 more categories, to be in it. BUT then, if you are looking to the product list (in admin, of course), the product appeares there for 3 times!! It is annoying.. I cannot fixed that.. Does anyone have the same problem???

______________________________________________________
http://www.vojtechzahorsky.com


New member

Posts

Joined
Tue Jan 19, 2010 7:18 pm

Post by padred123 » Thu May 20, 2010 2:46 am

Heres an updated version of the module for OC Ver. 1.4 only that fixes the multiple category issue.
Last edited by padred123 on Fri Jun 04, 2010 5:05 am, edited 1 time in total.

New member

Posts

Joined
Wed Mar 24, 2010 6:05 am

Post by vojtech25 » Thu May 20, 2010 2:50 am

Thank you very much.. Just a question, what does "only that fixes the multiple category issue" mean..?

______________________________________________________
http://www.vojtechzahorsky.com


New member

Posts

Joined
Tue Jan 19, 2010 7:18 pm

Post by vojtech25 » Fri May 21, 2010 4:55 pm

Heres an updated version of the module for OC Ver. 1.4 only that fixes the multiple category issue.
The zip file is not possible to unarchive, can you please add a right one..?? Thank you very much..

______________________________________________________
http://www.vojtechzahorsky.com


New member

Posts

Joined
Tue Jan 19, 2010 7:18 pm

Post by padred123 » Fri Jun 04, 2010 4:54 am

Sorry It took me so long... been busy but try this one. The "multiple category fix" fixes the products that are in more than one category so that they aren't listed multiple times like you mentioned. Oh ya remember to back your stuff up before replacing the files, just in case. ;)

Attachments

For Ver. 1.4 ONLY!


New member

Posts

Joined
Wed Mar 24, 2010 6:05 am

Post by malinaboy » Sun Jun 06, 2010 5:59 am

Nice, but ... I think there is still problem with product without category? How to sort/show it ?

Newbie

Posts

Joined
Sun Jun 06, 2010 5:46 am

Post by padred123 » Sun Jun 13, 2010 2:07 am

padred123 wrote:Ok.. I haven't fixed the problem but know what it is. It will only delete/edit products that have a category attached to them. So as long as all your products are in a category you won't notice anything wrong. Now, if you enter a product without a category and want to edit or delete it you'll have to put it in a category manually with phpMyAdmin.

The easiest way of doing it is once your in phpMyAdmin goto the product description table and click the search tab.
Under the name field change the operator form LIKE to LIKE%...%.
Then type the name of your product and click go.
Now once you found your product id number goto the products_to_category table.
Look for any category number in the category_id field to add your product to.
Then, click the insert tab at the top.
Enter the category id you picked from the last step and the product id of your product, then click go.

That should do it! Look for your product in the admin section and edit/delete it.
This is the work around... I haven't bothered to try and fix it because all of my products are in categories anyways but if someone finds the fix please let us know.

New member

Posts

Joined
Wed Mar 24, 2010 6:05 am

Post by jfn99 » Fri Jun 25, 2010 10:30 am

Does this module work on OC 1.4.8 ?
have any one tried it? thanks

New member

Posts

Joined
Thu Feb 25, 2010 5:14 pm

Post by snarktrader » Wed Jul 14, 2010 3:45 am

Hi, Thanks for submitting this extension.
I've upgraded it for 1.4.8b version and fixed a couple of minor bugs and changed it to sort on category_description.name. Seems to be working all good for me now.
Nick.

Newbie

Posts

Joined
Wed Jul 14, 2010 3:34 am

Post by tomupton » Thu Jul 15, 2010 5:39 pm

Brilliant Nick,

Thanks for resolving this ;-)

Newbie

Posts

Joined
Sat Jul 10, 2010 9:06 pm

Post by Moggin » Fri Jul 16, 2010 8:32 pm

Big thanks to Nick/snarktrader for this extension update. This is going to be essential for me.

A small issue - it doesn't seem to work with the 'Copy' function. The product is copied, goes in the database, and appears in the shop. But it does not appear in admin, so cannot be edited. Anyone else find this?

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by JAY6390 » Mon Aug 09, 2010 7:34 pm

For those interested, the reason for the grouping in line 238

Code: Select all

$sql .= " GROUP BY pd.name"  ; 
This should actually be

Code: Select all

$sql .= " GROUP BY pd.product_id"  ; 

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Moggin » Wed Aug 11, 2010 2:29 am

...and that fixed it, thank you ;)

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by daniele » Wed Aug 25, 2010 9:41 pm

Hi, this is not a real fix to the 'product without category' problem, but an error handling to remember to select at least one category. I'm not a programmer, but it works for me.

admin/controller/catalog/product.php

in: private function getForm() {

Code: Select all

 			$this->data['error_model'] = $this->error['model'];
 		} else {
 			$this->data['error_model'] = '';
 		}

+//filter category start//
+   		if (isset($this->error['category'])) {
+			$this->data['error_category'] = $this->error['category'];
+		} else {
+			$this->data['error_category'] = '';
+		}
+ //filter category stop//
 		if (isset($this->error['date_available'])) {
 			$this->data['error_date_available'] = $this->error['date_available'];
 		} else {
 			$this->data['error_date_available'] = '';
in: private function validateForm() {

Code: Select all

     	if ((strlen(utf8_decode($this->request->post['model'])) < 1) || (strlen(utf8_decode($this->request->post['model'])) > 64)) {
       		$this->error['model'] = $this->language->get('error_model');
     	}

+//filter category start//
+		if (!isset($this->request->post['product_category'])) {
+      		$this->error['category'][$language_id] = $this->language->get('error_category');
+    	}
+//filter category stop//
     	if (!$this->error) {
 			return TRUE;
     	} else {
 			if (!isset($this->error['warning'])) {
admin/language/english/catalog/product.php

Code: Select all

  // Error
  $_['error_permission']       = 'Warning: You do not have permission to modify products!';
  $_['error_name']             = 'Product Name must be greater than 3 and less than 255 characters!';
  $_['error_model']            = 'Product Model must be greater than 3 and less than 24 characters!';
+$_['error_category']         = 'You have to select at least one category!';
  $_['error_required_data']    = 'Required Data has not been entered. Check for field errors!';
 ?>
admin/view/template/catalog/product_form.tpl

Code: Select all

           <tr>
-            <td><?php echo $entry_category; ?></td>
+            <td><span class="required">*</span> <?php echo $entry_category; ?></td>
             <td><div class="scrollbox">
                 <?php $class = 'odd'; ?>
                 <?php foreach ($categories as $category) { ?>
                 <?php $class = ($class == 'even' ? 'odd' : 'even'); ?> 
                 <div class="<?php echo $class; ?>">
                   <?php if (in_array($category['category_id'], $product_category)) { ?>
                   <input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" checked="checked" />
                   <?php echo $category['name']; ?>
                   <?php } else { ?>
                   <input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" />
                   <?php echo $category['name']; ?>
                   <?php } ?>
                 </div>
                 <?php } ?>
-              </div></td>
+              </div>
+              <?php if (isset($error_category[$language['language_id']])) { ?>
+              <span class="error"><?php echo $error_category[$language['language_id']]; ?></span>
+              <?php } ?></td>
+            </td>
           </tr>
           <tr>

Newbie

Posts

Joined
Wed Aug 25, 2010 9:12 pm

Post by macmillank » Sat Sep 04, 2010 11:20 pm

Hi, thanks for the module... works great!

I noticed a minor bug and was wondering how i should go about fixing it.

After you filter by a category, the number of pages showing does update.

For example if I have a total of 73 products (4 pages in total if I show 20 items per page) and I have 20 products in category A. And if I filter by category A, the number of pages shown in still 4 pages. Message on bottom left -> "showing 1-20 of 73 (4 pages)". But when you click on page 2, 3 or 4 it will show "no products"

Thanks.

Newbie

Posts

Joined
Sat Jul 24, 2010 3:36 pm

Post by Boekel » Fri Sep 24, 2010 6:30 pm

I've installed the 1.4.8b version, but now the Global Mega Options Module doesn't work anymore.
I am unable to use the Attribute options.

UPDATE:

Now I get the following error:

Error: Unknown column 'p2c.category_id' in 'where clause'
Error No: 1054
SELECT * FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '2' AND p2c.category_id = '38' GROUP BY pd.product_id ORDER BY pd.name ASC LIMIT 0,20
Last edited by Boekel on Tue Sep 28, 2010 6:05 pm, edited 1 time in total.

Newbie

Posts

Joined
Mon Aug 30, 2010 9:38 pm

Post by dramony » Fri Sep 24, 2010 6:47 pm

will this work on the latest version(OC 1.4.9.1)?

Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm
Who is online

Users browsing this forum: No registered users and 45 guests