• jordanmero

    (@jordanmero)


    I have created the shipping classes successfully, but I can't use the * [qty] function.
    
    however, there is a progressive option
    "Per Piece - Accumulate total by multiplying the quantity"
    
    but this option gives a multiplication error in sending
    since it does not multiply the number of times of the product by the shipping value of the class. What it does is a miscalculation that doesn't make sense.
    
    Any solution?
    
    I have seen the code inside
    foreach ($ progressive as $ value) {
    $ costs [$ value ['product_id']] = $ value ['item_cost'] * $ item ['quantity'];
    }
    In theory it makes sense but it doesn't work and it keeps doing a wrong calculation
    
    For instance:
    Product 1 ($ 3.19) - x- (4) qty (Shipping cost $ 5.00 x piece)
    Standard Cost $ 3
    Total shipping should be = $ 3 + $ 20 = $ 23.00
    but for some reason that I do not know the shipping value appears $ 74.85
    
    I have tried it with products of different prices thinking that I was multiplying the value of the product by the shipping cost, but the result is exactly the same
    
    any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jordanmero

    (@jordanmero)

    I just recently solve change the code with one parameter

    search in include\clasess\class-wcsdm-shipping-method.php

    foreach ($ progressive as $ value) {
    $ costs [$ value ['product_id']] = $ value ['item_cost'] * $ item ['quantity'];
    }

    change for

    foreach ($ progressive as $ value) {
    $costs[ $value['product_id'] ] = $class_cost * $value['quantity'];
    }

    works for me, so i hope you can resolve and update the plugin

    Best Regards

    Plugin Author Sofyan Sitorus

    (@sofyansitorus)

    Hello @jordanmero ,

    Thanks for the report and the fix submission. But $class_cost variable in there is not suppose to be used anymore in that code block. Maybe it will fix your case, but can cause issue in another case.

    Could you please include the screenshot of your table rate settings and the advanced rate settings? It will really helpful for me to reproduce your issue.

    Sofyan

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ERROR Multiplying Shipping Classes’ is closed to new replies.