• Resolved chrisbg

    (@chrisbg)


    I have custom tab for Frequently Bought Together products in my woocommerce site, that shows up on single product page. When i update products via WP All Import, only one product show up in custom tab and should be a two. Here is the settings of custom fields import and actually view of the single product page.

    custom-fields-settings

    single-product-accessory-tab

    I’ll provide Single Product Accessories template, just to make it clear

    template function

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @chrisbg,

    When i update products via WP All Import, only one product show up in custom tab and should be a two.

    We’ll need to see this issue in action, and check the imported data in the database, to understand what’s going on.

    Please replicate the problem on a sandbox site at https://www.wpallimport.com/debug/ (you can install any necessary plugin to replicate it), then send a support request to https://www.wpallimport.com/support/ with the sandbox site URL, a brief description of what’s going on, and a link to this thread for reference.

    Thread Starter chrisbg

    (@chrisbg)

    Unfortunately i can’t reproduce this because accessories is a custom function template function Instead I found Filter: pmxi_custom_field

    
    /**
     * ==================================
     * Filter: pmxi_custom_field
     * ==================================
     *
     * Custom field values can be filtered before save using this hook.
     * 
     * [IMPORTANT NOTE]: THE $original_value parameter is new in WP All Import v4.5.6-beta-4.8 and should be excluded
     * in older versions of WP All Import.
     *
     * @param $value              string - The new custom field value from the data file
     * @param $post_id            int    - The id of the post
     * @param $key                string - The custom field key
     * @param $original_value     string - Original, unserialized, value. (NOTE: NEW IN WP All Import v4.5.6-beta-4.8)
     * @param $existing_meta_keys mixed  - ??? TODO: Document
     * @param $import_id          int    - The id of the import
     *
     * @return mixed
     */
    function my_custom_field($value, $post_id, $key, $original_value, $existing_meta_keys, $import_id)
    {
        // Unless you want this code to execute for every import, check the import id
        // if ($import_id === 5) { ... }
    
        return $value;
    }
    
    add_filter('pmxi_custom_field', 'my_custom_field', 10, 6);
    

    I want to return $value, which is product Id, for example key=0, value=64069, field options is Serialized. How can I achieve this?

    Plugin Author WP All Import

    (@wpallimport)

    Hey @chrisbg,

    I want to return $value, which is product Id, for example key=0, value=64069, field options is Serialized. How can I achieve this?

    I’m not sure if that’s the right hook to achieve what you’re trying to do, and unfortunately there’s no way for me to properly advise on this without seeing how the data is stored for a manually created product. If that’s only possible on your site, we can check it there, but you’ll have to open a support request via our site: https://www.wpallimport.com/support/.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP All Import don’t importing values from custom fields’ is closed to new replies.