Support » Plugin: WooCommerce » Price won’t reflect to the Cart and Total

  • Resolved shekinahorochina

    (@shekinahorochina)


    I have a custom field for personalized product.
    Having minimum of 5 characters and maximum of 7 chars.
    The prices are:
    1-5 Chars: P29,800
    Add-ons: P2,500 per char

    The problem is the price of custom field won’t reflect in cart and total.

    This is my code:

    /* for family tree */
    function thwepo_product_field_extra_cost_char_range($price, $product_price, $price_info){
        $value = isset($price_info['value']) ? $price_info['value'] : false;
        if(!empty($value)){
            $qty = strlen($value);
            if($qty > 0){
               $price = 29800;
                if($qty < 6){
                   $price = 29800;
                }else if($qty == 6){
                   $price = $price+2500;
                       }else{
                        $price = $price+5000;
                      }
                  }
             }
            return $price;
         }
    add_filter('thwepo_product_field_extra_cost_famtree', 'thwepo_product_field_extra_cost_char_range', 10, 3);

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.