ole1986 / wp-ispconfig3

Wordpress ISPConfig plugin with Gutenberg support
https://wordpress.org/plugins/wp-ispconfig3/
28 stars 13 forks source link

Error with the function WC_Product_Webspace #13

Closed MisTerM7 closed 6 years ago

MisTerM7 commented 6 years ago

hello

See the error when you arrive when viewing the basket.

https://gyazo.com/1a3076a3b9a3a9166a402213d7e1bfb5

Mz

ole1986 commented 6 years ago

Thank you for reporting. will fix this asap

ole1986 commented 6 years ago

May you please provide me with some more details:

Thank you in advanced

MisTerM7 commented 6 years ago

Hi Version of wp-ispconfig : 1.3.2 Version of WooCommerce : 3.4.4 PHP Version : 7.2.7-0ubuntu0.18.04.2 Thank you Mz

ole1986 commented 6 years ago

WC_Product_Webspace:Period hooks into woocommerce_cart_item_quantity

This hook usually passes two arguments $product_quantity, $cart_item_key (details in the link). WC_Product_Webspace::Period(<qty>, 'bec26...')

In your case I am seeing that the "Qty" is not passing a number only in parameter one WC_Product_Webspace::Period('1 <input type="..', 'bec26...')

So I think you may have some other plugins activated which overwrites the qty parameter by adding some html content, which obviously isn the right way to do.

My recommendation: Try to deactivate all other plugins, except wp-ispconfig3 and woocommerce to see if the error still persist.

MisTerM7 commented 6 years ago

I just disable all plugins except yours and that of Woocommerce, nothing changes, the error is always the... Mz

ole1986 commented 6 years ago

While keeping all the other plugins disabled, please try to create fresh Webspace product and put this into the cart (make sure session is completely clean from the old product)

MisTerM7 commented 6 years ago

Hi Via this link, the zip file contains, the files of Woocommerce that works with my themes

https://mega.nz/#!HmJizK7D!yCss3YUwLWWqSaDNFRbWP0be_5_CFzwE1K118Zk48g0

When I migrate to the right version of Woocommerce, I see the basket, but I do not know how to go further, if you have not understood, here is the image to better understand what I come to tell you

https://gyazo.com/27dc5664811687ac68735804b8c565cb

Mz

ole1986 commented 6 years ago

Your them you send me is causing the error:

Check the LINE 87 or 97 of cart/cart.php

if ( $_product->is_sold_individually() ) {
    $product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key ); //
} else {
    $product_quantity = woocommerce_quantity_input( array(
        'input_name'  => "cart[{$cart_item_key}][qty]",
        'input_value' => $cart_item['quantity'],
        'max_value'   => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(),
        'min_value'   => '0'
    ), $_product, false );
}

echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key ); // <-- this line cause the filter to become qty different then expected. (other than a number)

I am pretty sure when using the theme "Storefront" for instance, all will work as expected. You may fix your custom theme or use a standard them then...

MisTerM7 commented 6 years ago

You know how to pass me your email address so I can ask you something in particular?

ole1986 commented 6 years ago

Just check out the Storefront theme to fix your issues. Alternatively, read the below ....

As this is no longer an issue on wp-ispconfig3 plugin but a service request for theming in WordPress you can fill up the service request form below or try to fix it yourself.

https://www.cloud86.de/request-form/

Please note, we may charge you for this service.