Forum Replies Created

Viewing 15 replies - 1 through 15 (of 2,840 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Peter,

    I am sorry that it is difficult to create SKU | Content Tab 1 | Content Tab 2. I think that is the only solution for this.

    If I knew an easier way, I would tell you.

    All the best,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Excellent! Enjoy the plugin! Let us know if anything else comes up.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Peter,

    I understand what you’re saying.

    Do your CSV 1 and CSV 2 files use the same WP All Import configuration?

    Are you able to change your CSV files at all? Can you set it up so that both files have SKU | Content Tab 1 | Content Tab 2?

    If Content Tab 1 is empty in CSV 2, then the tab won’t be added to product.

    I think it’d be helpful if you could send me a screenshot of what your custom product tabs section looks like in the import. A screenshot like this: https://imgur.com/a/V6GS5Zw. Can you send me that?

    Thank you,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Excellent! Glad that’s working. Cool to see you using tabs with the REST API.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Daniel,

    Our tabs also include a tab slug. I think the problem is that you are missing a tab slug. WooCommerce may be trying to use the title as the slug and that is breaking only Technische Daten because it’s two words.

    Try updating your snippet to this:

    if( !empty($prodrs['MARMEXTRATAB1']) ) {
    	$customTabs[] = array(
    		'title'   => 'Technische Daten',
                    'id'      => sanitize_title( 'Technische Daten' ),
    		'content' => $prodrs['MARMEXTRATAB1']
    	);				
    }
    if( !empty($prodrs['MARMEXTRATAB2']) ) {
    	$customTabs[] = array(
    		'title'   => 'Abmessungen',
                    'id'      => sanitize_title( 'Abmessungen' ),
    		'content' => $prodrs['MARMEXTRATAB2']
    	);				
    }
    
    'meta_data' => [
    	[
    		'key' => 'yikes_woo_products_tabs',
    		'value' => $customTabs
    	]			
    ]

    Let me know if that works.

    Cheers,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @danna556,

    You’ll need to update this function in a few ways to match your use case.

    1. Replace ‘your_post_meta_key’ with the meta key of your ACF field.

    2. Replace ‘YOUR-TAB-SLUG’ with the name of the tab you want to hide if the ACF field is empty.

    You can check as many ACF fields and unset as many tabs as you’d like.

    add_filter( 'woocommerce_product_tabs', 'yikes_woo_maybe_hide_tabs', 20, 1 );
    
    function yikes_woo_maybe_hide_tabs( $tabs ) {
    	global $post;
    
    	if ( empty( $post ) || empty( $post->ID ) ) {
    		return $tabs;
    	}
    
    	// Get your ACF post meta here:
    	$acf_field = get_post_meta( $post->ID, 'your_post_meta_key', true );
    
    	if ( empty( $acf_field ) ) {
    		unset( $tabs['YOUR-TAB-SLUG'] ); // e.g. additional_information, description, etc.
    	}
    
    	return $tabs;
    }

    Hope that makes sense.

    Let me know.

    Cheers,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @maxxifoil,

    The problem is with the [ux_gallery]‘s shortcode ids argument.

    I don’t know why WP All Import has an issue with this. I’ve gotten in touch with them about this before but haven’t seen any changes.

    I agree with you though that this shouldn’t throw an error if you’re explicitly not importing that tab.

    We’ll make a ticket and look into this again.

    Thank you,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Sure – look at the file yoursite/plugins/woocommerce/templates/single-product/tabs/tabs.php

    This is the code in that file that drives the tabs template:

    <?php
    /**
     * Single Product tabs
     *
     * This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php.
     *
     * HOWEVER, on occasion WooCommerce will need to update template files and you
     * (the theme developer) will need to copy the new files to your theme to
     * maintain compatibility. We try to do this as little as possible, but it does
     * happen. When this occurs the version of the template file will be bumped and
     * the readme will list any important changes.
     *
     * @see 	https://docs.woocommerce.com/document/template-structure/
     * @package WooCommerce/Templates
     * @version 2.4.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    
    /**
     * Filter tabs and allow third parties to add their own.
     *
     * Each tab is an array containing title, callback and priority.
     * @see woocommerce_default_product_tabs()
     */
    $tabs = apply_filters( 'woocommerce_product_tabs', array() );
    
    if ( ! empty( $tabs ) ) : ?>
    
    	<div class="woocommerce-tabs wc-tabs-wrapper">
    		<ul class="tabs wc-tabs" role="tablist">
    			<?php foreach ( $tabs as $key => $tab ) : ?>
    				<li class="<?php echo esc_attr( $key ); ?>_tab" id="tab-title-<?php echo esc_attr( $key ); ?>" role="tab" aria-controls="tab-<?php echo esc_attr( $key ); ?>">
    					<a href="#tab-<?php echo esc_attr( $key ); ?>"><?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', esc_html( $tab['title'] ), $key ); ?></a>
    				</li>
    			<?php endforeach; ?>
    		</ul>
    		<?php foreach ( $tabs as $key => $tab ) : ?>
    			<div class="woocommerce-Tabs-panel woocommerce-Tabs-panel--<?php echo esc_attr( $key ); ?> panel entry-content wc-tab" id="tab-<?php echo esc_attr( $key ); ?>" role="tabpanel" aria-labelledby="tab-title-<?php echo esc_attr( $key ); ?>">
    				<?php if ( isset( $tab['callback'] ) ) { call_user_func( $tab['callback'], $key, $tab ); } ?>
    			</div>
    		<?php endforeach; ?>
    	</div>
    
    <?php endif; ?>

    Cheers,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Unfortunately you can’t add tabs with HTML. You’ll need to use PHP code because that’s what drives the tabs template. Does Visual Composer not have a tabs template or a tabs partial or something that you can add into your product page?

    The tabs template is a default WooCommerce template: it is available with all WooCommerce installs.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Peter,

    I understand.

    Two things:

    1. Make sure you’re not overwriting our add-on by setting the yikes_woo_products_tabs value directly in the Custom Fields portion of WP All Import: https://imgur.com/a/RDIIGGI

    2. Set the WP All Import settings so that the yikes_woo_products_tabs field is the only one updated, like this: https://imgur.com/a/9D6Q484

    Let me know if that helps.

    Thank you,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    I see. Are you creating your own templates? Where are you getting your custom templates from? Does your theme offer a tab template? Are you looking for the actual PHP code that creates tabs?

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @stoni81,

    I’m sorry, I’m not quite sure what you mean. Are you trying to not update the tabs? Are you trying to update _only_ the tabs? Are you using our WP All Import Custom Product Tabs Add-on (https://www.ads-software.com/plugins/custom-product-tabs-wp-all-import-add-on/)?

    Let me know.

    Thank you,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    @myglass,

    I don’t know what you mean. Can you send me a URL to your product page so I can check out what’s missing?

    Are you missing the tab template? Do you have any tabs showing on your page?

    Thank you,
    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Leave the code there – that’s the best solution. Quite a few of our users (who also use page builder plugins) use this snippet.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Bonjour @fmarotte,

    I’ve found the issue. You have some custom CSS that is hiding all of the tab content. I am not sure where this CSS is coming from but if you remove it, you will see the tab content correctly:

    This is the selector I am referring to:

    #woocommerce-coupon-data ul.wc-tabs::after, #woocommerce-product-data ul.wc-tabs::after, .woocommerce ul.wc-tabs::after {
        content: '';
        display: block;
        width: 100%;
        height: 9999em;
        position: absolute;
        bottom: -9999em;
        left: 0;
        background-color: #fafafa;
        border-right: 1px solid #eee;
    }

    Do you know where/when/why this would be added? Do you know how to find it?

    Let me know.

    Thank you,
    Kevin.

Viewing 15 replies - 1 through 15 (of 2,840 total)