Jump to content
Sign in to follow this  
dontera

Products Attributes Sort v1.0

Recommended Posts

If you are running the BTS template system mod (I'm using v1.3) and have the following problem:

Admin works fine, attribute sort values are being stored in the table, but attribute values are not being sorted on the product pages

 

You need to modify the code in the product_info.tpl.php file of your chosen template directory's "content" folder (i.e. /catalog/templates/YOURTEMPLATE/content/product_info.tpl.php) using the instructions you would normally use to alter the product_info.php file.

 

Hope this helps someone.

 

 

Here are the instructions from the attributes_sort_module.txt file:

2) modify files as follow:

 

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

--/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"); 

Share this post


Link to post
Share on other sites

Aight, i followed contribution installation everything went fine. I adjust a product option to sort it but if i look in my store i get this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\minixampp\htdocs\PrimaveraQuint\includes\functions\database.php on line 99

 

And the product isnt found anymore :(

 

Im using a BTS template

Share this post


Link to post
Share on other sites

Hi, I installed this which looks like a great idea. When I entered a new product after install I got the followin in catalog:

 

1054 - Unknown column 'pa.attribute_sort' in 'order clause'

 

select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from products_attributes pa, products_options_values pov where pa.products_id = '31' and pa.options_id = '6' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' order by pa.attribute_sort

 

[TEP STOP]

 

What have I done wrong

kind regards

KIM

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

This would be a great mod if i could get it to work..

admin works fine, no errors..

it just will not sort the attributes into order.. any help here>>>

 

 

thanks in advance..

Edited by guido1229

Share this post


Link to post
Share on other sites

did you follow everything step by step?

-you need to post a specific problem... Make sure you edited all the codes and files is my advice

Share this post


Link to post
Share on other sites

I get no errors .. only the new products are put into order.. the old product attributes do not

Edited by guido1229

Share this post


Link to post
Share on other sites

I am still a newb, but mine is working... Did you do the SQL entry and also the just make sure you redo everything i know it is a pain but same thing happened to me

Share this post


Link to post
Share on other sites

well my last posting was not correct either... it puts the attributes in but not in order... it did it once but not any more.. new or old product.....?????

Share this post


Link to post
Share on other sites

Well now Its working... edited the wrong general.php..lol at myself..thanks for great mod.. later

Share this post


Link to post
Share on other sites
For those of you that were having problems getting this module to work with the options as images contribution installed...I got it to work by applying the changes outlined in the readme file to the catalog/options_images.php file.  (around line 29)  change

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, 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 . "' ");

 

to

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, 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");

 

Applying the changes to product_info.php will only work if you have options as images disabled.

Cheers - that the trick for me :D

Share this post


Link to post
Share on other sites

is there anyway of choosing the default option for each attribute. for when the product page loads ?

E.G.

if a customer clicks on the product LARGE Shirt, the product page loads with the option Large loaded by default ,

if a customer clicks on the product SMALL Shirt, the product page loads with the option Small loaded by default

Alternate options are still sorted & available to choose from, but the default option is defaulted to what admin chooses

Any Ideas

Share this post


Link to post
Share on other sites

well, since that was so helpful, I had to say I also found this to fix the problem. Thanks!!!!!!

 

For those of you that were having problems getting this module to work with the options as images contribution installed...I got it to work by applying the changes outlined in the readme file to the catalog/options_images.php file.  (around line 29)  change

 

 

CODE 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, 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 . "' ");

 

 

 

to

 

 

CODE 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, 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");

 

 

 

Applying the changes to product_info.php will only work if you have options as images disabled.

 

Now, who will tighten up this mod, and reflect this in a new version?


Thanks!

 

Starkness

Share this post


Link to post
Share on other sites

The mod works except that I need it to also add the attribute product weight, is there a way that this can happen??? This is the last problem I have with my site... Love to go live with this.....

 

ie: attribute = 5lbs + $29.00

 

it adds the $29.00 but not the 5lbs

 

 

 

Thanks

 

Mike

Share this post


Link to post
Share on other sites

Hi guys, great contrib!!!

however...

has anyone successfully merged admin/categories.php file thats been modded for UltraPix with this contrib? I spent about 3 hours on this but I cant do it :(

Share this post


Link to post
Share on other sites
Great Contribution, is there any way of getting this to work with Easy Populate.

 

Regards

 

Raj

Mine works with easy populate! Had that installed before i installed this contri

Share this post


Link to post
Share on other sites

I installed this mod and it is working perfectly. BUT, when I go to create a new product, all of my options are not listed under each attribute. (I am talking about the grid when adding a new product) Has anyone had this problem?? Thanks.

 

Shanna

Share this post


Link to post
Share on other sites

Hi I am installing the sort attributes order contrib and I saw that you had this same problem and you figured it out.

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/ourcoffe/public_html/estore/admin/includes/functions/general.php:1318) in /home/ourcoffe/public_html/estore/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ourcoffe/public_html/estore/admin/includes/functions/general.php:1318) in /home/ourcoffe/public_html/estore/admin/includes/functions/sessions.php on line 67

 

What did you do? I can change the order of my options but when I update I get this message

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/ourcoffe/public_html/estore/admin/includes/functions/general.php:1318) in /home/ourcoffe/public_html/estore/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ourcoffe/public_html/estore/admin/includes/functions/general.php:1318) in /home/ourcoffe/public_html/estore/admin/includes/functions/sessions.php on line 67

 

Warning: Cannot modify header information - headers already sent by (output started at /home/ourcoffe/public_html/estore/admin/includes/functions/general.php:1318) in /home/ourcoffe/public_html/estore/admin/includes/functions/general.php on line 18

 

It does update the item but I have to go back through the catalog to do the next item.

 

Any help would be Greatly appreciated!

 

Pete

Our Coffee Barn


Life Is Too Short,

Enjoy Your Coffee!

Pete

Share this post


Link to post
Share on other sites

it would seem that you modified a file and have some 'white space' at the top of the file, this error is listed in the knowledge base, if you open knowledge base and search on headers, you should find it


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
Share on other sites

SOrry but I have no found where I can add o replace i file

 

--/admin/products_attributes.php

 

I have many contribution in this file and I dont can replace the entire file

 

 

thank you

Share this post


Link to post
Share on other sites

I downloaded the file to have a sort order for product attributes but I'm having difficulty understanding what to do with it. The readme.txt file says to run the included sql query...what sql query? i don't see anything...

also the insert_attrib_sort.txt file says alter table ... (i'm sure anyone reading this knows what it says) and i'm not exactly sure what i'm supposed to do with that.

any chance i could get a "first do this" "then do this" from someone? i'm new to php so this is all still somewhat greek to me.

thanks

Share this post


Link to post
Share on other sites

i tried to install this and figure it out and i've done something quite wrong. can someone please help?

sidebysidecomptuing.com is where you can view my now messed up pages

haha...thanks in advance for any help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×