osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

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


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Installation

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 11-28-2004, 08:41 PM
New Member
 
Join Date: Dec 2002
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
knullhund
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 11-30-2004, 10:58 PM
New Member
 
Join Date: Nov 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gameparts
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"??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 12-01-2004, 07:04 PM
New Member
 
Join Date: Nov 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gameparts
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");
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
TEXT Product Option Attribute Broken Out of the Box? chageman osCMax v1.7 Discussion 1 09-13-2005 01:03 AM
How to set order of Option ID/Name for Product joanstead osCMax v1.7 Discussion 0 05-20-2005 01:10 PM
product attribute text option question SkidMark osCMax v1.7 General Mods Discussion 5 04-29-2005 10:46 AM
Flat fee product option / attribute JonThePromoGuy osCommerce 2.2 Modification Help 0 01-04-2005 07:51 PM
Is there A Product Attribute Option Type Mod for MS2-MAX? klyder osCMax v1.7 General Mods Discussion 9 07-10-2004 09:44 AM


All times are GMT -8. The time now is 11:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax