Advertisement
Guest User

content-single-product-custom

a guest
Jan 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying product content in the single-product.php template
  4. *
  5. * Override this template by copying it to yourtheme/woocommerce/content-single-product.php
  6. *
  7. * @author WooThemes
  8. * @package WooCommerce/Templates
  9. * @version 3.0.0
  10. */
  11.  
  12. if ( ! defined( 'ABSPATH' ) ) {
  13. exit; // Exit if accessed directly
  14. }
  15.  
  16. ?>
  17. <div class="container">
  18. <?php
  19. /**
  20. * Hook Woocommerce_before_single_product.
  21. *
  22. * @hooked wc_print_notices - 10
  23. */
  24. do_action( 'woocommerce_before_single_product' );
  25. if ( post_password_required() ) {
  26. echo get_the_password_form(); // WPCS: XSS ok.
  27. return;
  28. }
  29. ?>
  30. </div><!-- /.container -->
  31. <div id="product-<?php the_ID(); ?>" <?php post_class(); ?>>
  32. <?php
  33. echo '<div class="custom-product-page">';
  34.  
  35. if ( ! get_theme_mod( 'product_custom_layout' ) ) {
  36. echo '<p class="lead shortcode-error">Create a custom product layout by using the UX Builder. You need to select a Block as custom product layout and then open it in the UX Builder from the product page.</p>';
  37.  
  38. } else {
  39. echo do_shortcode( '[block id="' . get_theme_mod( 'product_custom_layout' ) . '"]' );
  40. }
  41.  
  42. echo '</div>';
  43.  
  44. echo '<style>.custom-product-page .shortcode-error{padding: 15% 10%; text-align:center;} </style>';
  45.  
  46. do_action( 'woocommerce_after_single_product' );
  47.  
  48. ?>
  49. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement