having trouble with groups

greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread

Hi. I'm having some trouble with my database groups. It seems that when I try to list by group, the search returns nothing. (See what I mean here.) First off, my groups are not listed in order. Is there something I can do to get them to do so? Second, the results simply do not turn up. I typed in my "%groups" entry in smart.cfg just like the ones you had there, but I can't figure out why it's not working. Any suggestions/ideas/anything? Thanks!

-- N. Jaber (mirliton@hotmail.com), December 28, 1997

Answers

I am experiencing the same problem in terms of my groups are not showing up in the order in which I entered them. Any suggestions?

-- Toby Saevey (ansel1065@aol.com), January 01, 1998.

Make sure you end your data line with a "|" if you enter the data via a text editor. The admin script will do it for you if you go through and choose catagories there.

I'd like to know the answer to the mis -ordering of the group entries also. We stayed away from using the script because of oddball things like that and a few others. We're been using another script but we're always looking for good ideas. It will be interesting to see what Barry fixes in his next version, if there is one. The cart has some great ideas. It's a great effort and the price is right for those who can work around the minor buggs. Post anything you find out about the order of groups.

-- j fehringer (jf@fehringer.com), January 02, 1998.


Groups are stored as a hash, which is by nature unordered.

-- Barry Robison (brobison@rcinet.com), January 02, 1998.

Here's the answer to the "sorting" problem with groups:

in smart.cgi script Under heading: #Show front end of database -20 lines down from heading should read:

foreach $group (sort keys %groups){ print "\n"; }

The solution is to add "sort" infront of "keys%groups

That should do it.

-- j fehringer (jf@fehringer.com), January 02, 1998.


Thanks, I'll try all your suggestions right now!

(And to Barry, thanks for a script that, all in all, doesn't require a rocket scientist to operate.)

-- N. Jaber (mirliton@hotmail.com), January 05, 1998.



Moderation questions? read the FAQ