Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Max Lyuchin

    (@cadic)

    Thanks @supportfitri !

    I also found the same issue in WC Vendors Pro (legacy controllers and commission download controller). I know it’s different plugin, but maybe here is the best place to communicate it to your team.

    Thread Starter Max Lyuchin

    (@cadic)

    I made a quick research and found the root cause:

    // class-wcv-order-controller.php:701

    $order_total += $vendor_order->get_item_total( $item, false, true );

    When you detect partial refund, the get_item_total() method of WC_Order is used, which will return the item price (instead of the line subtotal when we have quantity greater than 1). F.e. it will return “100” for the order line “Product 1: 100 x 5 = 500”. Later on the line 750, the $is_full_refund variable is assigned true, which is not correct.

    The fix is to use get_line_total() instead — it will return 500 for the example above and $is_full_refund will be assigned false (correct).

    I hope it will help to provide the fix, we really depend on it!

    • This reply was modified 7 months, 2 weeks ago by Max Lyuchin.
    Thread Starter Max Lyuchin

    (@cadic)

    Thanks for the quick fix @jkohlbach

    It looks like the better solution will be fixing the return value:

    diff --git a/classes/class-commission.php b/classes/class-commission.php
    index a1dccc3..eeaf404 100644
    --- a/classes/class-commission.php
    +++ b/classes/class-commission.php
    @@ -338,7 +338,7 @@ class WCV_Commission {
                                                            AND status = %s
                    ";
     
    -               return $wpdb->get_var( $wpdb->prepare( $query, $status ) ); //phpcs:ignore
    +               return intval( $wpdb->get_var( $wpdb->prepare( $query, $status ) ) ); //phpcs:ignore
            }

    Because the return value of WC_Vendors::check_commission_status() is declared “int”:

    /**
     * Check the commission status for the order.
     *
     * @param array  $order The order.
     * @param string $status The status.
     *
     * @return int
     */
    public static function check_commission_status( $order, $status ) {

    While in fact, the function returns $wpdb->get_var() which is always the string!

    In the other way, the same issue may happen with WC Vendors Pro in the future, which currently use non-strict compare (same as WC Vendors prior to 2.4.7.1 did)

    @dkotter same here, the image tag output turned from

    SafeSVG 1.9.9
    <img src="https://example.com/wp-content/uploads/2020/09/image.svg" class="attachment-medium size-medium entered lazyloaded" alt="" height="36.984" width="223.756" data-lazy-src="https://example.com/wp-content/uploads/2020/09/image.svg" data-ll-status="loaded">

    into

    SafeSVG 1.9.10
    <img width="300" height="300" src="https://example.com/wp-content/uploads/2020/09/image.svg" class="attachment-medium size-medium entered lazyloaded" alt="" data-lazy-srcset="https://example.com/wp-content/uploads//2020/09/image.svg 150w, https://example.com/wp-content/uploads//2020/09/image.svg 300w, https://example.com/wp-content/uploads//2020/09/image.svg 1024w, https://example.com/wp-content/uploads//2020/09/image.svg 1536w, https://example.com/wp-content/uploads//2020/09/image.svg 2048w, https://example.com/wp-content/uploads//2020/09/image.svg 100w" data-lazy-sizes="(max-width: 300px) 100vw, 300px" data-lazy-src="https://example.com/wp-content/uploads//2020/09/image.svg" data-ll-status="loaded" sizes="(max-width: 300px) 100vw, 300px" srcset="https://example.com/wp-content/uploads//2020/09/image.svg 150w, https://example.com/wp-content/uploads//2020/09/image.svg 300w, https://example.com/wp-content/uploads//2020/09/image.svg 1024w, https://example.com/wp-content/uploads//2020/09/image.svg 1536w, https://example.com/wp-content/uploads//2020/09/image.svg 2048w, https://example.com/wp-content/uploads//2020/09/image.svg 100w">

    The output is made with <?php echo wp_get_attachment_image( $attachment_id, 'medium' ); ?> in a custom theme.

    Also, please notice double slash in srcset URLs (the regular src attribute is correct).

    The original SVG image is:

    <?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="223.756" height="36.984" viewBox="0 0 223.756 36.984"> ... </svg>

    Looks like image attributes are not respected after the update when displaying medium image size: we just have default 300×300.

    Plugin Support Max Lyuchin

    (@cadic)

    No table buttons in regular posts too
    WP 3.8.3

    Forum: Fixing WordPress
    In reply to: time in the post

    You should open index.php (it maybe other file depending on your theme) in Appearance > Editor, then find something like <div class="author"><?php printf(__ ( 'by %s on', 'titan'), get_the_author()); ?> <?php the_time(__ ( 'F jS, Y', 'titan')); ?></div> (this example is for my Titan theme, yours may be different) – then you just need to cut (or better comment) that part.

    Use more button in the editor to cut the rest part of your posts

    What did you changed in httpd.conf?

    First, you should set up any FTP server and add a user account in it. Then you can force ftp://username:password@localhost/ as the connection string when installing or updating themes and plugins.

    The other way is to set the write permissions to the wp-contents directory, so wordpress could update plugins without FTP

    Hi MajinSaha!

    To make the transparent background of your images you need to save them in to PNG format.

Viewing 10 replies - 1 through 10 (of 10 total)