WC cart quantity issue

engels
51 Posts
engels posted this 16 January 2019

Hi,
critical issue with displaying quantity in cart using a plugin for selecting product options (Uni Woo Custom Product Options "Uni CPO").

Following fatal error:


Fatal error: Uncaught ArgumentCountError: Too few arguments to function uni_cpo_woocommerce_cart_item_quantity(), 2 passed in /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-includes/class-wp-hook.php on line 286 and exactly 3 expected in /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-content/plugins/uni-woo-custom-product-options-premium/includes/uni-cpo-core-functions.php:963 Stack trace: #0 /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-includes/class-wp-hook.php(286): uni_cpo_woocommerce_cart_item_quantity('1 <input type ...', array) #2 ar/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-content/themes/wp24/woocommerce/cart/cart.php(121): apply_filters('woocommerce_car...', '1><input type="...', '34197ed9ed1deea...') #3 /var/www/vhosts/webundprint24.de/httpdoc in /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-content/plugins/uni-woo-custom-product-options-premium/includes/uni-cpo-core-functions.php on line 963


this is not an issue of the plugin. with other wp-/wc-themes it works fine.

thats what i tried already:
1. all plugins deactivated one by one: no success, fatal error in cart (column quantity)
2. tried standard themes twenty ninteen / twenty twelve: work fine
3. installed other themler theme: same fatal error
4. contacted the plugin-developer: must an issue on template-side.

see my site: www.webundprint24.de
see screenshots below:

correct card on theme nineteentwelve:

cart-nineteentwelve.jpg

corrupt themler output of the same cart:

cart-themler.jpg

can you point me to any solution?

thanks a lot.
koepi
type
type

Hi, critical issue with displaying quantity in cart using a plugin for selecting product options (Uni Woo Custom Product Options "Uni CPO"). Following fatal error: ____ Fatal error: Uncaught ArgumentCountError: Too few arguments to function uni_cpo_woocommerce_cart_item_quantity(), 2 passed in /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-includes/class-wp-hook.php on line 286 and exactly 3 expected in /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-content/plugins/uni-woo-custom-product-options-premium/includes/uni-cpo-core-functions.php:963 Stack trace: #0 /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-includes/class-wp-hook.php(286): uni_cpo_woocommerce_cart_item_quantity('1 &lt;input type ...&#39;, array) #2 ar/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-content/themes/wp24/woocommerce/cart/cart.php(121): apply_filters(&#39;woocommerce_car...&#39;, &#39;1&gt;&lt;input type=&quot;...&#39;, &#39;34197ed9ed1deea...&#39;) #3 /var/www/vhosts/webundprint24.de/httpdoc in /var/www/vhosts/webundprint24.de/httpdocs/webundprint24_website_shop/wp-content/plugins/uni-woo-custom-product-options-premium/includes/uni-cpo-core-functions.php on line 963 ____ this is not an issue of the plugin. **with other wp-/wc-themes it works fine.** thats what i tried already: 1. all plugins deactivated one by one: no success, fatal error in cart (column quantity) 2. tried standard themes twenty ninteen / twenty twelve: work fine 3. installed other themler theme: same fatal error 4. contacted the plugin-developer: must an issue on template-side. see my site: [www.webundprint24.de][1] see screenshots below: correct card on theme nineteentwelve: !cart-nineteentwelve.jpg! corrupt themler output of the same cart: !cart-themler.jpg! can you point me to any solution? thanks a lot. koepi [1]: https://webundprint24.de type type

Last edited 16 January 2019 by engels

Vote to pay developers attention to this features or issue.
7 Comments
Order By: Standard | Newest
engels
51 Posts
engels posted this 17 January 2019

Find the solution on myself.
There is a missing argument in the template cart.php.

File: /wp-content/themes/your-themler-theme/woocommerce/cart/cart.php

Wrong: echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key );
Must be: echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item );

Tip: Replace original themler file with the updated cart.php with plugin booster. There is a modul to do that.
So your are update-save.

But, themler team: would be fine you to correct that within the next update.

Have success.
Koepi

Find the solution on myself. There is a missing argument in the template cart.php. File: /wp-content/themes/your-themler-theme/woocommerce/cart/cart.php Wrong: echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key ); Must be: echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, **$cart_item** ); Tip: Replace original themler file with the updated cart.php with plugin booster. There is a modul to do that. So your are update-save. But, themler team: would be fine you to correct that within the next update. Have success. Koepi

Last edited 17 January 2019 by engels

dambron.k
3 Posts
dambron.k posted this 21 January 2019

Thank you you helped me solve one of my problems,
however I just have a question. On my site one of my products is 30,00 € but it remains at 0,00 €,
I look for the solution but I can not find, I was on your site and I see that it works,
can you help me solve my problem please

Thank you you helped me solve one of my problems, however I just have a question. On my site one of my products is 30,00 € but it remains at 0,00 €, I look for the solution but I can not find, I was on your site and I see that it works, can you help me solve my problem please

Last edited 21 January 2019 by dambron.k

engels
51 Posts
engels posted this 22 January 2019

Yes I can.
This also is a typical themler problem. CPO cannot calculate price because of that: http://answers.themler.io/questions/147446/add-to-cart-button-within-the-form-product-variations

You have to place add-to-cart-button within the form. You can do that in your themler template directly, but thats not update-save. So I do that with wp-plugin "Real-Time Find and Replace", which replaces any code you search with new code.
In my case there are follwing replace steps to do. Note that you have to adjust the classes with your own ones. See them in the code of your website. Also if searching code for replacing use original output code from your site (your browser has a funktion to display the site code).

First Step: Delete original botton by searching
<button onclick="jQuery('.bd-productoverview [class*=bd-productvariations] form.cart').submit()" class=" bd-productbuy-6 bd-no-margins bd-button single_add_to_cart_button">

and replace it with nothing

Second Step: Replace the button within the form by searching
<script>jQuery('.bd-productvariations-3 table.variations label').css('display', 'inline');

and replace it with
<button onclick="jQuery('.bd-productoverview [class*=bd-productvariations] form.cart').submit()" class=" bd-productbuy-6 bd-no-margins bd-button single_add_to_cart_button">In den Warenkorb</button>
</form>
<script>
jQuery('.bd-productvariations-3 table.variations label').css('display', 'inline');

Last not least you have to use the correctly custom selector for price in CPO. In my case it is ".bd-pricetext-82 .bd-container-223" Find your classes with examine function of your browser.

Have success
Koepi

Yes I can. This also is a typical themler problem. CPO cannot calculate price because of that: http://answers.themler.io/questions/147446/add-to-cart-button-within-the-form-product-variations You have to place add-to-cart-button within the form. You can do that in your themler template directly, but thats not update-save. So I do that with wp-plugin "Real-Time Find and Replace", which replaces any code you search with new code. In my case there are follwing replace steps to do. Note that you have to adjust the classes with your own ones. See them in the code of your website. Also if searching code for replacing **use original output code from your site** (your browser has a funktion to display the site code). **First Step: Delete original botton by searching** &lt;button onclick="jQuery('.bd-productoverview [class*=bd-productvariations] form.cart').submit()" class=" bd-productbuy-6 bd-no-margins bd-button single_add_to_cart_button"> and replace it with nothing **Second Step: Replace the button within the form by searching** &lt;script&gt;jQuery('.bd-productvariations-3 table.variations label').css('display', 'inline'); and replace it with &lt;button onclick="jQuery('.bd-productoverview [class*=bd-productvariations] form.cart').submit()" class=" bd-productbuy-6 bd-no-margins bd-button single_add_to_cart_button"&gt;In den Warenkorb&lt;/button&gt; &lt;/form> &lt;script> jQuery('.bd-productvariations-3 table.variations label').css('display', 'inline'); Last not least you have to use the correctly custom selector for price in CPO. In my case it is ".bd-pricetext-82 .bd-container-223" Find your classes with examine function of your browser. Have success Koepi

Last edited 22 January 2019 by engels

dambron.k
3 Posts
dambron.k posted this 27 January 2019

thank you for your help, I tried but without success unfortunately. I did as you indicated to me, I show you the screen:

replacing

I show you the error message in the console:

error

If you have a solution I would be happy, I contact the developer but he could not answer me, I try with the theme "storefrond" and it works.

thank you for your help, I tried but without success unfortunately. I did as you indicated to me, I show you the screen: ![replacing][1] I show you the error message in the console: ![error][2] If you have a solution I would be happy, I contact the developer but he could not answer me, I try with the theme "storefrond" and it works. [1]: https://com-sept.com/wp-content/uploads/2019/01/remplace.jpg [2]: https://com-sept.com/wp-content/uploads/2019/01/error-1.jpg
engels
51 Posts
engels posted this 28 January 2019

Good morning,

seems you did insert wrong copy-paste-string.
And, yes, other themes work fine. This is only an issue with themler themes, which use an extraordinary coding (don't know why).
Give me the link to your shop. I'll try to extract YOUR properly code.

Koepi

Good morning, seems you did insert wrong copy-paste-string. And, yes, other themes work fine. This is only an issue with themler themes, which use an extraordinary coding (don't know why). Give me the link to your shop. I'll try to extract YOUR properly code. Koepi
dambron.k
3 Posts
dambron.k posted this 29 January 2019

Thank you very much for your help,

https://com-sept.com/produit/test/

Thank you very much for your help, https://com-sept.com/produit/test/
engels
51 Posts
engels posted this 29 January 2019

Sent you an E-Mail to contact@com-sept.com...

Sent you an E-Mail to contact@com-sept.com...
You must log in or register to leave comments