Results 1 to 3 of 3

Set order to option in product attribute

This is a discussion on Set order to option in product attribute within the osCMax v1.7 Installation forums, part of the osCmax v1.7 Forums category; Problem: I enter say four options for a product. Opt1, Opt2, Opt3, and Opt4. The when I go to attributes ...

      
  1. #1
    New Member
    Join Date
    Dec 2002
    Posts
    20
    Rep Power
    0


    Default Set order to option in product attribute

    Problem: I enter say four options for a product. Opt1, Opt2, Opt3, and Opt4. The when I go to attributes manager I check the four option, but they don't show in the pull down version, or "radio button" in the order I entered them. Optio1 has a zero dollar value. The others have added charges and need to be in the same order (1,2,3, and 4) as when I entered them.
    Question: How do I fix this, or better jet how do I control the order in which these attributes appear in the pull-down window or under the option with the radio buttons.
    Thanks in advance.
    Knull

  2. #2
    New Member
    Join Date
    Nov 2004
    Posts
    18
    Rep Power
    0


    Default

    I believe the file is /catalog/admin/products_attributes.php

    and the section that needs to be modified is:

    <?php
    } else {
    if (isset($HTTP_GET_VARS['option_order_by'])) {
    $option_order_by = $HTTP_GET_VARS['option_order_by'];
    } else {
    $option_order_by = 'products_options_id';
    }
    ?>

    But I have no idea how to modify it. I would like to change this as well. Anyone with PHP coding experience know how to modify it or where/how to set that variable "option_order_by"??

  3. #3
    New Member
    Join Date
    Nov 2004
    Posts
    18
    Rep Power
    0


    Default

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

Similar Threads

  1. TEXT Product Option Attribute Broken Out of the Box?
    By chageman in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 09-13-2005, 02:03 AM
  2. How to set order of Option ID/Name for Product
    By joanstead in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 05-20-2005, 02:10 PM
  3. 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
  4. Flat fee product option / attribute
    By JonThePromoGuy in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 01-04-2005, 07:51 PM
  5. Is there A Product Attribute Option Type Mod for MS2-MAX?
    By klyder in forum osCMax v1.7 General Mods Discussion
    Replies: 9
    Last Post: 07-10-2004, 10:44 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
  •