Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Custom attribute prefix


zeldaz

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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