Page 1 of 3

[FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 8:13 am
by straightlight
This contribution is a fix of the admin - > catalog - > options page where the options waren't properly managed from the models in order to save, edit or delete the data. With this fix, all the rows should be maintained and removed at your discretion.

The product option no longer seem to disappear after saving them from the admin - > catalog - > products page. The values are being maintained as they should.

/* Instructions */

Use Winmerge to compare the codes.

http://www.opencart.com/index.php?route ... order=DESC

This will be the support thread for troubleshooting purposes.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 9:00 am
by rph
I have no idea why you've done this. What issue are you trying to "fix" here?

EDIT: Since there's still so much bad information being perpetuated I'm just going to add this in here.

The problem many people are having in OpenCart 1.5.1.x stores is option values disappearing from products like pictured below:
option_problem.png

option_problem.png (10.43 KiB) Viewed 9418 times

This is an AJAX issue and has been fixed in OpenCart 1.5.2.x. If you're unable to upgrade I've backported the fix in a VQMod script (should work in all earlier versions but only tested in 1.5.1.3). Changes anywhere else do not address the issue.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 9:23 am
by straightlight
If you take the time to read the description, then this question wouldn't need to be asked.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 10:26 am
by rph
I did. What do you mean they "weren't properly managed"? I'm just not seeing any reason to drop the existing edit method with the complex update scheme you have.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 10:29 am
by straightlight
Countless users reported issues while saving their options which result losses of values for an unknown reason until I published this fix. Even I could reproduce the problem and now all the options are running smoothly as they should. It was huge method to modify but glad it's finally done.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 10:36 am
by rph
Well, if you can show steps to reproduce the error I'd be interested. I think you're just confused here on what the problem really is. The option values aren't gone, they're just not getting properly populated in the product because of the AJAX method used (possibly exasperated by VQMod). There's already a fix for that issue in 1.5.2.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 10:43 am
by straightlight
There's no where to be said that this fix was about the product options but rather on the admin catalog options as per the subject states. It is clearly that you have misread the description. This is the part where it required fixing. If you're saying that even this part from the options it was fixed since v1.5.1.2, then obviously I was still able to encounter these issues on v1.5.1.3.1 with a fresh installation of OpenCart without VQMod installed.

In addition, it is not the fact that VQMod is installed that this problem could be caused particularly but rather due to the way it was coded from the core. Again, since this fix, I can run the options without any issues as I'm sure users that did encountered these problems as much as I did will be relief to finally be able to use this fix.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 11:06 am
by rph
You have yet to show how to reproduce the problem, what code is causing the bug, and why yours fixes it. I'm genuinely glad you're excited about OpenCart and so active in the community but you have a history of "fixing" things that were never broken in the first place.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 12:16 pm
by straightlight
Based on what fact exactly that I'm fixing things that were never broken in first place and to what does it have it to do specifically with this topic while this one right now required fixing and while many others were expecting a patch on this subject which also users never got the right solution before on other topics ?

I'm sure these users will appreciate the fact that someone did finally managed to find the right solution while you don't seem to agree on this distribution. If you don't wish to use it, suit yourself - I'm sure others will benefit very well by using this patch since the 10 hours spent on it was really worthwhile.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 2:26 pm
by rph
The best way to fix a bug is not to completely rewrite a function with 100 extra lines of code. It's to report the bad code (optionally with a succinct fix) or at least a step-by-step method of reproducing the bug. I'm not sure why you're unwilling to do either of those.

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 9:04 pm
by straightlight
I'm not sure why criticism keeps going on here but I did explicitly mentioned above that other users also reported issues regarding the options. Technically, the bad code was already reported but, again, no solution was found until I posted this fix which definitely fixes the problem - code re-written or not period which is what really matters here.

When I think of it, this fix was posted for free on the market while OC users complains about paid fixes which dream to see those for free while mine is. Although, even with a free fix, replies are still being posted about a shouldn't be fixed subject while it is required. Perhaps I should join the idea of those who charges for simple fixes ?

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 9:31 pm
by ktriggs
I haven't used Straighlight's fix, but I am also having the issue he mentions and have discussed it with other users as well. I am currently testing a vQmod that is working and allowing me to edit my products without fear of losing the options because they didn't populate properly. This issue was not resolved in 1.5.2 as stated, because I too have installed a fresh copy of OC with and without the vQmod system and still had the issue. I've been posting in this thread lately: http://forum.opencart.com/viewtopic.php ... 20#p244274

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 9:34 pm
by annelim
my personal view is that the product page > option box should change it to drop down box . because everytime i need to guess what should add into product page or refer back to catalog option. not user friendly. at least on the product page, we can immediately select what kind of option should given for particular product.

Straightlight : does your module do that? not yet figure out your module.
rph : how do change that ajax box to dropdown menu box do show what option inside.

appreciate both can provide solution. much thanks

Re: [FIX] - Admin Catalog Options

Posted: Mon Feb 13, 2012 9:37 pm
by straightlight
Straightlight : does your module do that? not yet figure out your module.
What my module does is fixing what simply already exists from the core in the admin - > catalog - > options page.

Re: [FIX] - Admin Catalog Options

Posted: Tue Feb 14, 2012 12:52 am
by george347
I am too haveing the same issue, when I add a product to a second category. I would love a fix for this....

My issue is that I have 40 + opions per product and each is listed to 1 category. When I go in and the add to a seasonal category - adding it to a second category- some modulesa are randomly disappearing, not all of them and not the same ones in each product. Does your mod fix this?

Re: [FIX] - Admin Catalog Options

Posted: Tue Feb 14, 2012 12:56 am
by straightlight
george347 wrote:I am too haveing the same issue, when I add a product to a second category. I would love a fix for this....

My issue is that I have 40 + opions per product and each is listed to 1 category. When I go in and the add to a seasonal category - adding it to a second category- some modulesa are randomly disappearing, not all of them and not the same ones in each product. Does your mod fix this?
What my module does is fixing what simply already exists from the core in the admin - > catalog - > options page.
Since then, I can at least say that I don't encounter any issues with the product options. I can adjust anything I want without breaking as well. At least, the product option does not require fixing - at least not from my end. If others still encounters issues with the product option after implementing this fix, we'll see.

Re: [FIX] - Admin Catalog Options

Posted: Tue Feb 14, 2012 12:58 am
by george347
how do I know whether this is where my error is?

Re: [FIX] - Admin Catalog Options

Posted: Tue Feb 14, 2012 12:59 am
by straightlight
george347 wrote:how do I know whether this is where my error is?
By trying the fix and seeing the next results.

Re: [FIX] - Admin Catalog Options

Posted: Tue Feb 14, 2012 1:03 am
by george347
ok! I dont use vqmod, and dont know what it is, can I jsut load via ftp?

Re: [FIX] - Admin Catalog Options

Posted: Tue Feb 14, 2012 1:04 am
by george347
And will it make me lose all my options?