1 reply [Last post]
mizerydearia's picture
Offline
Joined: 09/01/2009
Juice: 12

If I want to have one product node for a product that is actually several products in one, each product a different size, what would be the best method to manage different sizes of the product at different prices other than creating one product node for each product size?

mizerydearia's picture
Offline
Joined: 09/01/2009
Juice: 12
Re: untitled

http://rug-company.com/drupal/content/tea-washed-kashan - I added two 'size' attributes and specified the prices for each of them equal to how much the rugs of the particular size is for sale. The way it seems to work is the price is added to the price of the original product instead. I would like to modify that behavior so that instead of adding to the cost, it sets to the cost of the item in cart. This is possible I'm sure, because everything is possible, but I'm not sure where to begin to make it work like that. Any help would be appreciated.

I want to modify the function of ubercart attributes so that the price inputted does not add/subtract to the cost of the base product, but instead entirely changes the cost, setting it to the value specified. I found in ubercart/uc_attribute/uc_attribute.module function _uc_attribute_alter_form() has a line "'price' => $product->sell_price + $option->price," that I changed to "'price' => $option->price," which only visually makes products appear to be less, but when adding to cart it does not take effect. I, of course, want to write my own module to permanently make this change, but I'm not sure where to start to create a module to accomplish that. Any pointers?

Also in ubercart/uc_attribute/uc_attribute.module function uc_attribute_cart_item has
$item->price += $op_prices;
which I changed to
$item->price = $op_prices;

How can I write a module to make these changes permanent so that when upgrading ubercart, they aren't lost?

If I want to modify function uc_attribute_cart_item, what function listed at http://api.drupal.org/api/group/hooks/6 would I focus on to accomplish that?