Title: Elementor Pro Code Snippet
Last modified: September 7, 2021

---

# Elementor Pro Code Snippet

 *  Resolved [lbwdev](https://wordpress.org/support/users/lbwdev/)
 * (@lbwdev)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/elementor-pro-code-snippet/)
 * I have a code snippet which shows the RRP above our product prices on our woocommerce
   store. This worked fine until we changed to Elementor Pro and now the snippet
   doesn’t show. Can you advise how i can get a snippet to show in the page builder?
   Is there a way to turn that code into a short code perhaps?
 * this is the original code i used [https://www.businessbloomer.com/woocommerce-display-rrp-msrp-manufacturer-price/](https://www.businessbloomer.com/woocommerce-display-rrp-msrp-manufacturer-price/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Felementor-pro-code-snippet%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/elementor-pro-code-snippet/#post-14853120)
 * You can convert the function that actually does the output into a shortcode like
   this:
 *     ```
       add_shortcode( 'single_product_summary', function () {
       	global $product;
       	$output = '';
   
       	if ( $product && $product->get_type() <> 'variable' && $rrp = get_post_meta( $product->get_id(), 'rrp', true ) ) {
       		$output .= '<div class="woocommerce_rrp">';
       		$output .= __( 'RRP: ', 'woocommerce' );
       		$output .= '<span>' . wc_price( $rrp ) . '</span>';
       		$output .= '</div>';
       	}
   
       	return $output;
       } );
       ```
   
 * I’d imagine that the functions that handle displaying the product options field
   and saving its data can remain the same.
 *  Thread Starter [lbwdev](https://wordpress.org/support/users/lbwdev/)
 * (@lbwdev)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/elementor-pro-code-snippet/#post-14853185)
 * Thank you. When i want to then use the short code what do i put as the shortcode
   on the page? eg [shortcode] i’m not sure what text goes there
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/elementor-pro-code-snippet/#post-14854738)
 * You would use the `[single_product_summary]` shortcode in an elementor widget
   to have it show up.
 *  Thread Starter [lbwdev](https://wordpress.org/support/users/lbwdev/)
 * (@lbwdev)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/elementor-pro-code-snippet/#post-14856881)
 * I can’t seem to get it to work – can you confirm the code is correct is this 
   line supposed to be blank in the commas? $output = ”;
 * When i add this to the snippet nothing shows up when i put the shortcode [single_product_summary]
 * I replaced the output section on the original snippet with the code supplied 
   above. can you let me know if that was the correct thing to do?
 * I replaced this section:
 * // 3. Display RRP field @ single product page
 * add_action( ‘woocommerce_single_product_summary’, ‘bbloomer_display_RRP’, 9 );
 * function bbloomer_display_RRP() {
    global $product; if ( $product->get_type()
   <> ‘variable’ && $rrp = get_post_meta( $product->get_id(), ‘rrp’, true ) ) { 
   echo ‘<div class=”woocommerce_rrp”>’; _e( ‘RRP: ‘, ‘woocommerce’ ); echo ‘<span
   >’ . wc_price( $rrp ) . ‘</span>’; echo ‘</div>’; } }`
 * With this code:
    add_shortcode( ‘single_product_summary’, function () { global
   $product; $output = ”;
 *  if ( $product && $product->get_type() <> ‘variable’ && $rrp = get_post_meta(
   $product->get_id(), ‘rrp’, true ) ) {
    $output .= ‘<div class=”woocommerce_rrp”
   >’; $output .= __( ‘RRP: ‘, ‘woocommerce’ ); $output .= ‘<span>’ . wc_price( 
   $rrp ) . ‘</span>’; $output .= ‘</div>’; }
 *  return $output;
    } );`

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Elementor Pro Code Snippet’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [lbwdev](https://wordpress.org/support/users/lbwdev/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/elementor-pro-code-snippet/#post-14856881)
 * Status: resolved