One time cost

  • Posts: 26
  • Thank you received: 1
7 years 4 months ago #256753

-- url of the page with the problem -- : www.slimbedacht.nu/bloomingnotes/index.p...roduct/eigen-ontwerp
-- Joomla version -- : 2.6.4

Hi,

We have a product page to order a rose with a custom print on it. This custom print requires a custom made stamp wich costs 15 euro's. When someone orders 10 of these roses, there is only one stamp of 15 euro's that has to be made. But when i order 2 roses with different custom prints. there are 2 stamps that have to be made wich costs 30 euros.

What could be the best way of adding one time costs to a product. I'm not looking for one time costs over the whole cart, not looking for including the costs in the price. But looking for one time costs over this product.

I think this is quite a basic requirement.

Thanks!

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
7 years 4 months ago #256754

Hi,

The easiest method I can see to do that without any code is to turn on the "use shipping price per product" in your shipping methods.
Then, in the products, you can set that cost in the shipping price of each shipping method.
That way, the cost can be fixed regardless of the quantity of the product in the cart and would be added to the shipping fees you already have.

When you say that you want the one time cost per custom print, I suppose that the custom print is done with a custom item field.
In that case, there is no system to be able to configure one cost per different value of the product item field.
That's clearly not basic.
In that case, I can only recommend the development of a custom plugin. Thanks to that, you'll be able to make any kind of calculation any way you want and add it to any price you want in the cart as long as the plugin is done properly.

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

  • Posts: 26
  • Thank you received: 1
7 years 4 months ago #256914

Hi,

I know this method, but this method has a problem. It will add shipping fee for each variant. But when the variant is the samen but only the custom field is different, the system is not taking the shipping fee in account.

I have a screenshot. As you can see i have 3 products in the cart, each with a different text. The shipping fee should be 3 x 15. But its only 2 x 15 because there are only two variants.



For developing a plugin i can only find a way to modify the price per product (because the system is calculating the price each time dynamically). But that's not what i'm looking for. I need to add a fee on top of the total product price.

A perfect situation would be if i could force a option, wich wil only added once to the cart per product.

Could you tell me the best way to approach this plugin? (just a description of the best approach)

thanks!

Attachments:

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

  • Posts: 26
  • Thank you received: 1
7 years 4 months ago #256946

I have started a approach myself in the onAfterCartUpdate function:

		$stampId = 3447;
		$cartContent = $cartClass->loadFullCart();
		$products = $cartContent->products;
//			count the amount of different texts
		$texts = array();
		foreach ($products as $product){
			if($product->eigenontwerptypen){
//				ook nog upload erbij betrekken
				$texts[] = $product->eigenontwerptypen;
			}
		}


		$cartClass->updateEntry(count($texts), $cartClass->get($cart->cart_id), $stampId,0);
It counts the products in the cart with a specific custom field and adds products to the cart(quantity: the count of the products) of the id 3447. It works but i want to delete the products with id 3447 each time the cart updates so the amount is always right. Now the each time the cart updates it adds products of the id 3447 to the cart.

How could this be done?


Could you please answer my previouws question aswell about the shipping method solution. This would be the most simple solution but it's just not working the way i need.

Thanks in advance

Last edit: 7 years 4 months ago by Jerome. Reason: [code] is nice

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
7 years 4 months ago #256919

Hi,

A plugin is the way to go.
There are many ways to go about it.
You could have a shipping plugin, and by implementing the onShippingDisplay trigger, you could calculate the shipping fee you want :
www.hikashop.com/support/documentation/6...ml#onShippingDisplay
You could also develop a plugin based on that plugin:
www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511
With that, you can add additional fees to a cart between the subtotal and the total.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum