Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Attributes , prefix


Markoni

Recommended Posts

Hi people,

Can anybody know how can I deseble prefix.. and use attributes , Option value

without + prefix.. ? Just the price I put in attributes (option value)

 

I want to sell images on my stock.. and I need a 3 options

When somebody click to product.. that he have option example:

Low resolution 5$

Medium res. 10 $

High res. 15 $

 

At this moment if I put price on that product 5 $

and put option Medium res. with 10$

the total oreder will be 5 $ + 10$ = 15$

 

How can I correct this?

 

Thank you

Link to comment
Share on other sites

  • 10 months later...
  • 3 months later...
I am having the same issue... did u get the solution for prefix???

please share that with me also... that will be geat.

 

I made the following code change to both shopping_cart.php files. I added $product_prices as a parameter to attribute_price(). I changed all references to attribute_price() to not do an addition of $product_prices and instead do the math here. I made up a price_prefix of '@' to fix the price to the given value instead of doing addition or subtraction.

 

function attributes_price($products_id, $products_prices) {

$attributes_price = 0;

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '+') {

$attributes_price += $attribute_price['options_values_price'];

}

else if ($attribute_price['price_prefix'] == '@') {

return $attribute_price['options_values_price'];

}

else {

$attributes_price -= $attribute_price['options_values_price'];

}

}

}

 

return $products_price + $attributes_price;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...