Results 1 to 6 of 6

product attribute question

This is a discussion on product attribute question within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; If I set a few attributes using radio boxes, what determines what order they display? I want a particular option ...

      
  1. #1
    Active Member
    Join Date
    Oct 2004
    Posts
    215
    Rep Power
    8


    Default product attribute question

    If I set a few attributes using radio boxes, what determines what order they display? I want a particular option to be the default, and if they want differently they can choose.

    Thanks

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,500
    Rep Power
    567


    Default RE: product attribute question

    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Active Member
    Join Date
    Oct 2004
    Posts
    215
    Rep Power
    8


    Default Re: RE: product attribute question

    I read through that, and catalog/product_info.php doesn't contain the code they're talking about? Are they referring to base MS2 code? Sorry, I'm still new to hacking all this in...getting better through. If I figure this out I'll toss it in the wiki.

    Thanks,

    Greg

    Quote Originally Posted by msasek
    Quote Originally Posted by gameparts
    I Found It! It was listed on another support site:

    Sort Product Options (attributes)

    What it does...
    First - sorts by price
    Second - if price is same (or 0), it sorts based on the order that the option was entered.

    File to change ...
    /catalog/product_info.php
    ********************************************

    Replace this line
    $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 . "'");


    With this line
    $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id 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.options_values_price, pa.products_attributes_id");


    OR.......

    If you want to sort solely by the order the option was entered (regardless of price) instead use this:

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

  4. #4
    Active Member
    Join Date
    Oct 2004
    Posts
    215
    Rep Power
    8


    Default RE: Re: RE: product attribute question

    Oh cool, got it.

    I forgot that most of what can normally be found in the catalog directory will be found in your template/content directory. That was the case this time and it was as simply as replacing the code as directed.

    If you want to see it in action, look at the flag>full size section of my website at www.upupandawaykites.com . Every flag there has 2 attributes. The 'just the flag' should be the first one everywhere.

    On just a fun note, look at the videos on the power blast 4-8 under kites>quad kites. THey're pretty cool. Big powerful kite, lol.

    Thanks for all the help. Its really appreciated. This whole website thing is going so smoothly for me.

  5. #5
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,500
    Rep Power
    567


    Default RE: Re: RE: product attribute question

    Remember that osCMax uses BTS, so the changes will be in :

    /templates/[templatename]/content/product_info.tpl.php

    I thought you knew that, since you have been working with osCMax for a while now. Any time you see a mod to a file in the base catalog dir, 99.9% of the time, it will be in the /content template of the same name. There are a few small exceptions, but it is rare.
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  6. #6
    Active Member
    Join Date
    Oct 2004
    Posts
    215
    Rep Power
    8


    Default Re: RE: Re: RE: product attribute question

    Quote Originally Posted by msasek
    Remember that osCMax uses BTS, so the changes will be in :

    /templates/[templatename]/content/product_info.tpl.php

    I thought you knew that, since you have been working with osCMax for a while now. Any time you see a mod to a file in the base catalog dir, 99.9% of the time, it will be in the /content template of the same name. There are a few small exceptions, but it is rare.
    I just had a brain fart. I don't know why I forgot that. I just blindly followed the instructions. But about 2 mins after I posted my last question, I remember, hacked it in, and you replied to me while I was typign my last response.

    I got a couple books on PHP, and its making alot more sense to me lately. The hundreds of files on OSC is all making sense. Its just all coming together. When I ask stupid questions, thank you for responding anyways. This community is so helpful and talented. I hope that I will be able to give back over time. Its really a great project.

    Keep up the good work, and thank you!

    Greg

Similar Threads

  1. Yet another attribute stock question
    By landshark in forum osCMax v2 Features Discussion
    Replies: 6
    Last Post: 01-25-2006, 05:31 AM
  2. Yet another attribute stock level updating question
    By kc_davis in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 01-22-2006, 09:50 PM
  3. Delete product with attribute
    By shopculture in forum osCommerce 2.2 Discussion
    Replies: 3
    Last Post: 07-14-2005, 04:29 PM
  4. product attribute text option question
    By SkidMark in forum osCMax v1.7 General Mods Discussion
    Replies: 5
    Last Post: 04-29-2005, 11:46 AM
  5. product attribute help please
    By BHenderson in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 02-01-2005, 11:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •