Providing the specified discount on the product when ordering more than 200 500

I do not know if there is a guru of Ubercart here, but here my question is:

I would like to provide discounts to customers who order more than 1 single product.

Assume prices are as follows:

1 product - $ 5 each
<10 products - $ 4.50 each
<100 products - $ 4 each

Does anyone know how to implement this? I thought about adding my own custom price fields, but I'm wondering how to call them in the basket / checkout.

+3
source share
2 answers

What about the uc_bulk_discount module ?

0
source

, - hook_uc_price_handler.

.

, "example", :

function example_uc_price_handler() {
  return array(
    'alter' => array(
      'title' => t('Quantity price discount handler'),
      'description' => t('Discounts the price based on quantity ordered'),
      'callback' => 'example_price_alterer',
    ),
  );
}

function example_price_alterer(&$price_info, $context, $options = array()){

    if($price_info['qty'] > 200){
        $price_info['price'] *= 0.8;  //we're reducing the price by 20% as a demo - add your logic here 
    }

}

;

http://www.ubercart.org/docs/developer/11375/price_api http://www.ubercart.org/forum/development/14381/price_alteration_hook http://api.ubercart.org/api/function/hook_uc_price_handler/2

0

Source: https://habr.com/ru/post/1774065/


All Articles