Last active
July 18, 2018 12:03
-
-
Save patrickposner/e378447df33e7be39c10a6a6ec52be81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function dhvc_woo_product_page_price_shortcode( $atts, $content = null ) { | |
| global $post, $product; | |
| extract( $this->_shortcode_atts( array( | |
| 'el_class' => '' | |
| ), $atts ) ); | |
| ob_start(); | |
| if ( ! empty ( $el_class ) ) { | |
| echo '<div class="' . $el_class . '">'; | |
| } | |
| if ( dhvc_woo_product_page_is_jupiter_theme() ) { | |
| ?> | |
| <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> | |
| <div itemprop="price" class="mk-single-price"><?php echo $product->get_price_html(); ?></div> | |
| <meta itemprop="priceCurrency" content="<?php echo get_woocommerce_currency(); ?>"/> | |
| <link itemprop="availability" | |
| href="http://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>"/> | |
| </div> | |
| <?php | |
| } else { | |
| if ( $product->is_type( 'variable' ) ) { | |
| woocommerce_template_single_price(); | |
| } else { | |
| remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); | |
| remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
| do_action( 'woocommerce_single_product_summary' ); | |
| } | |
| } | |
| if ( ! empty ( $el_class ) ) { | |
| echo '</div>'; | |
| } | |
| return ob_get_clean(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment