Results 1 to 3 of 3

Problem with products attributes

This is a discussion on Problem with products attributes within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hello, I have got a problem with products attributes. In OSC it's very easy to create sth like that: product ...

      
  1. #1
    Lurker
    Join Date
    Sep 2004
    Posts
    1
    Rep Power
    0


    Default Problem with products attributes

    Hello,

    I have got a problem with products attributes.
    In OSC it's very easy to create sth like that:

    product prize: 10.00$
    products attributes (size):
    medium
    small (-2.00$)
    large (+2.00$)
    And it works fine (small costs 8$, medium 10$ and large 12$)

    Now, I would like to get sth like that:
    product prize: 10.00$
    products attributes (size):
    small (8.00$)
    medium (10.00$)
    large (12.00$)

    Is it possible to do that in OSC (I just want to avoid prefixes)??

    Greetz, markospl

  2. #2
    Member
    Join Date
    Aug 2004
    Posts
    41
    Rep Power
    0


    Default

    Hi Markospl,

    First thing to do is backup, backup and backup!

    open product_info.php and locate this code approx line 137;

    Code:
              if ($products_options['options_values_price'] != '0') {
                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
              }
    then change it to


    Code:
    //here is the edited code
    	    if ($products_options['price_prefix'] == '+'){
    	    $real_price = ($product_info['products_price']) + ($products_options['options_values_price']);
                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($real_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
    	    }else{
    	    $real_price = ($product_info['products_price']) - ($products_options['options_values_price']);
                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($real_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
    	    }
    // end of code
    This will make the thing you want, you can play around it till you get the feel you want.

    Hope it helps,

    Paul

  3. #3
    Lurker
    Join Date
    Sep 2005
    Posts
    3
    Rep Power
    0


    Default

    Quote Originally Posted by wenzlerpaul
    Hi Markospl,

    First thing to do is backup, backup and backup!

    open product_info.php and locate this code approx line 137;

    Code:
              if ($products_options['options_values_price'] != '0') {
                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
              }
    then change it to


    Code:
    //here is the edited code
    	    if ($products_options['price_prefix'] == '+'){
    	    $real_price = ($product_info['products_price']) + ($products_options['options_values_price']);
                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($real_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
    	    }else{
    	    $real_price = ($product_info['products_price']) - ($products_options['options_values_price']);
                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($real_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
    	    }
    // end of code
    This will make the thing you want, you can play around it till you get the feel you want.

    Hope it helps,

    Paul
    so awesome, thanks so much for this mod

Similar Threads

  1. Products / Attributes and Inventory Controll
    By stevel in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 01-11-2005, 07:18 PM
  2. Products Attributes - drop-down menu for product selection
    By SuperPickle in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 10-11-2004, 10:24 PM
  3. Lots of Products all with the same attributes.
    By JGofGFS in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 05-04-2004, 09:55 AM
  4. Problems with Adding Products and Attributes
    By mafunk in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 11-03-2003, 08:16 PM
  5. Products with multiple attributes - one depends on the other
    By geoff-uklinux in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 10-24-2003, 06:00 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
  •