Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #1031223

    Hi,

    A customer webshop has the WooCommerce product add ons extension enabled. When ordering such a product it displays the text: 1x undefined €75.00, just before the add to cart button.

    I’ve tested this in Twentyseventeen and there it shows the product title instead of undefined.

    Can this be fixed please?

    Cheers,
    Jaap

    #1032285

    Hey Jaap,

    Can you disable caching and minification for now?

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1032290
    This reply has been marked as private.
    #1032570

    I too have this issue.
    Enfold 4.5
    WooCommerce 3.5.1

    Is there a fix?

    #1033153

    Hi Jaap,

    Well, looks like the scrip cannot determine the value of the option selected and looks like the caching is still enabled.

    Best regards,
    Victoria

    #1033194

    Hi, I’ve disabled caching again. Don’t know what you mean by ‘the script’. An Enfold script?

    #1033588

    Hi Jaap,

    No, not the Enfold script, the plugin script.

    Best regards,
    Victoria

    #1033596

    Hi Victoria,

    The plugin/script is working fine in default Twentyseventeen theme. Just not in Enfold.
    Are you guys still looking into this?

    Cheers,
    Jaap

    #1034941

    Hi,

    Have you tried contact the plugin developers?
    I am sure as Enfold is one of the top themes, thy would be really helpful to help us debug and have it published :)

    Best regards,
    Basilis

    #1035086

    Hi,

    Yes, before I opened this thread I contacted them. Will do that again.

    Cheers,
    Jaap

    #1035322

    Hi Basilis,

    I’ve tested some more and I was able to replicate the issue on a fresh install. The ‘Undefined’ issue will occur when creating a product with the advanced layout builder.

    Hope you guys can solve this issue.

    Cheers,
    Jaap

    #1035819

    Same issue here. Fresh install, fresh plugins, but adding to cart is “undefined”

    #1035863

    Hi,

    Thank u for letting us know – we will check how to review further with that.

    Best regards,
    Basilis

    #1039940

    I have same problem, what is status on this? :)

    #1042884

    Hi,

    Ask the plugin author where the script gets the title. It’s probably from a heading element with a certain class attribute. Like this one:

    
    <h1 class="product_title entry-title">An Awesome Product</h1>
    

    Try to use that code as the product title.

    Best regards,
    Ismael

    #1059890

    We faced the same issue here.

    The problem is about compatibility between Enfold with Woocommerce Bookings and Woocommerce Add-ons.

    The fix is exactly as Ismael said. Use the class ‘product_title’ on the heading. To do that, edit the following function on functions-enfold.php to add the ‘product_title’ class to the ‘heading_html’ variable on the ‘defaults array’. All the rest of the function can remain the same:

    //advanced title + breadcrumb function
    ### HOOKED ON HEADING: added product_title class
    if(!function_exists('avia_title'))
    {
    	function avia_title($args = false, $id = false)
    	{
    		global $avia_config;
    
    		if(!$id) $id = avia_get_the_id();
    		
    		$header_settings = avia_header_setting();
    		if($header_settings['header_title_bar'] == 'hidden_title_bar') return "";
    		
    		$defaults 	 = array(
    
    			'title' 		=> get_the_title($id),
    			'subtitle' 		=> "", //avia_post_meta($id, 'subtitle'),
    			'link'			=> get_permalink($id),
    			'html'			=> "<div class='{class} title_container'><div class='container'>{heading_html}{additions}</div></div>",
    			'heading_html'	=> "<{heading} class='main-title entry-title product_title'>{title}</{heading}>",
    			'class'			=> 'stretch_full container_wrap alternate_color '.avia_is_dark_bg('alternate_color', true),
    			'breadcrumb'	=> true,
    			'additions'		=> "",
    			'heading'		=> 'h1' //headings are set based on this article: http://yoast.com/blog-headings-structure/
    		);
    
    		if ( is_tax() || is_category() || is_tag() )
    		{
    			global $wp_query;
    
    			$term = $wp_query->get_queried_object();
    			$defaults['link'] = get_term_link( $term );
    		}
    		else if(is_archive())
    		{
    			$defaults['link'] = "";
    		}
    		
    		
    		// Parse incomming $args into an array and merge it with $defaults
    		$args = wp_parse_args( $args, $defaults );
    		$args = apply_filters('avf_title_args', $args, $id);
    
    		//disable breadcrumb if requested
    		if($header_settings['header_title_bar'] == 'title_bar') $args['breadcrumb'] = false;
    		
    		//disable title if requested
    		if($header_settings['header_title_bar'] == 'breadcrumbs_only') $args['title'] = '';
    
    		// OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
    		extract( $args, EXTR_SKIP );
    
    		if(empty($title)) $class .= " empty_title ";
            $markup = avia_markup_helper(array('context' => 'avia_title','echo'=>false));
    		if(!empty($link) && !empty($title)) $title = "<a href='".$link."' rel='bookmark'>".$title."</a>";
    		if(!empty($subtitle)) $additions .= "<div class='title_meta meta-color'>".wpautop($subtitle)."</div>";
    		if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));
    
    		if(!$title) $heading_html = "";
    		$html = str_replace('{heading_html}', $heading_html, $html);
    		
    		
    		$html = str_replace('{class}', $class, $html);
    		$html = str_replace('{title}', $title, $html);
    		$html = str_replace('{additions}', $additions, $html);
    		$html = str_replace('{heading}', $heading, $html);
    
    		if(!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview())
    		{
    			$avia_config['small_title'] = $title;
    		}
    		else
    		{
    			return $html;
    		}
    	}
    }
    • This reply was modified 5 years, 9 months ago by rmf339.
    #1060486

    Hi, i’ve editted the functions-enfold.php according the solution but it’s still not working. Still see “undefined”.
    Cleared cache but still not working.

    #1060950

    Hi,

    @Jaap de Wit: Did you modify this line?

    'heading_html'	=> "<{heading} class='main-title entry-title product_title'>{title}</{heading}>",
    

    The “product_title” class attribute has to be added there.


    @rmf339
    : Thank you for the confirmation and for sharing your solution.

    Best regards,
    Ismael

    #1060959

    Hi Ismael,

    I did this: https://pasteboard.co/HYZ2YZp.png

    Cheers,
    Jaap

    #1061851

    Hello

    We are having he same issue here seeing “undefined” on the product page after adding the “Product Add-Ons” to WooCommerce with the advanced layout builder in Enfold 4.5.3 in WordPress 5.0.3.

    We have tried editing functions-enfold.php using @rmf339‘s solution from January 29, 2019 at 6:06 am without success, including the line that @Ismael pointed out on January 31, 2019 at 1:07 pm that @JaapdeWit clarified as being the same on January 31, 2019 at 1:22 pm.

    Anything further to be done?

    Thanks!

    #1062483

    Hi,

    @Jaap de Wit: I can’t reproduce the issue on the product page anymore. Please try to remove the browser cache and then check the page again. Or create a test page if you’re still experiencing the issue.


    @blueunderground
    : Thanks for the info. Please create a new thread with the site url. A test page will help.

    Best regards,
    Ismael

    #1062550

    Hi Ismael,

    Clearing cache didn’t solve the issue. I’ve also create a new product, also the same issue: https://childbirthclassgale.com/product/test/

    Keep in mind the problem only exists when creating products with the advanced layout builder!

    Cheers,
    Jaap

    #1063427

    Hi,

    Thanks for the update.

    You need to add the title manually and make sure that it has the “product_title” class attribute. Insert a code or text block and then add this code:

    
    <h1 class="product_title title">Simple Product</h1>
    

    Best regards,
    Ismael

Viewing 23 posts - 1 through 23 (of 23 total)
  • You must be logged in to reply to this topic.