Jump to content

How can I change the price off shipping due to the value in order confirmation and order paymants?


adrian24a

Recommended Posts

Hi

 

Sorry for my English,

 

How can I change the value of the shipping in order confirmation and order paymants? I have to change the price of shipping for all producers called Elfa when the value of order will be above 1000 dolars. How can I do it and in which file I can do it? Or how can I insert the shipping price from shopping cart?

 

Thanks for any help

Edited by adrian24a (see edit history)
Link to comment
Share on other sites

I solved this problem. In file classes/Cart.php in function getTotalShippingCost I add this code:

$products = $this->getProducts();
		$nbTotalProducts = 0;
		
		$nbTotElfaPrice = $this->getOrderTotal(true, Cart::ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING, $product_list);//getOrderTotal($use_tax); getOrderTotal
		
		foreach($products as $product)
		{
			if(strstr($products['name'], "Elfa"))
			{
				$nbTotalElfaPrice = $nbTotElfaPrice;
				
			}
		}
		
		if(strstr($product['name'], "Elfa")&&($nbTotElfaPrice<1000))
		{
			return $total_shipping=30;
		}
		else
			return $total_shipping;

Greetings

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...