WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am kind of new to woocommerce but finding this plugin amazing so far.. I am trying to figure out how to add a variable right after the price which will give the buyer additional information about how many credits he purchased (using stars)

There is an option of adding attributes and showing them as variables but it all shows underneath in the "Additional information" tab and I want that to appear right after the price

the following screenshot better describe what I am looking for: enter image description here

*This "stars" additional information must be added to the checkout page as well as sent to the customer as additional important information

Thanks in advance

share|improve this question

use woocommerce_single_product_summary action hook with priority 15

function ravs_credits(){

above code print testing below price on product page.

Important Link:

woocommerce_single_product_summary hook

WordPress hooks introduction


I am assuming that your credit range form 1 to 100 and you specify them.now

  1. create custom meta box in product post type.read How To Create Custom Post Meta Boxes
  2. read this technique to create product rating in css

now you get meta box in each product,give it a value between 1 to 100 now code look like

//credits with rating
    function ravs_credits(){
     global $post;
     <div class="ravs-credits">
       <p>This package will grant you <?php echo get_post_meta($post->ID, $key, $single); ?> Stars</p>
       <span style="width:<?php echo get_post_meta($post->ID, $key, $single); ?>%" class="rating"></span>

Important Link:

  1. get_post_meta()
share|improve this answer
Basically it works pretty well thanks. How do I display the attribute instead of echoing a simple text? (testing) – gil hamer Jun 5 '13 at 14:59
for that you have to dig in that plugin code and check how it output result in additional information tab.Modify my fuction to achieve desire result. – Ravinder Kumar Jun 5 '13 at 15:06
which plugin are you using for that info (showing in image)? – Ravinder Kumar Jun 5 '13 at 15:28
I sm only using Woocommerce plugin. – gil hamer Jun 5 '13 at 20:41
I want to ask one thing in what range your credit lies means( 1 to 100 or upper) – Ravinder Kumar Jun 5 '13 at 20:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.