Code snippet: price adjustment for the specific value of cart order

This  code snippet will help you to offer a price adjustment for the certain value of the order.
Let’s say that you want to offer a price adjustment of 50% for ups ground service when the cart order is above than $40.
Steps to add code snippet:
1.Add the following code to your functions.php or anywhere relevant.
2. Then you need to set the variable  $minimum_cart_price_to_adjust to 40.
3. After that, you need to give the value of the service in the array for which you want the adjustment along with the adjustment value.
Let’s say you want 50% price adjustment for ups ground then you need to type
 ‘wf_shipping_ups:03’ => 0.5
To find the value  of the Service code, navigate to Cart/Checkout page. Right-click on the  service and select inspect. Check ‘value’ of shipping service to get the value for the service.
The code is as given below:

Comments (3)

  • Michael

    Hello, what i have to type for 100% price adjustment?

    November 15, 2017 at 1:57 pm
    • Anindo

      Hi Michael,

      If you want a 100% price adjustment, then you have to type in “‘wf_shipping_ups:01’ => 1”
      Try this and let us know if you have any query.

      November 15, 2017 at 3:07 pm
    • Michael

      Hi Anindo, sorry, “1” does not work.
      $available_shipping_methods[$key]->cost * $shipping_services_with_price[$key]: $available_shipping_methods[$key]->cost *1 = no diffrent.
      At the end shipping should be free when cart oder is above than $90
      Do you have any ideas? Thank you!

      November 15, 2017 at 3:50 pm

Leave a Reply