• Resolved Alex

    (@jandru)


    Hi!

    We have a shipping zone with fixed price shipping type and some shipping classes. In this shipping type we has been configured a formula for every shipping classes. For example ([qty]*2)+7.93

    When you save and edit again the shipping type, the formulas disappear and the edition modal show “N/D” for every shipping class.

    In front store, if you select a product and adds it in cart, the calculated price for shipping type is right

    After investigate, in database the formulas has been saved right. These options are saved in wp_options table with serialized values (for example, woocommerce_flat_rate_1_settings). In the Woocommerce administration page these values are right requested because in source page there is a javascript variable (shippingZoneMethodsLocalizeScript) but these are not shown when the modal is opened.

    Example of this variable when we show the source of WC administration page:

    var shippingZoneMethodsLocalizeScript = {
      methods: {
        1: {
          cost: "",
          type: "order",
          supports: [
            "shipping-zones",
            "instance-settings",
            "instance-settings-modal",
          ],
          id: "flat_rate",
          method_title: "Precio fijo",
          method_description:
            "<p>Te permite cobrar un precio fijo por env\u00edo.</p>\n",
          enabled: "yes",
          title: "gastos de env\u00edo",
          rates: [],
          tax_status: "taxable",
          fee: null,
          minimum_fee: null,
          instance_id: 1,
          instance_settings: {
            title: "gastos de env\u00edo",
            tax_status: "taxable",
            cost: "",
            class_cost_24: "([qty]*2)+7.93",
            class_cost_26: "([qty]*2)+7.93",
            class_cost_25: "",
            class_cost_23: "([qty]*2)+7.93",
            class_cost_27: "",
            no_class_cost: "",
            type: "order",
            class_cost_60: "",
            class_cost_64: "([qty]*2)+7.93",
            class_cost_62: "([qty]*2)+7.93",
            class_cost_65: "",
            class_cost_66: "([qty]*2)+7.93",
            class_cost_96: "",
            class_cost_95: "",
          },

    The edition modal show:

    Are we doing something wrong?

    Thank you in advance!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Alex

    (@jandru)

    Hi again,

    One thing I didn’t remember to say is we are using WPML for translate our site. Could it be related?

    More debug info:

    We have debuged the fetch “edit” action, and seems that all data is correct. Shipping class cost are available in property settings, but the HTML generated for load into the modal edition has not these values.

    The value 12345 is the only one that is being displayed in the form field, but not the formula values.

    Thanks!

    Mirko P.

    (@rainfallnixfig)

    Hi there

    It seems like the shipping class cost formulas are getting saved correctly in the database, but they are not being displayed when you edit the shipping method again.

    WPML is generally compatible with WooCommerce, but there could be specific scenarios where conflicts arise.

    Are you using the default shipping functionality in WooCommerce or enhancing it with a shipping plugin? Could you please share your site’s system status? – You can find it via?WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, you can paste it into your reply.

    Thanks!

    Thread Starter Alex

    (@jandru)

    Hi Mirko!

    Thank you for your answer

    First, to be sure, I have disabled all plugins (also wpml) but this behiavor still happen.

    I debugged in local and at this point esc_attr( $this->get_option( $key ) gets the right value from options, but when the code does the flush in page, the value in form input fields are empty. Only works fine when value is numeric.

    Also, this is the info from the system report

    `
    ### WordPress Environment ###
    
    WordPress address (URL): https://b2b.local
    Site address (URL): https://b2b.local
    WC Version: 8.4.0
    REST API Version: ? 8.4.0
    WC Blocks Version: ? 11.6.2
    Action Scheduler Version: ? 3.7.0
    Log Directory Writable: ?
    WP Version: 6.4.2
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.43 (Unix)
    PHP Version: 8.0.30
    PHP Post Max Size: 1,000 MB
    PHP Time Limit: 1200
    PHP Max Input Vars: 4000
    cURL Version: 8.1.2
    (SecureTransport) LibreSSL/3.3.6
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.28
    Max Upload Size: 300 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 8.4.0
    WC Database Prefix: wp_
    Total Database Size: 15.01MB
    Database Data Size: 10.75MB
    Database Index Size: 4.26MB
    wp_woocommerce_sessions: Data: 1.17MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_actions: Data: 0.45MB + Index: 0.59MB + Engine InnoDB
    wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_logs: Data: 0.34MB + Index: 0.28MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_icl_background_task: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_content_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_core_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_languages: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_icl_languages_translations: Data: 0.20MB + Index: 0.17MB + Engine InnoDB
    wp_icl_locale_map: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_message_status: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_icl_mo_files_domains: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_node: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_reminders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_strings: Data: 0.06MB + Index: 0.09MB + Engine InnoDB
    wp_icl_string_batches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_string_packages: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_string_positions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_string_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_string_translations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_icl_translate: Data: 0.22MB + Index: 0.02MB + Engine InnoDB
    wp_icl_translate_job: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_translations: Data: 0.08MB + Index: 0.13MB + Engine InnoDB
    wp_icl_translation_batches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_translation_downloads: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_translation_status: Data: 0.17MB + Index: 0.02MB + Engine InnoDB
    wp_jetpack_sync_queue: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_njt_fastdup_entities: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_njt_fastdup_packages: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_options: Data: 3.13MB + Index: 0.08MB + Engine InnoDB
    wp_postmeta: Data: 1.52MB + Index: 0.83MB + Engine InnoDB
    wp_posts: Data: 1.52MB + Index: 0.14MB + Engine InnoDB
    wp_sc_delivery_methods: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_sc_delivery_zones: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 0.28MB + Index: 0.09MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
    wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
    wp_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_product_meta_lookup: Data: 0.06MB + Index: 0.09MB + Engine InnoDB
    wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wdr_order_discounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wdr_order_item_discounts: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wdr_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    _mig_queue_failures: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    _mig_queue_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    _mig_wpmdb_alter_statements: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    attachment: 98
    custom_css: 1
    customize_changeset: 22
    page: 17
    post: 4
    product: 36
    product_variation: 360
    revision: 145
    shop_order_placehold: 12
    wcb2b_group: 1
    wp_global_styles: 2
    wp_navigation: 2
    wp_template: 12
    wp_template_part: 6
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (13) ###
    
    Query Monitor: by John Blackbourn – 3.15.0
    WPML Multilingual CMS: by OnTheGoSystems – 4.6.8
    Block Visibility: by Nick Diego – 3.1.2
    Integración con Holded: by Holded – 3.4.7
    The Icon Block: by Nick Diego – 1.6.0
    LoginPress: by LoginPress – 3.0.4
    Sendcloud | Smart Shipping Service: by Sendcloud B.V. – 2.3.0
    WC - APG NIF/CIF/NIE Field: by Art Project Group – 2.1.0.2
    WooCommerce Multilingual & Multicurrency: by OnTheGoSystems – 5.3.2
    PDF Invoices & Packing Slips for WooCommerce: by WP Overnight – 3.7.5
    WooCommerce: by Automattic – 8.4.0
    WPML String Translation: by OnTheGoSystems – 3.2.8
    YayPricing Pro - WooCommerce Dynamic Pricing And Discounts: by YayCommerce – 2.4.9
    
    ### Inactive Plugins (3) ###
    
    Klaviyo: by Klaviyo
    Inc. – 3.3.3
    
    My Private Site: by David Gewirtz – 3.0.14
    WooCommerce B2B: by Code4Life – 3.3.4
    
    ### Dropin Plugins (1) ###
    
    db.php: Query Monitor Database Class (Drop-in)
    
    ### Settings ###
    
    API Enabled: ?
    Force SSL: –
    Currency: EUR (€)
    Currency Position: right_space
    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 Woo.com: –
    Enforce Approved Product Download Directories: ?
    HPOS feature screen enabled: ?
    HPOS feature enabled: ?
    Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore
    HPOS data sync enabled: –
    
    ### WC Pages ###
    
    Shop base: #494 - /tienda/
    Cart: #495 - /carrito/
    Checkout: #496 - /finalizar-compra/
    My account: #22 - /
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: B2B - based on Twenty Twenty-Four
    Version: 1.0
    Author URL: https://b2b.local/
    Child Theme: ?
    Parent Theme Name: Twenty Twenty-Four
    Parent Theme Version: 1.0
    Parent Theme Author URL: https://www.remarpro.com
    WooCommerce Support: ? Not declared
    
    ### Templates ###
    
    Overrides: /Users/dev/Local Sites/b2b/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/templates/notices/error.php
    /Users/dev/Local Sites/b2b/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/templates/notices/notice.php
    /Users/dev/Local Sites/b2b/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/templates/notices/success.php
    
    
    ### Admin ###
    
    Enabled Features: activity-panels
    analytics
    product-block-editor
    coupons
    core-profiler
    customer-effort-score-tracks
    import-products-task
    experimental-fashion-sample-products
    shipping-smart-defaults
    shipping-setting-tour
    homescreen
    marketing
    mobile-app-banner
    navigation
    onboarding
    onboarding-tasks
    product-variation-management
    product-virtual-downloadable
    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: customize-store
    minified-js
    new-product-management-experience
    product-external-affiliate
    settings
    async-product-editor-category-field
    
    Daily Cron: ? Next scheduled: 2023-12-16 06:25:07 +01:00
    Options: ?
    Notes: 67
    Onboarding: completed
    
    ### Action Scheduler ###
    
    Complete: 1,401
    Oldest: 2023-11-16 07:26:13 +0100
    Newest: 2023-12-15 17:59:37 +0100
    
    Failed: 7
    Oldest: 2023-11-16 07:40:32 +0100
    Newest: 2023-12-14 15:28:17 +0100
    
    Pending: 1
    Oldest: 2023-12-16 09:54:25 +0100
    Newest: 2023-12-16 09:54:25 +0100
    
    
    ### Status report information ###
    
    Generated at: 2023-12-15 18:02:58 +01:00
    `

    Thank you again!

    Thread Starter Alex

    (@jandru)

    Hi!

    And, as a final test, with WC version 8.3.1 works fine. Fails from 8.4.0 version.

    Thanks! ??

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @jandru,

    Thank you for sharing more details with us. Just to troubleshoot the issue further, could you please try using a default theme like StoreFront with both the latest and the 8.3.1 versions of WooCommerce?

    Looking forward to your reply.

    Thread Starter Alex

    (@jandru)

    Hi @ckadenge! Of course!

    I installed the StoreFront theme with the 8.4.0 version of WooCommerce and the issue remains

    Then I had a downgrade to 8.3.1 version of WooCommerce and firstly the data did not appear, but after fill again and save, it was ever again available and editable.

    After do these two tests, I updated again WooCommerce from 8.3.1 to 8.4.0 with WordPress plugins administration, I went again to WC -> Settings -> Shipping -> Edit Zone -> Edit Shipping methods, and the values are not available.

    I hope that these tests can help to find the issue root

    Thank you so much

    Thread Starter Alex

    (@jandru)

    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hey @jandru,

    I think the issue is related with https://github.com/woocommerce/woocommerce/issues/42892

    Hmm, indeed – great find!

    Since this has already been reported as an issue, our devs will take a closer look at this and provide further input on the GitHub thread.

    I’d suggest subscribing to the GitHub issue to stay in the loop on updates as they happen. ??

    Cheers!

    Thread Starter Alex

    (@jandru)

    Hi @beautyofcode!

    Yes! I’m also watching (and subscribed) the issue reported on GitHub ??

    Thanks a lot!

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @jandru

    I’m glad to hear that you’re keeping an eye on the reported issue on GitHub.

    Your involvement and interest in the resolution process is greatly appreciated.

    We’re working diligently to resolve this issue, and your patience is much appreciated.

    Thanks again!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Problems with shipping types and shipping class prices’ is closed to new replies.