• Hi,

    Loving the addon, but found a bug. When adding a product manually to the basket (by clicking the top left +) and then applying a coupon pos crashes with an error 500.

    Having looked into the apache logs I found the following:

    PHP message: PHP Fatal error: Uncaught Error: Call to a member function is_type() on bool in /var/www/vhosts/finecharmingnails.be/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-coupon.php:875\nStack trace:\n#0 /var/www/vhosts/finecharmingnails.be/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(329): WC_Coupon->is_valid_for_product()\n#1 /var/www/vhosts/finecharmingnails.be/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-discounts.php(262): WC_Discounts->get_items_to_apply_coupon()\n#2 /var/www/vhosts/finecharmingnails.be/httpdocs/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1132): WC_Discounts->apply_coupon()\n#3 /var/www/vhosts/finecharmingnails.be/httpdocs/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php(84): WC_Abstract_Order->apply_coupon()\n#4 /var/www/vhosts/finecharmingnails.be/httpdocs/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest...', referer: https://finecharmingnails.be/pos/?fbclid=IwAR2MDyQmfJ8J_LtZQ2NSJqWnHTaNjnl995qEoSozdJaZeG2PLS-tjZP8g_M

    Any idea how to get this fixed? Or is this a shorcoming from woocommerce itself and not POS. Seems the same error is trown when a product is added that is excluded from the coupon use.

    Debug:

    Array
    (
        [SERVER_SOFTWARE] => Apache
        [REQUEST_URI] => /wp-admin/edit.php?post_type=pos-station&page=pos
        [USER] => finecharmingnails
        [HOME] => /var/www/vhosts/finecharmingnails.be
        [SCRIPT_NAME] => /wp-admin/edit.php
        [QUERY_STRING] => post_type=pos-station&page=pos
        [REQUEST_METHOD] => GET
        [SERVER_PROTOCOL] => HTTP/1.0
        [GATEWAY_INTERFACE] => CGI/1.1
        [REMOTE_PORT] => 49068
        [SCRIPT_FILENAME] => /var/www/vhosts/finecharmingnails.be/httpdocs/wp-admin/edit.php
        [SERVER_ADMIN] => [no address given]
        [CONTEXT_DOCUMENT_ROOT] => /var/www/vhosts/finecharmingnails.be/httpdocs
        [CONTEXT_PREFIX] => 
        [REQUEST_SCHEME] => https
        [DOCUMENT_ROOT] => /var/www/vhosts/finecharmingnails.be/httpdocs
        [REMOTE_ADDR] => 78.23.15.52
        [SERVER_PORT] => 443
        [SERVER_ADDR] => 85.214.174.39
        [SERVER_NAME] => finecharmingnails.be
        [SERVER_SIGNATURE] => <address>Apache Server at finecharmingnails.be Port 443</address>
    
        [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        [HTTP_COOKIE] => wordpress_sec_fa5ffbbf387f6f94456b59dbab99b372=rousseauxy%7C1623068956%7CkBji6YlPKyyDp3E5iAxxjfJsR6lqQR6xx5y7mMrZVXj%7C339485bdd95934333dbf71eed99574ea96c47e50ad3222529462083fecc60ddf; vchideactivationmsg=1; vchideactivationmsg_vc11=6.6.0; tk_ai=woo%3AuFdzABrNiaH%2B8l9bArl6D%2BLS; wp-settings-1=editor%3Dtinymce%26libraryContent%3Dbrowse%26urlbutton%3Dnone%26hidetb%3D1%26wplink%3D1%26imgsize%3Dfull%26edit_element_vcUIPanelWidth%3D617%26edit_element_vcUIPanelLeft%3D1066px%26edit_element_vcUIPanelTop%3D74px%26panel_vcUIPanelWidth%3D649%26panel_vcUIPanelLeft%3D1057px%26panel_vcUIPanelTop%3D74px%26advImgDetails%3Dhide; wp-settings-time-1=1615795193; __utmc=88300556; __utmz=88300556.1617308833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=88300556.|1=logged-in=no=1; wordpress_test_cookie=WP%20Cookie%20check; __utma=88300556.1134398016.1617308833.1619220481.1619719121.6; woocommerce_recently_viewed=15566%7C17245%7C16203%7C15908%7C17091%7C17591%7C16418%7C17936%7C18986%7C16058%7C16073%7C8677%7C19458%7C19063%7C17472; wordpress_logged_in_fa5ffbbf387f6f94456b59dbab99b372=rousseauxy%7C1623068956%7CkBji6YlPKyyDp3E5iAxxjfJsR6lqQR6xx5y7mMrZVXj%7C0795d466e63eced8abd93334100b2683b6638c48d07ffaea0683fbdb184de271; wccpprocookie=excludethispage
        [HTTP_ACCEPT_LANGUAGE] => nl-BE,nl;q=0.9,en-BE;q=0.8,en;q=0.7,nl-NL;q=0.6,en-US;q=0.5
        [HTTP_ACCEPT_ENCODING] => gzip, deflate, br
        [HTTP_REFERER] => https://finecharmingnails.be/wp-admin/edit.php?s=start&post_status=all&post_type=product&action=-1&seo_filter&readability_filter&product_type&stock_status&fb_sync_enabled&paged=1&action2=-1
        [HTTP_SEC_FETCH_DEST] => document
        [HTTP_SEC_FETCH_USER] => ?1
        [HTTP_SEC_FETCH_MODE] => navigate
        [HTTP_SEC_FETCH_SITE] => same-origin
        [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
        [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36
        [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
        [HTTP_SEC_CH_UA_MOBILE] => ?0
        [HTTP_SEC_CH_UA] => \" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"
        [HTTP_CONNECTION] => close
        [HTTP_X_ACCEL_INTERNAL] => /internal-nginx-static-location
        [HTTP_X_REAL_IP] => 78.23.15.52
        [HTTP_HOST] => finecharmingnails.be
        [proxy-nokeepalive] => 1
        [HTTPS] => on
        [PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY] => 0
        [PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY] => 0
        [HTTP_AUTHORIZATION] => 
        [SCRIPT_URI] => https://finecharmingnails.be/wp-admin/edit.php
        [SCRIPT_URL] => /wp-admin/edit.php
        [FCGI_ROLE] => RESPONDER
        [PHP_SELF] => /wp-admin/edit.php
        [REQUEST_TIME_FLOAT] => 1622897986.2547
        [REQUEST_TIME] => 1622897986
    )
    
Viewing 1 replies (of 1 total)
  • Plugin Author bizswoop

    (@bizswoop)

    Thanks for reaching out and the feedback about loving the plugin.

    Unfortunately, at this time if a Custom Product is added to the order, the order will not be able to support a coupon. We are developing a v2 of the Custom Product functionality and working to provide a solution to this current limitation, including the ability to save the custom product and apply taxes.

    On the second issue related to coupon functionality parity with WooCommerce. We are actively working on this now to provide functionality related to excluded products on coupons. We hope to have that ready soon.

Viewing 1 replies (of 1 total)
  • The topic ‘Error 500 when applying coupon on custom product or excluded product’ is closed to new replies.