Charging per fixed amount of days for events.

  • Posts: 4
  • Thank you received: 0
11 years 10 months ago #85106

Hi I have a question on the best way to charge for for renting Items. The site is only renting items for spescific events that have a set amount of days. So some events we need to charge for 2 days (product price x 2) some events we need to charge 3days (product price x 3) or if its a one day event we just charge the base price (1 day).

I would think we could use Characteristics (1 day price $10.00, 2 day price $20.00, 3 day price $30.00) but we don't want the client to be able to select the amount of days as they are fixed for the event, or can we force a category to not show the other characteristics or is there a way to for items in a category to multiply based on what category they are in. Or maybe I'm not aware of another option such as a plugin based on a category to do what we are needing.


Our current way our store is set up.
All events have there own category.
We have a category for packages and the items here have "options" , the options products have Characteristics for amounts the users wants to select.
Next we have Item rentals that are single Items fro rent but we have options set on them so they can select thing they need with that item.

Thanks in advance for any advice on the best way to do this.

Last edit: 11 years 10 months ago by troylight.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
11 years 10 months ago #85137

So I found the way to do this is make a joomla plugin that i based off your your "Custom Quantity Weight plugin".

So i made 3 Custom fields using "Table-Items" and a "Field type -Radio Button", one for each day, (1 day rental with value of 1) (2 day rental with value of 2) (3 day rental with value of 3). Then I can assign the one i need to a category-(event) depending on how many days we are billing for that event.

Ok that part is fine and working well if we add it to the cart it changes price based on Value number set in the Custom field i made. Now I have 2 more questions.

1- I need to locate the best way to change the wording-text in 2 places. The product price "each" i need to "Each Day" or "Per Day" but only on some categories and i need to make other categories to say some other wording Like "Per Hour".

2- The "Price with options" I also need to say "Price with options per day" but again only on some categories.

My other thought is to make the price change based on my rental days value. How can that be done? is the an override for that?

Thanks in advance for any help here!!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
11 years 10 months ago #85138

Well i fond that the plugin only add my "rental days" to the product and not the options on the product. How can i get the plugin to add to the product option? I do have the Custom field set to the category i have all of the items in.

<?php
jimport('joomla.plugin.plugin');
class plgSystemCustom_quantity_days extends JPlugin{
}

function hikashop_product_price_for_quantity_in_cart(&$product){
	$currencyClass = hikashop::get('class.currency');
	$quantity = @$product->cart_product_quantity;
	if(!empty($product->ordered_days)){
		$quantity = $quantity*$product->ordered_days;
	}
	$currencyClass->quantityPrices($product->prices,$quantity,$product->cart_product_total_quantity);
}

function hikashop_product_price_for_quantity_in_order(&$product){
	$quantity = $product->order_product_quantity;
	if(!empty($product->ordered_days)){
		$quantity = $quantity*$product->ordered_days;
	}
	$product->order_product_total_price_no_vat = $product->order_product_price*$quantity;
	$product->order_product_total_price = ($product->order_product_price+$product->order_product_tax)*$quantity;
}

I also tried Group options with product and both do the same.

Attachments:
Last edit: 11 years 10 months ago by troylight.

Please Log in or Create an account to join the conversation.

  • Posts: 82817
  • Thank you received: 13357
  • MODERATOR
11 years 10 months ago #85252

Hi,

The system call the trigger for both the options and the main products.
However, only the main product has the custom field values.
So you need to have something in place in your code to store the custom field value of the main product in order to use it for the option.

For example:
static $main_product_field_value = array();
if(empty($product->ordered_days)){
$product->ordered_days = $main_product_field_value[$product->cart_product_option_parent_id];
}else{
$main_product_field_value[$product->cart_product_id] = $product->ordered_days;
}

The following user(s) said Thank You: troylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum