Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Custom attribute prefix


  • You cannot reply to this topic
3 replies to this topic

#1 zeldaz

  • Community Member
  • 29 posts
  • Real Name:James Belle

Posted 08 May 2008, 13:35

Hi there,

I guess you all know that when you add a product attribute you can choose the prefix of + or -, but at the moment I am in need of * (times/multiplication).

I wish to make a sort of rental modification in that people can order products and each product will have a Days attribute and they can order it for a certain amount of days. If I enter the price of the product if renting it for 1 day, I can simply have the attribute set to * so that if they choose 4 days for example it will times the product amount (which is equal to one day) by 4 to get the total for the amount of rent.

I have edited the files:
includes/classes/shopping_cart.php
and
admin/includes/classes/shopping_cart.php

The edits:
			if ($attribute_price['price_prefix'] == '+') {
			  $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
			} elseif($attribute_price['price_prefix'] == '*') {
			  $this->total *= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
			}else{
			 $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
			 }

This then works for the shopping_cart pages but nothing else and the product attribute is having no effect else where. I need someone experienced to help me out on this one. Possible payment for solution may occur. Thanks all :)

#2 burt

  • Community Sponsor
  • 6,958 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 08 May 2008, 14:41

What you have done works OK in my test shop. Where is your problem arising?
The Dirty Little Secrets that no osCommerce template sellers want you to know...revealed...

Support is commercially available. The question is whether you value your business
highly enough to spend money on it.

For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/

#3 zeldaz

  • Community Member
  • 29 posts
  • Real Name:James Belle

Posted 08 May 2008, 21:11

When you go and checkout the totals in the checkout are not being multiplied so the customers are only purchasing 1 day even though they have the attribute Days set to 3 for example. Also once the order is placed in the admin backend when you look at it it is not being multiplied as well.

#4 addoughty

  • Community Member
  • 2 posts
  • Real Name:adam

Posted 17 July 2011, 09:36

Did any one ever find a solution to this?