Community Forums

[FIX] - Admin Catalog Options

Community created contributions & mods for OpenCart 1.x

[FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 12:13 am

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 ... er_search=[fix]&sort=e.date_modified&order=DESC

This will be the support thread for troubleshooting purposes.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby rph » Mon Feb 13, 2012 1:00 am

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 2365 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.
Attachments
options_fix_opencart_151x.xml
(5.59 KiB) Downloaded 184 times
Last edited by rph on Sun Mar 18, 2012 7:34 pm, edited 1 time in total.
-Ryan
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
User avatar
rph
 
Posts: 2725
Joined: Thu Jan 07, 2010 9:05 pm
Location: Lincoln, Nebraska

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 1:23 am

If you take the time to read the description, then this question wouldn't need to be asked.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby rph » Mon Feb 13, 2012 2:26 am

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.
Last edited by rph on Mon Feb 13, 2012 2:30 am, edited 1 time in total.
-Ryan
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
User avatar
rph
 
Posts: 2725
Joined: Thu Jan 07, 2010 9:05 pm
Location: Lincoln, Nebraska

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 2:29 am

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.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby rph » Mon Feb 13, 2012 2:36 am

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.
-Ryan
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
User avatar
rph
 
Posts: 2725
Joined: Thu Jan 07, 2010 9:05 pm
Location: Lincoln, Nebraska

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 2:43 am

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.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby rph » Mon Feb 13, 2012 3:06 am

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.
-Ryan
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
User avatar
rph
 
Posts: 2725
Joined: Thu Jan 07, 2010 9:05 pm
Location: Lincoln, Nebraska

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 4:16 am

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.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby rph » Mon Feb 13, 2012 6:26 am

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.
-Ryan
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
User avatar
rph
 
Posts: 2725
Joined: Thu Jan 07, 2010 9:05 pm
Location: Lincoln, Nebraska

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 1:04 pm

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 ?
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby ktriggs » Mon Feb 13, 2012 1:31 pm

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: viewtopic.php?f=22&t=37489&start=20#p244274
ktriggs
 
Posts: 32
Joined: Wed Oct 19, 2011 11:38 pm
Location: Lincoln, Nebraska

Re: [FIX] - Admin Catalog Options

Postby annelim » Mon Feb 13, 2012 1:34 pm

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
annelim
 
Posts: 116
Joined: Fri Oct 28, 2011 9:13 am

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 1:37 pm

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.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby george347 » Mon Feb 13, 2012 4:52 pm

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?
george347
 
Posts: 23
Joined: Sun Feb 12, 2012 3:19 pm

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 4:56 pm

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.
Last edited by straightlight on Mon Feb 13, 2012 4:58 pm, edited 1 time in total.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby george347 » Mon Feb 13, 2012 4:58 pm

how do I know whether this is where my error is?
george347
 
Posts: 23
Joined: Sun Feb 12, 2012 3:19 pm

Re: [FIX] - Admin Catalog Options

Postby straightlight » Mon Feb 13, 2012 4:59 pm

george347 wrote:how do I know whether this is where my error is?


By trying the fix and seeing the next results.
Regards,
Straightlight
straightlight
 
Posts: 1932
Joined: Mon Nov 14, 2011 3:38 pm
Location: Canada, ON

Re: [FIX] - Admin Catalog Options

Postby george347 » Mon Feb 13, 2012 5:03 pm

ok! I dont use vqmod, and dont know what it is, can I jsut load via ftp?
george347
 
Posts: 23
Joined: Sun Feb 12, 2012 3:19 pm

Re: [FIX] - Admin Catalog Options

Postby george347 » Mon Feb 13, 2012 5:04 pm

And will it make me lose all my options?
george347
 
Posts: 23
Joined: Sun Feb 12, 2012 3:19 pm

Next

Return to Free Contributions

Who is online

Users browsing this forum: No registered users and 2 guests

Hosted by Arvixe Web Hosting