Support » Plugin: WooCommerce Smart COD » Bug in “Disable if cart amount is greater than”

  • Resolved simonattilahun

    (@simonattilahun)


    If the “Disable if cart amount is greater than” feature is enabled by adding a numeric value, then in case of a higher value than specified, the delivery and payment options block on the checkout page keeps showing the refresh animation without an end.

    I would appreciate your advice.

    WP version: 4.9.4
    WooCommerce: 3.2.6
    WooCommerce Smart COD: 1.4.9

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi simonattilahun,

    I can’t reproduce this error with the exact same software version you mentioned.
    It’s probably a conflict with another plugin or the theme.

    Please be kind enough to provide me your php error log related to our plugin.

    If you don’t know how to find this, please post your shop url, so I can try to figure this out myself. ( For the second option, please change your WP_DEBUG to true, in your wp-config.php, so I can trace the error. )

    Best Regards

    Dear Stratos,

    Thanks a lot for your feedback. This is what I found. Does it help?
    [13-Feb-2018 20:13:31 UTC] PHP Warning: DOMDocument::loadHTML(): ID side-widget-button already defined in Entity, line: 63 in /home/okosotth/public_html/webaruhaz/wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php on line 250
    [13-Feb-2018 20:13:31 UTC] PHP Warning: DOMDocument::loadHTML(): Unexpected end tag : p in Entity, line: 113 in /home/okosotth/public_html/webaruhaz/wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php on line 250
    [13-Feb-2018 20:13:31 UTC] PHP Warning: DOMDocument::loadHTML(): Unexpected end tag : p in Entity, line: 184 in /home/okosotth/public_html/webaruhaz/wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php on line 250

    Best regards,

    Attila

    Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi Attila,

    Yes it helped indeed.
    I will check it soon and give you a solution to your problem.

    Best Regards

    Thanks a lot, I appreciate your help.
    Attila

    Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi Attila,
    I checked this out and the reason you get this warning is because of invalid HTML code in your theme, ( or maybe a checkout plugin ? ).

    More specific on the payment-method.php file.
    The first warning is for something called “side-widget-button”.If that rings a bell try to disable it. The other is for an unclosed p tag.

    You can see for yourself if you switch to storefront or any other wp default theme, or by disabling the problematic plugin( If it’s not a theme issue and you actually use a checkout plugin ).

    The available solutions if you can’t do any of those I mentioned before are:

    a) on our file “wc-smart-cod/public/class-wc-smart-cod-public.php” line 250
    replace
    $doc->loadHTML( mb_convert_encoding( $data[ '.woocommerce-checkout-payment' ], 'HTML-ENTITIES', 'UTF-8' ) );
    with
    @$doc->loadHTML( mb_convert_encoding( $data[ '.woocommerce-checkout-payment' ], 'HTML-ENTITIES', 'UTF-8' ) );

    OR

    b) Remove all the COD Unavailable Messages from our plugin settings

    Again those are not the ideal solutions. You should really fix your html code. But if it’s not something you can do right now, the above solutions will work.

    Best Regards

    Thanks a lot.
    Workaround a) would work fine. But I tried to find and fix the root causes.
    So the multiple “side-widget-button” elements were found and eliminated, now this line is not part of the error log any more.
    Regarding the unexpected closing P elements, I see them in the source code of the page, but have no idea what produces them. After disabling all plugins other than WooCommerce itself and the COD plugin, they are still there.

    I would be grateful if you could have a look at the site and advise how to continue the fix. The site is: https://www.okosotthon.bolt.hu/webaruhaz/. If you add products into the cart with total value over 100k Ft, than on the checkout page you’ll see the Shipping method and Payment method boxes frozen.

    Thanks in advance for your help.

    Attila

    Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi Attila,

    The problematic closing p tag, is in your terms and conditions markup.
    More specific it’s
    </div> <!-- .et_pb_section --><strong></p>
    You notice the </p> in the end?
    It’s in line 833 ( if you hit right click and view page source )

    Best Regards

    Well, I doublechecked the code and I do not see any HTML errors. Also, the W3 validator confirms this. The mentioned closing P has its beginning.

    The beginning P is here: <p><div class=”et_pb_section et_pb_section_0 et_section_regular”>

    Can you please doublecheck?

    Attila

    Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi again,

    I already run it through W3 validator, this is how I got the error line.
    You have to copy paste from the “view page source” to W3 validator.

    Also a div inside a p is not a valid html. Probably that’s the issue.

    ( see here: https://stackoverflow.com/questions/10763780/putting-div-inside-p-is-adding-an-extra-p )

    Thanks, understood.
    The mentioned P block seems to come from WooCommerce itself. We’ll report this bug to them.

    Until fixed, “wc-smart-cod/public/class-wc-smart-cod-public.php” line 250 is modified as you suggested.

    Thnks a lot for your support, it’s highly appreciated.
    Attila

    Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi again,
    I doubt that is WooCommerce’s issue.
    Why don’t you simple remove the div tags and let the p tag as it is?

    Best Regards

    You are right, I found the root cause. The bad code from coming not from WooCommerce but DIVI editor used in General Terms page, which gets included into the checkout page. Now fixed.

    Thanks for all the help!
    Attila

    Plugin Author Stratos Vetsos

    (@fullstackhouse)

    Hi,
    Not problem at all 🙂

    It will be lot appreciated, if you give us a review.

    Best Regards

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Bug in “Disable if cart amount is greater than”’ is closed to new replies.