• Resolved sdooo

    (@sdooo)


    Hello all,
    Were the Tabs tested in new version of Woo Commerce? I see that there was an update regarding WP 3.8 but ever since that update WP Import All plugin won’t save those tabs during import even though they’ve worked before.
    Steps I have done so far:
    – I have removed and added those tabs again in case something in DB was off
    – In Custom Tabs section of WP Import All I have checked option: “Yes – Edit Tab Title & Content” and added my content there
    – Opened freshly imported product – tabs were not available there although you could add one manually and it would work just fine

    Any help would be appreciated.

    Thank you

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hey @sdooo,

    Yes, Custom Product Tabs for WooCommerce was tested against the new version of WooCommerce and everything works as expected.

    Potential Causes:
    – Our Update? Rule that out because we just updated a piece of text that says 3.8 after testing against WooCommerce. ??
    – Are you using our All Import Extension?
    https://www.ads-software.com/plugins/custom-product-tabs-wp-all-import-add-on/
    – Any other changes, new plugins you’ve added recently?

    Cheers,
    Freddie

    Thread Starter sdooo

    (@sdooo)

    Hey @fmixell,
    Thank you for a quick response!
    Yes, I do use your extension and now I see that this topic would probably better fit there as I even mentioned that I was able to add custom tab manually and it worked, just wasn’t able to import it automatically to my products.
    During the import itself I don’t even see any mention that custom tab is being imported and this log is really verbose for all the other changes – maybe the problem lays there?
    I’ve made quite a few changes on the page itself but the import job is more or less the same (don’t want to fool around with 5k+ products that are already imported).

    Cheers,
    Sebastian

    @sdooo,

    What are you using to export the products that you’re reimporting into WooCommerce? Was that done before and you’re just adding to the same export or are you exporting regularly?

    – Freddie

    Thread Starter sdooo

    (@sdooo)

    @fmixell,
    I use CSV exported by third party but nothing changed in the way those fields are casted.

    I import new products every x hours but I don’t update them once they are there. Is there any specific field I could try to update during my next import and see if it helps?

    Cheers,
    Sebastian

    @sdooo,

    Could you search the CSV and see if you can find yikes_ anywhere? That’s your post meta which holds the reference to the tabs. So if that’s missing its not exporting your meta fields.

    – Freddie

    Thread Starter sdooo

    (@sdooo)

    @fmixell,

    When I run “WP Export All”, I can see field “yikes_woo_products_tabs” in exported data but it’s empty.
    I’m still thinking there is something wrong with the plugin that connects Import and Custom Tabs as I don’t see any logs during import, not even errors

    Cheers,
    Sebastian

    • This reply was modified 5 years, 3 months ago by sdooo.

    Here’s the steps I took to do an export with All Export:

    – New Export
    – WooCommerce Products
    – Customize Export File
    – Select ‘yikes_woo_products_tabs’ under custom fields and drag that onto the page. (If you click in this you should be able to generate a preview here.)

    Preview Should look similar to this:

    View post on imgur.com

    – Exported as CSV
    – Opened CSV in Google Sheets and found yikes_woo_products_tabs with tab data.

    Your tabs wouldn’t show on the frontend of the site if you didn’t have that available on the products post type so that is very strange. I would try to begin a new export and see if you can preview the data.

    If that’s not there do you have access to your database through something like phpmyadmin?

    -Freddie

    • This reply was modified 5 years, 3 months ago by Freddie.
    Thread Starter sdooo

    (@sdooo)

    I do have access to database, I’m doing raw queries right now but phpMyAdmin shouldn’t too much of an issue to install.
    I want to get to the bottom of that so I:
    – created copy of the whole website
    – deleted all products and its variations
    – uninstalled and installed Custom Tab related plugins
    – ran import for ?round 100 products

    Still nothing. I’ve ran this command assuming this field is in post meta:
    SELECT meta_key, count(*) FROM wp_postmeta group by meta_key;
    There is no key that starts with yikes.

    Also, you mentioned export – I did an export just to get CSV of all metadata for my products and see if yikes_ fields are available. The issue lays (I think) within import as this field is not being created.

    Cheers,
    Sebastian

    Thread Starter sdooo

    (@sdooo)

    Thanks for the help, finally I was able to nail down this problem.
    I mentioned that I don’t update products once they are created and this is something that your plugin can’t handle. There is a function in Custom Tabs WP Import All addon called can_update_meta. It only cares about updating those tabs but doesn’t check if you actually want to update them at all – once I’ve added needed custom_fields to update column everything went smoothly, even though I created those products for the first time.

    I will keep it that way for the time being but I would really love to not update Custom Tabs for 5k~ products every time I do an import of the new ones.

    Hope this answer helps fix that bug!

    Cheers,
    Sebastian

    Hey @sdooo,

    Thanks for digging in and finding that, did you change something in that function to get it to work for you? Could you post a code snippet I’m not exactly sure I understand your use case so I think seeing what you did could help!

    Either way I’m glad you got it working for you!

    – Freddie

    Thread Starter sdooo

    (@sdooo)

    @fmixell,
    Sure, here is the relevant code in the plugin:

    
    function can_update_meta($meta_key, $import_options) {
    
    	//echo "<pre>";
    	//print_r($import_options['options']);
    	//echo "</pre>";
    
    	$import_options = $import_options['options'];
    
    	if ($import_options['update_all_data'] == 'yes') return true;
    
    	if ( ! $import_options['is_update_custom_fields'] ) return false;			
    
    	if ($import_options['update_custom_fields_logic'] == "full_update") return true;
    	if ($import_options['update_custom_fields_logic'] == "only" and ! empty($import_options['custom_fields_list']) and is_array($import_options['custom_fields_list']) and in_array($meta_key, $import_options['custom_fields_list']) ) return true;
    	if ($import_options['update_custom_fields_logic'] == "all_except" and ( empty($import_options['custom_fields_list']) or ! in_array($meta_key, $import_options['custom_fields_list']) )) return true;
    
    	return false;
    
    }
    

    As you can see it only checks if:
    – you want to update everything on import
    – if not, do you want to update custom fields on import
    – if yes, is this field called yikes_woo_product_tabs
    – if yes, continue
    – if not, don’t import custom tabs

    As you can see this logic is flawed as it doesn’t check if this field should be added when product is CREATED, it just checks if it should be UPDATED.

    To fix this, I had to check this option: https://prnt.sc/q6boa0 (even though I don’t want to update products once they’re imported)

    Hope this helps!

    • This reply was modified 5 years, 3 months ago by sdooo.

    @sdooo,

    Thank you for clarifying! I’ve added this functionality to my upgrades list now that I understand the use case fully. I don’t think we really anticipated people would be using the import to create new products as we were aiming more towards folks who were migrating a website.

    Is there any particular reason why you work from a spreadsheet and import the products after? I’ve noticed more and more people are working like this and I’m wondering if its just easier to manage outside of WooCommerce and then push it back up or if there is another reason?

    – Freddie

    Thread Starter sdooo

    (@sdooo)

    I’m getting CSV file from the third party and import their products to my site along with HTML text that fits Custom Tabs, I don’t create this file on my own. On the other hand, I can see the reasoning behind doing it – if the user wants to keep a backup somewhere or – like me – wants to be platform independent and be able to create everything automatically from the scratch, I’d keep the raw state somewhere, CSV in this case

    Cheers,
    Sebastian

    @sdooo,

    Ahh okay I bet a lot of people have a use case where they’re importing from a 3rd party vendor thanks for your help! Its always great when we can learn more about real world use cases to try to shape the future of the plugin, you rock!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Custom Tabs with new Woo Commerce’ is closed to new replies.