Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter yohanim

    (@yohanim)

    After I added this code, the code now works. Please review the update of version 6.4.2

    if(is_countable (get_the_terms( $post->ID, ‘product_cat’ )))
    $cat_count = sizeof( get_the_terms( $post->ID, ‘product_cat’ ) );

    if(is_countable( get_the_terms( $post->ID, ‘product_tag’ )))
    $tag_count = sizeof( get_the_terms( $post->ID, ‘product_tag’ ) );

    Thank you

    • This reply was modified 1 year, 2 months ago by yohanim.
    • This reply was modified 1 year, 2 months ago by yohanim.
    Thread Starter yohanim

    (@yohanim)

    Hi @babylon1999

    Thank you for your answer. I was looking for variations in my product and not found any variation. I just add the simple product. However, could you inform me where the variations section is located?

    If I filtered by variable product the result is 0.

    Furthermore, the case is developed. Yesterday I want to import the woocommerce category by using csv with format as bellow

    Categories,
    Air Management System,
    Air Management System > Air Management System,

    It turns out automatically create the product as well. So I deleted the empty record of the product and suddenly my product turns to 20 and the stock becomes 90. The problem is only with the stock. (I have only 20 products)

    Thread Starter yohanim

    (@yohanim)

    Hi @xue28

    Thank you for getting back to me. Here is the screenshot of my import section

    <span style=”color: rgb(254, 254, 255); font-family: Lato, sans-serif; font-size: 18px; white-space: pre;”>https://snipboard.io/YjPnNu.</span&gt;

    So how to achieve only import category and subcategory in Woocommerce? Is there any information regarding the database or query or maybe third party plugin (free version please :D)?

    Thank you

    Thread Starter yohanim

    (@yohanim)

    Hi @roxannestoltz

    Thank you for your response. Yes, The REST API return stock is 22 and I’m suspicious that the system miss counted the product.

    I have trying to reimport historical data with no luck.

    Could you provide the REST API script located? also if you have a sql query it could be really helpful.

    Cordially

    yohanim

    (@yohanim)

    Hi @xue28, I have the same problem. After trying to regenerate the image and make sure the dimension is right, our shop still not having the same size of the product image. Our row product looks messy.

    Perhaps is come from CSS, could it be?

    • This reply was modified 2 years ago by yohanim.
    Thread Starter yohanim

    (@yohanim)

    Hi @ihereira

    Thank you for getting back to me. I have done all stuff in the tools section, and Indeed also does Clear Transients and nothing happened.

    In the logs there is no error, only notice. Per my previous comment, I think the problem comes from REST API (please see my previous comment). Can you inform me where the script is located? I think its all about query script I wanted to check the file.

    Thank you and have a nice day

    Thread Starter yohanim

    (@yohanim)

    Hi @xue28

    Thank you for getting back to me and sorry for delayed responds.

    I have create staging environment and disabled all plugins except woocommerce and the result is no luck. Still the analytical -> stock shown 22 products instead of 20. I’m not sure where the added 2 items comes from.

    Here is the status report:

    WordPress Environment
    
    WordPress address (URL): https://***.com/1677740899954
    Site address (URL): https://***.com/1677740899954
    WC Version: 7.4.1
    REST API Version:  7.4.1
    WC Blocks Version:  9.4.4
    Action Scheduler Version:  3.5.4
    Log Directory Writable: 
    WP Version: 6.1.1
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: 
    Language: en_US
    External object cache: –
    
    Server Environment
    
    Server Info: LiteSpeed
    PHP Version: 7.4.32
    PHP Post Max Size: 512 MB
    PHP Time Limit: 240
    PHP Max Input Vars: 5000
    cURL Version: 7.71.0
    OpenSSL/1.1.1d
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.5.12-MariaDB-cll-lve
    Max Upload Size: 512 MB
    Default Timezone is UTC: ?</img>
    fsockopen/cURL: ?</img>
    SoapClient: ?</img>
    DOMDocument: ?</img>
    GZip: ?</img>
    Multibyte String: ?</img>
    Remote Post: ?</img>
    Remote Get: ?</img>
    
    Database
    
    WC Database Version: 7.4.1
    WC Database Prefix: wpstg0_
    Total Database Size: 67.34MB
    Database Data Size: 58.82MB
    Database Index Size: 8.52MB
    ****
    
    Post Type Counts
    
    attachment: 908
    client: 45
    custom-css-js: 2
    customize_changeset: 19
    mega_menu: 1
    nav_menu_item: 56
    page: 134
    portfolio: 5
    post: 6
    product: 20
    revision: 341
    sa_slider: 1
    shop_order: 1
    team: 22
    testimonial: 4
    vc_grid_item: 1
    wp_global_styles: 1
    wpcf7_contact_form: 2
    wpforms: 2
    
    Security
    
    Secure connection (HTTPS): ?</img>
    Hide errors from visitors: ?</img>
    
    Active Plugins (4)
    
    Contact Form 7: by Takayuki Miyoshi – 5.7.4
    WPBakery Page Builder: by Michael M - WPBakery.com – 6.10.0
    WooCommerce: by Automattic – 7.4.1
    WP LESS: by Oncle Tom – 1.9.3-3
    
    Inactive Plugins (20)
    
    ***
    
    Settings
    
    API Enabled: –
    Force SSL: –
    Currency: ***
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 0
    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: ?</img>
    Enforce Approved Product Download Directories: –
    Order datastore: WC_Order_Data_Store_CPT
    
    WC Pages
    
    Shop base: #12 - /?page_id=12
    Cart: #13 - /?page_id=13
    Checkout: #14 - /?page_id=14
    My account: #15 - /?page_id=15
    Terms and conditions: ?</img> Page not set
    
    Theme
    
    Name: Storefront
    Version: 4.2.0
    Author URL: https://woocommerce.com/
    Child Theme: ?</img> – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ?</img>
    
    Templates
    
    Overrides: –
    
    Admin
    
    Enabled Features: activity-panels
    analytics
    coupons
    customer-effort-score-tracks
    import-products-task
    experimental-fashion-sample-products
    shipping-smart-defaults
    shipping-setting-tour
    homescreen
    marketing
    multichannel-marketing
    mobile-app-banner
    navigation
    new-product-management-experience
    onboarding
    onboarding-tasks
    remote-inbox-notifications
    remote-free-extensions
    payment-gateway-suggestions
    shipping-label-banner
    subscriptions
    store-alerts
    transient-notices
    woo-mobile-welcome
    wc-pay-promotion
    wc-pay-welcome-page
    
    Disabled Features: minified-js
    product-variation-management
    settings
    
    Daily Cron: ?</img> Next scheduled: 2023-03-03 05:38:59 +07:00
    Options: ?</img>
    Notes: 49
    Onboarding: completed
    
    Action Scheduler
    
    Complete: 974
    Oldest: 2023-01-30 18:18:24 +0700
    Newest: 2023-03-02 14:52:48 +0700
    
    Failed: 75
    Oldest: 2022-10-31 21:09:17 +0700
    Newest: 2023-03-01 17:08:50 +0700
    
    Pending: 1
    Oldest: 2023-03-03 11:31:03 +0700
    Newest: 2023-03-03 11:31:03 +0700
    
    Status report information
    
    Generated at: 2023-03-02 14:57:11 +07:00

    furthermore, After I tried to analyze the problem I found that 22 items are comes from Rest API. I have tried to use interceptor and here is what I got

    GET https://***.com/1677740899954/index.php?rest_route=%2Fwc-analytics%2Freports%2Fstock%2Fstats&fields%5B0%5D=products&fields%5B1%5D=outofstock&fields%5B2%5D=lowstock&fields%5B3%5D=instock&fields%5B4%5D=onbackorder&_locale=user HTTP/1.1
    Host: ***.com
    Connection: keep-alive
    sec-ch-ua: "Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"
    Accept: application/json, */*;q=0.1
    sec-ch-ua-mobile: ?0
    X-WP-Nonce: 924f7b30ee
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
    sec-ch-ua-platform: "Windows"
    Sec-Fetch-Site: same-origin
    Sec-Fetch-Mode: cors
    Sec-Fetch-Dest: empty
    Referer: https://***.com/1677740899954/wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Fstock
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,id;q=0.7
    Cookie: wp_woocommerce_session_912aa1b71abd8cc030d743464ae4ca31=1%7C%7C1677915433%7C%7C1677911833%7C%7C8e21c23164dc10748ff0b8b2006560ab; wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_912aa1b71abd8cc030d743464ae4ca31=root%7C1677916198%7CrWs0JMwZze04JW3Y88lVfbwnKht12ef90y6TtANmxqY%7Caa016a97520f382d99e57f4ff266d8c94694d4843ca9e0a692ba177806cd22da; __gsas=ID=faa830e7bf5e8924:T=1661448941:S=ALNI_MbEXlAFnVgO5gX6v68jCAikCTdVTg; tk_or=%22https%3A%2F%2Fwww.***.com%2F%22; _wpfuuid=5e76ca82-b27d-4309-8579-2db345a18ee9; mp_5d545622e3a040aca63f2089b0e6cae7_mixpanel=%7B%22distinct_id%22%3A%20%22***.com%22%2C%22%24device_id%22%3A%20%221843dcc26e0b29-0ceceed1433ae8-26021e51-1fa400-1843dcc26e1fca%22%2C%22%24user_id%22%3A%20%22***.com%22%2C%22active_theme%22%3A%20%22foundry-child%22%2C%22locale%22%3A%20%22en_US%22%2C%22mysql_version%22%3A%20%2210.5.12-MariaDB-cll-lve%22%2C%22php_version%22%3A%20%227.4.32%22%2C%22plugin%22%3A%20%22Smush%22%2C%22plugin_type%22%3A%20%22free%22%2C%22plugin_version%22%3A%20%223.12.3%22%2C%22server_type%22%3A%20%22%22%2C%22wp_type%22%3A%20%22single%22%2C%22wp_version%22%3A%20%226.0.3%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2F***.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dsmush%22%2C%22%24initial_referring_domain%22%3A%20%22***.com%22%7D; tk_lr=%22%22; tk_r3d=%22%22; mailchimp_landing_site=https%3A%2F%2F***.com%2Fwp-admin%2Fplugins.php%3Faction%3Ddeactivate%26plugin%3Dmailchimp-for-woocommerce%252Fmailchimp-woocommerce.php%26plugin_status%3Dall%26paged%3D1%26s%26_wpnonce%3D869333a53b; wp-settings-1=libraryContent%3Dbrowse%26post_settings_vcUIPanelWidth%3D650%26post_settings_vcUIPanelLeft%3D800px%26post_settings_vcUIPanelTop%3D74px%26edit_element_vcUIPanelWidth%3D985%26edit_element_vcUIPanelLeft%3D406px%26edit_element_vcUIPanelTop%3D54px%26editor%3Dtinymce%26advImgDetails%3Dshow%26post_dfw%3Doff%26panel_vcUIPanelWidth%3D650%26panel_vcUIPanelLeft%3D791px%26panel_vcUIPanelTop%3D74px%26hidetb%3D1%26mfold%3Do%26posts_list_mode%3Dexcerpt; wp-settings-time-1=1677661555; wordpress_test_cookie=WP%20Cookie%20check; _lscache_vary=5cd2ced63c5bfff9d8ee6c26ff0fb90f; wordpress_logged_in_ee938a329fda37ff02bae0bb6c7d9934=root%7C1677913123%7CLfC7pgPhE8lDNeHUahcT58KO0YQKrifXpgudYm40YDH%7C8b514cb64532c8fee090a48e4cd78958bfd5908a6c6d670a325a7a9a4b5f508c; wfwaf-authcookie-9ecbde3368e4f99a2fb6383fea8b2df2=1%7Cadministrator%7Cmanage_options%2Cunfiltered_html%2Cedit_others_posts%2Cupload_files%2Cpublish_posts%2Cedit_posts%2Cread%7C132c6a1e9e44a81afadf56004d55be9bc681230d9cfcd2f9299d8c18124d88a9; tk_ai=woo%3AmmUU9Ln2YLoe64nRXURdgxqP; woocommerce_items_in_cart=1; woocommerce_cart_hash=ab17f6b0e5c2abee40e037be0c1cf3b2; wp_woocommerce_session_ee938a329fda37ff02bae0bb6c7d9934=1%7C%7C1677913268%7C%7C1677909668%7C%7C6d2d3546bb70f141017a4010c1943ed8; tk_qs=path%3Danalytics_stock%26jetpack_installed%3Dtrue%26jetpack_active%3Dfalse%26jetpack_connected%3Dfalse%26has_navigation%3Dtrue%26_via_ua%3DMozilla%252F5.0%2520(Windows%2520NT%252010.0%253B%2520Win64%253B%2520x64)%2520AppleWebKit%252F537.36%2520(KHTML%252C%2520like%2520Gecko)%2520Chrome%252F110.0.0.0%2520Safari%252F537.36%26_via_ip%3D114.124.214.190%26_lg%3Den-GB%26_dr%3Dhttps%253A%252F%252F***.com%252F1677740899954%252Fwp-admin%252Fadmin.php%253Fpage%253Dwc-status%26_dl%3Dhttps%253A%252F%252F***.com%252F1677740899954%252Fwp-admin%252Fadmin.php%253Fpage%253Dwc-admin%2526path%253D%25252Fanalytics%25252Fstock%26url%3Dhttps%253A%252F%252F***.com%26blog_lang%3Den_US%26blog_id%3D214463376%26products_count%3D20%26wc_version%3D7.4.0%26_en%3Dwcadmin_page_view%26_ui%3Dwoo%253AmmUU9Ln2YLoe64nRXURdgxqP%26_ut%3Danon%26_ts%3D1677744090050%26_tz%3D-7%26_pf%3DWin32%26_ht%3D1080%26_wd%3D1920%26_sx%3D0%26_sy%3D0
    
    

    and here is the respond the total product in stock is 22.

    {"totals":{"lowstock":0,"instock":22,"outofstock":0,"onbackorder":0,"products":22}}

    and here is another API that tried to get detail, the response detail is 20

    GET https://***.com/1677740899954/index.php?rest_route=%2Fwc-analytics%2Freports%2Fstock&orderby=stock_status&order=asc&page=1&per_page=25&type=all&_locale=user HTTP/1.1
    Host: ***.com
    Connection: keep-alive
    sec-ch-ua: "Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"
    Accept: application/json, */*;q=0.1
    sec-ch-ua-mobile: ?0
    X-WP-Nonce: 924f7b30ee
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
    sec-ch-ua-platform: "Windows"
    Sec-Fetch-Site: same-origin
    Sec-Fetch-Mode: cors
    Sec-Fetch-Dest: empty
    Referer: https://***.com/1677740899954/wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Fstock
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,id;q=0.7
    Cookie: wp_woocommerce_session_912aa1b71abd8cc030d743464ae4ca31=1%7C%7C1677915433%7C%7C1677911833%7C%7C8e21c23164dc10748ff0b8b2006560ab; wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_912aa1b71abd8cc030d743464ae4ca31=root%7C1677916198%7CrWs0JMwZze04JW3Y88lVfbwnKht12ef90y6TtANmxqY%7Caa016a97520f382d99e57f4ff266d8c94694d4843ca9e0a692ba177806cd22da; __gsas=ID=faa830e7bf5e8924:T=1661448941:S=ALNI_MbEXlAFnVgO5gX6v68jCAikCTdVTg; tk_or=%22https%3A%2F%2Fwww.***.com%2F%22; _wpfuuid=5e76ca82-b27d-4309-8579-2db345a18ee9; mp_5d545622e3a040aca63f2089b0e6cae7_mixpanel=%7B%22distinct_id%22%3A%20%22***.com%22%2C%22%24device_id%22%3A%20%221843dcc26e0b29-0ceceed1433ae8-26021e51-1fa400-1843dcc26e1fca%22%2C%22%24user_id%22%3A%20%22***.com%22%2C%22active_theme%22%3A%20%22foundry-child%22%2C%22locale%22%3A%20%22en_US%22%2C%22mysql_version%22%3A%20%2210.5.12-MariaDB-cll-lve%22%2C%22php_version%22%3A%20%227.4.32%22%2C%22plugin%22%3A%20%22Smush%22%2C%22plugin_type%22%3A%20%22free%22%2C%22plugin_version%22%3A%20%223.12.3%22%2C%22server_type%22%3A%20%22%22%2C%22wp_type%22%3A%20%22single%22%2C%22wp_version%22%3A%20%226.0.3%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2F***.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dsmush%22%2C%22%24initial_referring_domain%22%3A%20%22***.com%22%7D; tk_lr=%22%22; tk_r3d=%22%22; mailchimp_landing_site=https%3A%2F%2F***.com%2Fwp-admin%2Fplugins.php%3Faction%3Ddeactivate%26plugin%3Dmailchimp-for-woocommerce%252Fmailchimp-woocommerce.php%26plugin_status%3Dall%26paged%3D1%26s%26_wpnonce%3D869333a53b; wp-settings-1=libraryContent%3Dbrowse%26post_settings_vcUIPanelWidth%3D650%26post_settings_vcUIPanelLeft%3D800px%26post_settings_vcUIPanelTop%3D74px%26edit_element_vcUIPanelWidth%3D985%26edit_element_vcUIPanelLeft%3D406px%26edit_element_vcUIPanelTop%3D54px%26editor%3Dtinymce%26advImgDetails%3Dshow%26post_dfw%3Doff%26panel_vcUIPanelWidth%3D650%26panel_vcUIPanelLeft%3D791px%26panel_vcUIPanelTop%3D74px%26hidetb%3D1%26mfold%3Do%26posts_list_mode%3Dexcerpt; wp-settings-time-1=1677661555; wordpress_test_cookie=WP%20Cookie%20check; _lscache_vary=5cd2ced63c5bfff9d8ee6c26ff0fb90f; wordpress_logged_in_ee938a329fda37ff02bae0bb6c7d9934=root%7C1677913123%7CLfC7pgPhE8lDNeHUahcT58KO0YQKrifXpgudYm40YDH%7C8b514cb64532c8fee090a48e4cd78958bfd5908a6c6d670a325a7a9a4b5f508c; wfwaf-authcookie-9ecbde3368e4f99a2fb6383fea8b2df2=1%7Cadministrator%7Cmanage_options%2Cunfiltered_html%2Cedit_others_posts%2Cupload_files%2Cpublish_posts%2Cedit_posts%2Cread%7C132c6a1e9e44a81afadf56004d55be9bc681230d9cfcd2f9299d8c18124d88a9; tk_ai=woo%3AmmUU9Ln2YLoe64nRXURdgxqP; woocommerce_items_in_cart=1; woocommerce_cart_hash=ab17f6b0e5c2abee40e037be0c1cf3b2; wp_woocommerce_session_ee938a329fda37ff02bae0bb6c7d9934=1%7C%7C1677913268%7C%7C1677909668%7C%7C6d2d3546bb70f141017a4010c1943ed8; tk_qs=path%3Danalytics_stock%26jetpack_installed%3Dtrue%26jetpack_active%3Dfalse%26jetpack_connected%3Dfalse%26has_navigation%3Dtrue%26_via_ua%3DMozilla%252F5.0%2520(Windows%2520NT%252010.0%253B%2520Win64%253B%2520x64)%2520AppleWebKit%252F537.36%2520(KHTML%252C%2520like%2520Gecko)%2520Chrome%252F110.0.0.0%2520Safari%252F537.36%26_via_ip%3D114.124.214.190%26_lg%3Den-GB%26_dr%3Dhttps%253A%252F%252F***.com%252F1677740899954%252Fwp-admin%252Fadmin.php%253Fpage%253Dwc-status%26_dl%3Dhttps%253A%252F%252F***.com%252F1677740899954%252Fwp-admin%252Fadmin.php%253Fpage%253Dwc-admin%2526path%253D%25252Fanalytics%25252Fstock%26url%3Dhttps%253A%252F%252F***.com%26blog_lang%3Den_US%26blog_id%3D214463376%26products_count%3D20%26wc_version%3D7.4.0%26_en%3Dwcadmin_page_view%26_ui%3Dwoo%253AmmUU9Ln2YLoe64nRXURdgxqP%26_ut%3Danon%26_ts%3D1677744090050%26_tz%3D-7%26_pf%3DWin32%26_ht%3D1080%26_wd%3D1920%26_sx%3D0%26_sy%3D0
    
    

    I’m not sure but I think the problem comes is about data issue and from the rest API script that query into our database and perhaps the condition not suitable for my case.

    I have my information could help you to further investigation.

    Looking forward for your best solution.

Viewing 7 replies - 1 through 7 (of 7 total)