Store Locator Plus® for WordPress Forums Premier Support Too few arguments to function SLP_Premier_WooCommerce_Glue::add_location_id_to_o

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #56575
    INFO219
    Participant

    This is from our developer, who found the issue and fixed it for us. He requested I post this here so that it can fixed in SLP Premier plugin for next update.

    After recent updates
    WP 4.9.5
    WC 3.3.5
    SLP 4.9.14
    SLP Power 4.9.14
    SLP EXperience 4.9.14
    SLP Premier 4.9.14

    Our users received errors during checkout. The visual error to the user is:

    Uncaught SyntaxError: Unexpected token > in JSON at position 0

    Further inspection into inspector>console revealed an error within SLP Premier plugin, which said:

    Uncaught ArgumentCountError: Too few arguments to function SLP_Premier_WooCommerce_Glue::add_location_id_to_order_meta(), 3 passed in…

    Turns out the offending function in the file SLP_Premier_WooCommerce_Glue.php
    line 56

    Original version is:
    public function add_location_id_to_order_meta( $id, $item_id, $product, $qty, $args ) {
    wc_add_order_item_meta( $item_id, ‘_location_id’, $this->slplus->currentLocation->id );
    }

    as add_location_id_to_order_meta seems to be called with only 3 arguments (and the other 2 don’t seem to be used), I changed it to:

    public function add_location_id_to_order_meta( $id, $item_id, $product, $qty=0, $args=null ) {
    wc_add_order_item_meta( $item_id, ‘_location_id’, $this->slplus->currentLocation->id );
    }

    everything worked ok after that change.

    #56579
    Cici
    Keymaster

    Thank you, the developer will fix it in the next Premier update!!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.