Before you ask please READ THIS

Problem adding ribbon

edited October 2014 in Fame Posts: 9

I'm having trouble adding a new type of ribbon in my child theme. On my advance/utilities/woocommerce.php I've added this:

if(!function_exists('a13_is_product_colored')){
function a13_is_product_colored() {
global $product;
return is_object_in_term( $product->id, 'product_tag', 'colores' );
}
}

Right below the "a13_is_product_new" function So far, the child theme works, but when I try to change this:

if(!$product->is_in_stock()){
echo '<span class="ribbon out-of-stock"><em>'.__( 'Out of stock', 'woocommerce' ).'</em></span>';
}
else{
//sale
if($product->is_on_sale()){
echo '<span class="ribbon sale"><em>'.__( 'Sale!', 'woocommerce' ).'</em></span>';
}
//new
if(a13_is_product_new()){
echo '<span class="ribbon new"><em>'.__fe('New!').'</em></span>';
}
if(a13_is_product_colored()){
echo '<span class="ribbon colores"><em>'.__fe('Más Colores!').'</em></span>';
}
}

On the woocommerce/content-product.php file, the theme stops loading any page.

You can check it on my site: www.pimuh.com

Thanks in advance

Post edited by Air on

Comments

  • AirAir
    Posts: 10,970
    Hi there.

    Please activated debug mode to see what PHP error occured.
    http://codex.wordpress.org/Debugging_in_WordPress#WP_DEBUG

    Then we can talk :-)

    PS. Nice going :-)

    With regards.
  • OK, activated DEBUG and DEBUG_DISPLAY, it says function is undefined
  • AirAir
    edited October 2014 Posts: 10,970
    Then it doesn't :-) Add your custom function in functions.php in child theme.

    With regards.
    Post edited by Air on
  • Great! it worked! Many thanks!

    On the other side, when i try to change the advance/utilities/woocommcerce file, in this line

     

    <p class="buttons empty"><a class="a13-button" href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>"><?php _fe( 'Go to the shop' ) ?></a></p>

     

    I can't find a way to translate "go to the shop". I've edited the po fil, I've changed both fame and fame_child files, and it still shows "go to the shop" on my page

     

  • AirAir
    Posts: 10,970
    I have heard that some people have this issue, that it don't gets translated strings for this element. However I have tested it with WPML plugin active and it worked fine for me.

    It was this topic http://support.apollo13.eu/discussion/2496/translation-problem/p1and can continue there talking about this to not mix different cases in one topic.

    But I will test again without WPML to check how it works then.

    PS. If you are happy with this theme please don't forget to rate us on ThemeForest - it helps us a lot! Thanks! How to rate?

    With regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!