Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products Attributes Sort v1.0


Guest

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

Link to comment
Share on other sites

  • Replies 173
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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

Link to comment
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

Link to comment
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

Link to comment
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!

Link to comment
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
Link to comment
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
Link to comment
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.....?????

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

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

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...