-
AuthorPosts
-
March 14, 2018 at 7:50 pm #926793
Hallo liebe Kriese Team,
in der Product list soll die “quick view” Funktion sein. Das heißt wenn jemand in der Produkt Liste ein Variables Produkt anklickt, muss sich ein Popup öffnen. Ist es kein Variables Produkt dann soll das Produkt in den Warenkorb gelegt werden. Wie kann ich das beim Enfold Template umsetzen?
Plugin: YITH Quick View
Danke MFG
Hello dear Kriese team,
in the product list should be the “quick view” function. This means that if someone clicks on a product in the product list, a pop-up must open. If it is not a variable product then the product should be added to the cart. How can I implement this with the Enfold template?
Plugin: YITH Quick View
Thanks best regards
March 16, 2018 at 5:29 am #927904Hey Mario,
Thank you for using Enfold.
Do you have the pro version of the plugin? We can use the pro version’s shortcode. Just add this code in the functions.php file.
add_action('after_setup_theme', 'after_setup_theme_product_button_yith'); function after_setup_theme_product_button_yith() { add_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button_mod_yith', 16); remove_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button', 16); } function avia_add_cart_button_mod_yith() { global $product, $avia_config; if ($product->get_type() == 'bundle' ){ $product = new WC_Product_Bundle($product->get_id()); } $extraClass = ""; ob_start(); woocommerce_template_loop_add_to_cart(); $output = ob_get_clean(); if(!empty($output)) { $pos = strpos($output, ">"); if ($pos !== false) { $output = substr_replace($output,"><span ".av_icon_string('cart')."></span> ", $pos , strlen(1)); } } if($product->get_type() == 'variable' && empty($output)) { $output = '<a class="add_to_cart_button button product_type_variable" href="'.get_permalink($product->get_id()).'"><span '.av_icon_string("details").'></span> '.__("Select options","avia_framework").'</a>'; $output .= do_shortcode('[yith_quick_view product_id='.$product->get_id().' type="button" label="Quick View"]'); $output .= 'test'; } if(in_array($product->get_type(), array('subscription', 'simple', 'bundle'))) { $output .= '<a class="button show_details_button" href="'.get_permalink($product->get_id()).'"><span '.av_icon_string("details").'></span> '.__("Show Details","avia_framework").'</a>'; } else { $extraClass = "single_button"; } if(empty($extraClass)) $output .= " <span class='button-mini-delimiter'></span>"; if($output && !post_password_required() && '' == avia_get_option('product_layout','')) { echo "<div class='avia_cart_buttons $extraClass'>$output</div>"; } }
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.