• Resolved Nate1

    (@nate1)


    We’ve been working on implementing a shop to run along side Vend and we’ve discovered that enabling w3tc on the site breaks the APIs ability to add stock to the site. The REST Api is set to Not to cache however once w3tc is enabled the API calls which work otherwise begin to through exceptions. There may be some others however testing this morning has shown that #5644 is an invalid image ID. shows consistently. This error means the products won’t publish.

    Can anyone advise on how this could be resolved. – I’ve also rung some tests on the imageID checking and the function wp_attachment_is_image returns 1/true so doesn’t appear to be a problem with the function in the API.

    {
        "data": {
            "code": "woocommerce_product_invalid_image_id",
            "message": "#5644 is an invalid image ID.",
            "data": {
                "status": 400
            }
        },
        "headers": {
            "Allow": "GET, POST"
        },
        "status": 400
    }

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @nate1,

    I am sorry for the issue you are having but I am happy to assist you with this.
    DO you have Object Cache and DB cache enabled?
    Are you using Woo REST API v2 or v3?

    Thread Starter Nate1

    (@nate1)

    Hello @vmarko

    Object Cache was not set during the error occurring, and have re-enabled w3tc and disabled the database cache and the API call has worked and published the product and images.
    REST API I believe is V2 – routes as follows /wc/v2/products/6192


    ### WordPress Environment ###

    WordPress address (URL):
    Site address (URL):
    WC Version: 3.7.0
    REST API Version: ? 1.0.2
    Log Directory Writable: ?
    WP Version: 5.2.2
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: ?
    WP Cron: ?
    Language: en_AU
    External object cache: –

    ### Server Environment ###

    Server Info: Apache
    PHP Version: 7.3.8
    PHP Post Max Size: 8 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    cURL Version: 7.58.0
    OpenSSL/1.1.1

    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.1.41-MariaDB-0ubuntu0.18.04.1
    Max Upload Size: 2 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?

    ### Database ###

    WC Database Version: 3.7.0
    WC Database Prefix: wpnfl_
    MaxMind GeoIP Database: ?
    Total Database Size: 24.62MB
    Database Data Size: 18.99MB
    Database Index Size: 5.63MB

    ### Security ###

    Secure connection (HTTPS): ?
    Hide errors from visitors: ?

    ### Active Plugins (18) ###

    Cloudflare: by John Wineman
    Furkan Yilmaz
    Junade Ali (Cloudflare Team) – 3.3.3

    Erident Custom Login and Dashboard: by Libin V Babu – 3.5.7
    HookMeUp – Additional Content for WooCommerce: by GetBowtied – 1.2.3 – Not tested with the active version of WooCommerce
    WPBakery Page Builder: by Michael M – WPBakery.com – 6.0.5
    Kadence WooCommerce Email Designer: by Kadence Themes – 1.3.3
    Max Mega Menu – Pro Addon: by megamenu.com – 1.7.1
    Max Mega Menu: by megamenu.com – 2.7.1.4
    Ninja Forms: by The WP Ninjas – 3.4.18
    Lazy Load by WP Rocket: by WP Rocket – 2.2.3
    Shopkeeper Extender: by GetBowtied – 1.5
    Easy Updates Manager: by Easy Updates Manager Team – 8.0.5
    WooCommerce Variation Swatches: by ThemeAlien – 1.0.4 – Not tested with the active version of WooCommerce
    W3 Total Cache: by Frederick Townes – 0.9.7.5
    WooCommerce Blocks: by Automattic – 2.3.1
    WooCommerce: by Automattic – 3.7.0
    Yoast SEO: by Team Yoast – 11.9
    WP Mail SMTP: by WPForms – 1.6.0
    REST API Log: by Pete Nelson – 1.6.7

    ### Inactive Plugins (6) ###

    Envato Market: by Envato – 2.0.1
    One Click Demo Import: by ProteusThemes – 2.5.2
    Password Protected: by Ben Huson – 2.2.5
    Velvet Blues Update URLs: by VelvetBlues.com – 3.2.9
    WebP Express: by Bj?rn Rosell – 0.14.22
    YITH WooCommerce Wishlist: by YITH – 2.2.13

    ### Dropin Plugins (1) ###

    advanced-cache.php: advanced-cache.php

    ### Settings ###

    API Enabled: –
    Force SSL: –
    Currency: NZD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)

    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)

    Connected to WooCommerce.com: –

    ### WC Pages ###

    Shop base: #2851 – /shop/
    Cart: #6 – /cart/
    Checkout: #7 – /checkout/
    My account: #8 – /my-account/
    Terms and conditions: ? Page not set

    ### Theme ###

    Name: Shopkeeper Child
    Version: 1.0
    Author URL: http:%20//www.getbowtied.com/
    Child Theme: ?
    Parent Theme Name: Shopkeeper
    Parent Theme Version: 2.9.1
    Parent Theme Author URL: https://www.getbowtied.com/
    WooCommerce Support: ?

    ### Templates ###

    Overrides: shopkeeper/woocommerce/archive-product.php
    shopkeeper/woocommerce/cart/cart-empty.php
    shopkeeper/woocommerce/cart/mini-cart.php version 3.5.0 is out of date. The core version is 3.7.0
    shopkeeper/woocommerce/checkout/form-coupon.php
    shopkeeper/woocommerce/checkout/form-login.php
    shopkeeper/woocommerce/content-product.php
    shopkeeper/woocommerce/content-product_cat.php
    shopkeeper/woocommerce/content-single-product.php
    shopkeeper/woocommerce/global/quantity-input.php
    shopkeeper/woocommerce/global/sidebar.php
    shopkeeper/woocommerce/global/wrapper-end.php
    shopkeeper/woocommerce/global/wrapper-start.php
    shopkeeper/woocommerce/loop/loop-end.php
    shopkeeper/woocommerce/loop/loop-start.php
    shopkeeper/woocommerce/loop/no-products-found.php
    shopkeeper/woocommerce/myaccount/form-login.php
    shopkeeper/woocommerce/order/form-tracking.php
    shopkeeper/woocommerce/single-product/add-to-cart/simple.php
    shopkeeper/woocommerce/single-product/product-image.php
    shopkeeper/woocommerce/single-product/product-thumbnails.php
    shopkeeper/woocommerce/single-product/tabs/tabs.php
    shopkeeper/woocommerce/single-product.php

    Outdated Templates: ?

    `

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    Can you please add /wc/v2/* to “Never cache the following pages:” under “Database Cache” section.
    I hope this helps.

    Thread Starter Nate1

    (@nate1)

    @vmarko working thanks, Will this be repaired in a later update?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @nate1,

    This is something too specific to be added to the plugin permanently. This is just a configuration required for this to work properly when DB Cache is enabled.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘W3TC API error with vend’ is closed to new replies.