Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products Attributes Sort v1.0


Guest

Recommended Posts

i want to double check that i do the right steps in the right order, please let me know if this is correct:

 

1-upload the sql query to my site? (not quite sure what running the sql means)

 

2-in file --/catalog/product_info.php--

FIND:

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

REPLACE WITH:

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

 

3-in file --/admin/includes/functions/general.php--

ADD (anywhere):

function tep_attributes_sort($attributes_id) {

global $languages_id;

 

$attributes_sort = tep_db_query("select attribute_sort from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . (int)$attributes_id . "'");

$attributes_sort_values = tep_db_fetch_array($attributes_sort);

 

return $attributes_sort_values['attribute_sort'];

}

 

4-file --/admin/products_attributes.php upload over the old one with the new one included in the zip file

 

5-go to file --/admin/products_attributes.php and find "attrib sort" column at bottom of page and update values for attributes.

 

is that what i should do? also, there is /admin/includes/functions/general.php do i need to upload that as well? so basically i need to upload all the files included in the zip so they overwrite the old ones? and then do something with the sql and make some changes to products_attributes.php? i think i'm on the right track, just need a little guidance. thanks

Link to comment
Share on other sites

  • Replies 173
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Running the SQL file doesnt mean just uploading it to your site. You have to log into you database & add the text that is in the file into the database.

Bring up PhpMyAdmin and select the database that was created. There will be a section for running queries on the right side called SQL. Just under it will be a button for browsing to a file. Click that button and find your file_name.sql file. That will upload the file to PhpMyAdmin and it will read in the lines and execute them on MySql. Walla, you should be done. If you dont know how to do this then your gonna really struggle to add any contributions to your site as most have some sort of SQL file to add :blink:

Link to comment
Share on other sites

ok i got the sql run and did all the changes except putting the values to the options. i'm not exactly clear on what is the best way to do the attribute sorting.

in the read-me file it suggest small=0 medium=1 etc etc

i am doing different options on different products such as ram upgrades, hard drive upgrades, etc. each product does not have the same options. is there a quick way to do sorting by price other than doing like $1=0 $2=1 and sorting them by doing that as the order? that could take forever if i have to type up a thousand of those lines. i'll do it if i have to but hopefully there's a better way?

thanks for helping me

Link to comment
Share on other sites

Hi,

 

I'm having a problem with the admin kit code. In cat./admin/product_atributes.php I get the following error..

 

 

 

Parse error: parse error, unexpected '}' in /home/fhlinux197/g/gosexy.co.uk/user/htdocs/gosexy2/admin/products_attributes.php on line 906

 

 

 

 

Okay, I thought, not a big problem I'll just make sure that all the {}'s in the code are closed. Yep, your code is fine, and there isn't a line 906 anyway.

 

anyone else had this problem?

Jon

Link to comment
Share on other sites

Hello.

 

I have added this attribute and works when I add items thru admin but when I add items thru easypoplulate they do not sort correctly.

 

where in product_attributes do I assign my values. I am a bit confused on exactly how to do this....thank you

 

for example:

 

Attribute: Term

Values: 1 Year (0), 2 Years (1), 3 Years (2), 4 Years (3)

Link to comment
Share on other sites

Hi,

 

I'm having a problem with the admin kit code. In cat./admin/product_atributes.php I get the following error..

 

 

 

Parse error: parse error, unexpected '}' in /home/fhlinux197/g/gosexy.co.uk/user/htdocs/gosexy2/admin/products_attributes.php on line 906

 

 

 

 

Okay, I thought, not a big problem I'll just make sure that all the {}'s in the code are closed. Yep, your code is fine, and there isn't a line 906 anyway.

 

anyone else had this problem?

sorted!

Jon

Link to comment
Share on other sites

I've been wrestling this module for about 24 hours and have experienced a variety of different outcomes. I've hand placed the code into my site files due to multiple contributions being utilized (tried a few merge programs, to no avail). I'm sure it is a very simple solution that I just don't have the brain power to cypher out. My site is www.mainsales.net/allboutyou/catalog/. I can get the sort module to appear in my admin directory and function somewhat there, but whenever I go to the actual page, there is no sorting of the product attributes taking place per my instructions. I've read the responses in this forum to similar situations and have tried those, also with no luck. I am running the STS sytem, Header-tags Controller, and Option-type feature in this site. I am but a lowly graphic designer with no PHP coding skills to mention and would welcome any advice offered. I am very new to this so please type slowly.

 

Thanks.

Link to comment
Share on other sites

Ok, I'll explain my experience / solution, then go to bed...

 

Downloaded the: 29 Feb 2004 - Product Attributes Sort Order v1.04 File.

 

Like, others attempted to follow all the directions. All was well EXCEPT for the final step.

the catalog/product_info.php step

 

Anyways, for some reason, my PHP file had

(int)

infront of some items, so it was very hard for me to track down the correct line.

 

My product_info.php verson product_info.php,v 1.97 2003/07/01 14:34:54

 

I too have Easy Populate installed.

 

Anyways, any having trouble with this particular file should do a search for

$products_options_array = array();

it should be the only one in the entire file.

 

The line RIGHT BELOW IT, is the one the needs modified. It is at the end of that line.

 

Adjust from

(int)$languages_id . "'");

to

(int)$languages_id . "' order by pa.sort_order");

 

This cause me an error till I corrected it with the above. Now everything seems to working fine. hope this helps.

 

------------------------------------------------------------

Correction, does anyone know how add this product_sort order field to easy populate, it does not seem to download it by default.

Edited by djgizmo
Link to comment
Share on other sites

  • 1 month later...

I just installed this contribution and I simply love it. When dealing with both automotive parts and clothing and other items with heavy attributes, this contribution is simply NECESSARY.

 

Plus, the ability to add options/attributes directly when adding a new product and choose the order at that time is an amazing time saver.

 

KUDOS!

Link to comment
Share on other sites

  • 2 weeks later...

OK, here's one for other Newbies like me. I had NO idea what this meant in the readme.txt file step 1: "run included sql query to add new column to products_attributes table". In my search thru the forum and this thread I found this:

 

just about to try this to get my attributes in a selected order, but as im new what EXACTLY do i do regarding this:

 

run included sql query

 

thanks

 

sorry im a newbie too.. what does this mean?

 

run included sql query ???

 

how do i do this?

 

Lame i know.......

J

 

 

 

The reply was this:

"You go to your PHP my admin, log in and then click on your database, then click on the tab that says SQL... Browse to the file in the folder that is an SQL file, set as autodetect, and then click run... Should do the rest itself!"

 

That reply got me on the right track, but I wanted to add this to help the other TRUE NEWBIES like ME, just to share what I have learned.

 

If you are new to running a server like I am, or new to at least doing the admin on your own site that stuff might be hard to find or figure out. So, here goes:

 

Log into your site control panel. Depending on who you host your site with this could be a large variable. Anyway, log into your site control panel as you normally would. Then, if you have multiple domains you manage choose the one you are setting up your osCommerce cart on (I know this seems an obvious step, just trying not to skip anything for those who really need the help). Next, click the icon for where your databases are stored - this could be many things I realize as it depends on your host provider and also assumes that you have a control panel to access. For me, there is an icon that looks like a stack of watch batteries and it says "Databases". Click into that and then choose the database for your osC cart. If you have only one shopping cart it should be easy to find, I have 6 in the same directory so I had to verify which one I was working on based on the name...it's a long name and begins with mysql85620dca43......... you get the idea. I clicked that to get to a page where I have 2 options: DB WebAdmin and Add new Database User. Obviously, I chose DB WebAdmin. When I click that it opens up a new window in my web browser : Welcome to phpMyAdmin 2.5.3

Now, I can start following the instructions that were already posted. Click on "Databases". That should again bring up your osC database, if you have multiple choices to click, be sure you know the (long-ass) name of your sql database and click it. This opens a sort-of file manager page with tabs at the top, click the tab that says "SQL". This opens up a page that gives you the option to "Choose File" location of the text file. This is the part where you click the button "Choose File" and tell it where to find the file called "insert_attrib_sort.sql" that is in the folder you downloaded to install this sort contribution. I uploaded the file to my server first and then told where to find it when I clicked the "Choose File" option. From there, be sure you have "autodetect" selected and hit the button "Go". It takes care of itself from there.

 

Additionally, you need to follow step 2 of the readme.txt file and either manually update all the .php files that are required by the contribution or just use the .php files that have been so nicely included in the folder you downloaded from Forrest Miller (way cool, thanx dude). I manually updated the first two .php files and then just used the third one included since the instructions didn't say what to alter:

 

(--/admin/products_attributes.php--

::replace whole file or update manually (many small changes)::

 

Be sure to upload your three updated .php files to your remote server where your site is running and now go to your osC admin page. When you go to the products attributes section there should be the new column "Attrib Sort" at the bottom where you add attributes to your products.

 

I realize this is a long explanation and I hope it helps the other guys that are very new like me...just trying to help. It seems on this forum many questions go unanswered, likely as many of the same questions keep popping up. Read/search the forum guys.

Link to comment
Share on other sites

For something so simple you make it look really difficult to understand :'(

If adding a file to the database is this complicated then what chance do we stand we it comes to the real stuff ? Only kidding - justs it matter of logging into your PhpMyAdmin database-clicking on your database name at the top of the left hand column, then clicking on the SQL tab on the main page & pasting your SQL data into the the table. This is a breese compared to some of the modding you will come across! :blink:

Edited by martinmacca
Link to comment
Share on other sites

Hi There and many thanks to Forrest for this contrib!

 

Here's a weird question for you guys. I'm running Product Attributes Sort along with Option Type Feature and New Attribute Manager v4b. Everything works great EXCEPT attribute manager was built for Linda's sorter/copier which keeps the sort order in

 

products_options_sort_order

 

It seems easier to mod this contrib than the attribute manager. Can someone clue me into how to change the references to which table the sort queries and updates?

 

Any help appreciated and many, many thanks in advance!

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Ok I got one DUH question..... I installed everything but how do you begin to use it. I have no errors as far as I can see and i see some modifications in the admin but how do I manipulate the sort order.

THanks..... Graphicpoet! :blink:

 

As you add options to products you'll see a text field for sort order there. Just give it a number!

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Hi There and many thanks to Forrest for this contrib!

 

Here's a weird question for you guys. I'm running Product Attributes Sort along with Option Type Feature and New Attribute Manager v4b. Everything works great EXCEPT attribute manager was built for Linda's sorter/copier which keeps the sort order in

 

products_options_sort_order

 

It seems easier to mod this contrib than the attribute manager. Can someone clue me into how to change the references to which table the sort queries and updates?

 

Any help appreciated and many, many thanks in advance!

 

Iggy

 

Just answering my own question here B)

 

It is MUCH easier to mod New Attribute Manager v4b. Just find the db table names and replace them, then ax all the weight references.

 

Off topic at this point I know but maybe it'll help somebody.

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

can someone help me please i am trying to apply attrib_sort_v1, is this the lattest mod.?? and also can someone send me the manual install txt as i have modified files and am not very good at php. thanks

I think 4b is the latest. Did you get it from here?

 

http://www.oscommerce.com/community/contri...arch,attributes

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

yes i have installed that mod, but i dont get to sort the attributes in the order i want, unless i stuffed sometihng up. hmmm..

does that mod even support the choise to sort order..??

 

It does out of the box if you're using Linda's Sorter/Copier <--- Seperate Contribution.

 

Also has support for Option Type Feature. Enable them in the config file.

 

Otherwise it'll need some tweaking :rolleyes:

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

yes i have installed that mod, but i dont get to sort the attributes in the order i want, unless i stuffed sometihng up. hmmm..

does that mod even support the choise to sort order..??

 

I am thinking about the wrong contrib here. My bad. More coffee required. Ignore the post above.

 

OK if you have Attribute Sort installed on it's own and you've added some options and applied a sort order # to them and they don't sort in the order you specified run back through the install step for step and make sure you got all the changes.

 

I've got this installed and it works great. Drop me an email and I'll send you the files if want.

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Ok, first off I installed this in a OS MAX setting, so I know there's things that is different..... I can add items and have the sort the way I want.... I can't get the items that are currently there to sort when I go back and edit the item and assign the numbers it still shows up the old way. Not sure what is wrong, I have aabox's max 1.7 I believe, stock from them, this is the only mod I've tried to put in there. Any help will be appreciated. Thanks RJ

Empire Metal Art

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...