Post by Qphoria » Wed Sep 24, 2008 8:21 am

Category List Options

Version: v0.1
Designed for: OpenCart 0.7.8

What Does This Contrib Do?
This contrib adds the ability to add the product options & add to cart button to the category listing
including some additional features.

Features:
• Checklist or Individual button styles for allowing quick adding of products to the cart
• Option to return back to the list instead of being redirected to cart to make it easier to add products to the cart quickly
• Optional javascript “Adding product(s) to cart” message. Message always stays centered on page no matter where the
scroll bar is.
• Can be completely enabled or disabled.
• Support for Min Order Qty contrib (but not required)
• Support for Option Weight & Stock contrib (but not required)
• CSS Designed

Storefront DEMO
Backend DEMO (user: demo / pass: demo)
DOWNLOAD

Attachments

???
indiv_catlistopt.jpg
???
check_catlistopt.jpg
Last edited by Qphoria on Sat Nov 01, 2008 8:47 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Wed Sep 24, 2008 6:42 pm

LOL.

The contrib is plug-n-play (unless you have other category file changes already) so it shouldn't take much to get it going. (30 secs!)

0.8 is a completely different code structure so it is likely that none of these contribs will work with 0.8 and will all have to be redone.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Thu Sep 25, 2008 10:41 pm

How dare you find bugs in my code!  ;D ;D

1. The copy paste thing I am guilty of oh so often
2. Shouldn't need the option weight contrib, but I likely tried to add support for it and ended up with a line of code that requires it. I will take a look.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri Sep 26, 2008 12:23 am

Yea, I found the bug and fixed it. Thanks for the heads-up.

But I just found another bug that resides in this contrib and the admin ip contrib.

I've been setting the database fields in the setting table, using group 'config', forgetting that config is reserved by opencart for its own config settings. So whenever you changed one of the configs in the Configuration->Settings page, it deletes all of my other contribs settings. Luckily it was only these two, I thought there were more affected.

All the same, I've fixed them both and recommend you use the new version when I upload them to the contrib page to avoid losing your settings.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri Sep 26, 2008 1:32 am

Ok NEW VERSION


v0.2 – 25-Sep-2008
• Fixed: dependency on options weight & stock (thx jty for the heads up)
• Fixed: usage of ‘config’ group in the database table. Changed to ‘catlist’ to avoid deletion.

Download

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sun Oct 05, 2008 9:07 pm

Yes you are pedantic :P

And Yes you are right :P

I will upload the fixed version. Didn't catch it on my end because I now have both of those in the database so it was still finding them.

Thanks jty :)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Tue Oct 07, 2008 12:26 am

UPDATE v0.3

Ok, I see in v0.2 I updated the sql file and catalog files but totally forgot to update the admin files in the zip file. So I copied them over from my test site and all should be good now.

jty you might want to copy over the admin files as there may have been additional minor changes to those files aside from just the renaming.

Download

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri Oct 10, 2008 12:41 am

UPDATE v0.4:

- Updated to work with the new Option Weight & Stock v0.6 contrib.

Download

NOTE:THIS WILL BE THE LAST VERSION FOR OPENCART 0.7.8!

THE NEXT VERSION WILL BE FOR OPENCART 0.7.9.
- Since Min Ord Qty is part of the core code in 0.7.9, I will need to rip all the support for the contrib version out of it to allow the core version to work. This will also make it a lot easier since I won't have to maintain 3 contribs sharing the same code, just 2.. (really more like 1)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Wed Oct 22, 2008 12:33 am

lol it might work. The thing is I changed some of the variable names from the min order qty contrib like "$min_order" to "$min_qty" so it might work ok until it hits a product that has a min qty, it might double the order (and it might not).

The main thing is that I just want to remove all the old stuff just to be sure.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Wed Oct 22, 2008 8:44 pm

missing semi-colon in category_list.css at the end of Line 4

Code: Select all

border-style: solid; border-width: 1px 2px 2px 1px; border-color: #ccc #999 #999 #ccc;

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Wed Oct 22, 2008 8:48 pm

good catch

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Wed Oct 29, 2008 1:38 pm

079.1_Beta Brilliant! Awesome! It Rocks !!!!!
I love the way you've made the change to separate .tpl files. I was thinking that the other night.
And the truncated description saves me a night of learning more php.

Minor, Pedantic comments - cuz I have to prove I broke it  ::)

1. categorylist.sql - I had to comment # out every line in the bottom bit for db-based admin menu. Otherwise, I got a sql error cuz it couldn't find a dbase menu table (I'm not using the dbase menu)

2. In install notes, no longer need the red line "Don’t forget to go to User Group manager to allow admin account access to the new file(s)."

3. Looks like there might a rounding or formatting error somewhere
eg. Product 1 (red motorbike). Price is $117.50 (It's actually in Pounds but I don't have a Pound key on my keyboard)
Option Red = + $ 1.18
Option Small = + $ 3.53

117.50 + 1.18 + 3.53 = 122.21
But I can buy it for 122.20

I can't find the 1 pence difference.

Will post anything else I find, if I find anything

BTW - I deleted my other posts in this thread as they are no longer relevant and makes the thread messy and confusing. The effect is that it now looks like you've been talking to yourself  :D

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Wed Oct 29, 2008 7:58 pm

jty wrote: 079.1_Beta Brilliant! Awesome! It Rocks !!!!!

1. categorylist.sql - I had to comment # out every line in the bottom bit for db-based admin menu. Otherwise, I got a sql error cuz it couldn't find a dbase menu table (I'm not using the dbase menu)
You read the big red line below, but didn't read the rest of the readme? Actually in the readme where it now says "Menu:" it used to say IMPORTANT in big red letters. Apparently that needs to be put back. Also there is some "Warning" text in the sql :P
jty wrote: 2. In install notes, no longer need the red line "Don’t forget to go to User Group manager to allow admin account access to the new file(s)."
Done!
jty wrote: 3. Looks like there might a rounding or formatting error somewhere
eg. Product 1 (red motorbike). Price is $117.50 (It's actually in Pounds but I don't have a Pound key on my keyboard)
Option Red = + $ 1.18
Option Small = + $ 3.53

117.50 + 1.18 + 3.53 = 122.21
But I can buy it for 122.20

I can't find the 1 pence difference.
Hmm, Ill look at that.
jty wrote: The effect is that it now looks like you've been talking to yourself  :D
That's a pretty normal day for me :P But I'd think we should probably disallow that from normal users :P

Also see if you can test it with Option Weight & stock if you get a chance.
Last edited by Qphoria on Wed Oct 29, 2008 8:02 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Wed Oct 29, 2008 11:12 pm

I have upgraded my Open Cart to Broken Carte  :D  :'(
My base install wasn't calculating cart weight so I tried the fresh install
The fresh install weight cart was wrong on the first test but it fixed itself after I poked around in the product and its options
So, I thought I would import my base database to the fresh install to see if I had a data problem
So I installed the Import/Export module but that broke
I am now on Broken Cart Version 101  :P

What I am going to do is take a rest now. I have a feeling that hm2k is about to release 079 Final (fingers crossed).
If Final comes out soon, I will re-apply my mess and see what I end up with.
Who knows, I might end up with PrestaCart or OpenMart of VirtueShop or even osZenMartShopCommerce

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Thu Oct 30, 2008 12:09 am

lol I will try to see what you are seeing. Last I checked my import/export was working fine and my cartweight as well.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Thu Oct 30, 2008 12:42 am

OK, my biggest problem is that I refuse to be beaten  :(
I found the problem. The Export module is OK. It was a user-error of some sort  ::)

The problem is the very first time a product is added to the cart from the category page
This very first time does not calculate options' weight.

To make it work, go into the product page and add a product to "wake-up" the cart. Once the cart has been woken-up, products added from the category page will correctly be added to weight

The data I used to test:
Set-up Product 1 - Red Motorbike to have
- Product weight of 1kg
- Option Red to have a WF = 50 and a WO of *
- Option Small WF = 1 WO = *

Now, close Firefox
Start a new session of Firefox and add Product 1 to cart from the "category page"
Result is cart weight = 1 instead of 1 x 50 x 1 = 50

Next, go into the "product page" of any product and add to cart
View cart now correctly shows weight because the product page woke up the cart

Is this a cookie monster problem ?
Who stole the cookie from the cookie jar  >:(

BTW - your addition of cart weight to the cart page is invaluable for debugging

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Thu Oct 30, 2008 2:01 am

Actually the problem you are seeing with the "very first time" is the omission of a hack that I used in Option Weight & Stock but didn't include in Cat List Options because I'm changing it to use a different method.

The problem is that since the Option Weight & Stock contrib only modifies existing files, and has no configuration settings in the admin, I have nothing to "trigger" when to use it or not. I try to make my code work with my other contribs by offering conditional support on whether to use it or not. Like Cat List Options "supports" Option Weight & Stock but isn't required. It's kind of a pipe dream really that I try to make work but often ends up making it more difficult.

More so, the root need for this is because doing a db query on a table for specific columns that don't exist cause ugly errors. MySql really needs to start offering support for "IF EXISTS" on field returns and table alterations. So i try to preempt them by adding a session variable from the product page that after a query checks for the existence of a column. If that column exists, then set a session variable called hasOptWeighContrib=true. and in the cart, if that session variable is true, the i include those extra columns in my db query.

This is a hack that works as long as your session doesn't time out. So if you add a product to your cart, and goto the cart page. Leave for 20 min and come back, and then continue checking out, the option decrease stuff likely won't work, and the option weight likely won't be added to the cart weight. And you'd get the same effect as you are seeing now when you close down FF .

I have a new method to use now which guarantees it is properly used which I will add in the next Option Weight & Stock version I release.

Maybe the best method would just be to combine Cat List Options and Options Weight & Stock into one contrib.. but then I become a monarchy like Microsoft.
Last edited by Qphoria on Thu Oct 30, 2008 2:06 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Thu Oct 30, 2008 12:21 pm

Thanks for the explanation. I think I know how to fix it for my immediate purposes
The proper fix can come later but for now, I have to get a website off xampp and into Google

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Thu Oct 30, 2008 7:31 pm

jty wrote: Thanks for the explanation. I think I know how to fix it for my immediate purposes
The proper fix can come later but for now, I have to get a website off xampp and into Google
LOL that's not what you said originally in this thread!  Deleter!

Anyway, the proper fix is pretty much 3 lines of code. I will do it this morning

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Thu Oct 30, 2008 11:35 pm

No luck. Still getting weight problem on 1st Add
Have I got the right files ?
I'm using
CategoryListOptions_v079.1_Beta (yesterday's)
Option_Weight_n_Stock_079.1Beta (tonight's/today's one)

Good night

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am
Who is online

Users browsing this forum: No registered users and 2 guests