Tagged: undefined, woocommerce
-
AuthorPosts
-
November 8, 2018 at 1:07 pm #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,
JaapNovember 11, 2018 at 7:58 pm #1032285Hey 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,
VictoriaNovember 11, 2018 at 8:06 pm #1032290This reply has been marked as private.November 12, 2018 at 12:53 pm #1032570I too have this issue.
Enfold 4.5
WooCommerce 3.5.1Is there a fix?
November 13, 2018 at 8:40 pm #1033153Hi Jaap,
Well, looks like the scrip cannot determine the value of the option selected and looks like the caching is still enabled.
Best regards,
VictoriaNovember 13, 2018 at 10:22 pm #1033194Hi, I’ve disabled caching again. Don’t know what you mean by ‘the script’. An Enfold script?
November 14, 2018 at 5:48 pm #1033588Hi Jaap,
No, not the Enfold script, the plugin script.
Best regards,
VictoriaNovember 14, 2018 at 5:59 pm #1033596Hi Victoria,
The plugin/script is working fine in default Twentyseventeen theme. Just not in Enfold.
Are you guys still looking into this?Cheers,
JaapNovember 19, 2018 at 12:26 am #1034941Hi,
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,
BasilisNovember 19, 2018 at 9:35 am #1035086Hi,
Yes, before I opened this thread I contacted them. Will do that again.
Cheers,
JaapNovember 19, 2018 at 8:36 pm #1035322Hi 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,
JaapNovember 20, 2018 at 11:19 pm #1035819Same issue here. Fresh install, fresh plugins, but adding to cart is “undefined”
November 21, 2018 at 12:11 am #1035863Hi,
Thank u for letting us know – we will check how to review further with that.
Best regards,
BasilisDecember 2, 2018 at 2:15 pm #1039940I have same problem, what is status on this? :)
December 10, 2018 at 4:56 am #1042884Hi,
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,
IsmaelJanuary 29, 2019 at 6:06 am #1059890We 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, 10 months ago by rmf339.
January 30, 2019 at 2:08 pm #1060486Hi, 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.January 31, 2019 at 1:07 pm #1060950Hi,
@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,
IsmaelJanuary 31, 2019 at 1:22 pm #1060959February 2, 2019 at 5:25 am #1061851Hello
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!
February 4, 2019 at 5:06 am #1062483Hi,
@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,
IsmaelFebruary 4, 2019 at 9:58 am #1062550Hi 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,
JaapFebruary 6, 2019 at 2:32 am #1063427 -
AuthorPosts
- You must be logged in to reply to this topic.