How to remove zero price? - by Petuhoff - on WordPress WooCommerce support

This topic has 9 replies, 2 voices, and was last updated 9 years, 4 months ago ago by Jack Richardson

  • Avatar: Petuhoff
    Petuhoff
    Participant
    June 29, 2015 at 10:05

    Good day!
    Everything works fine!
    I just wanted to get some advice.
    I wanna hide zero prices in the wpsc theme files: single product, grid view and sliders.
    Some coders adviced me this <?php if (wpsc_the_product_price() == “0.00”) : ?>
    Unfortunately, it doesnt work.
    What can you advice me?
    I understand, that it’s more e-commerce plugin question than yours, but they’re gone… And do not chat. I’ll be glad if you’ll advice me some solution. Thanks!
    Your theme is great!

    8 Answers
    Avatar: Petuhoff
    Petuhoff
    Participant
    June 29, 2015 at 12:09

    UPD. I resolved the issue with removing zero prices, using donation code. Just inserted a needed code into donation block. Now, when activate- it shows Price Request.
    Now there is the only question with the sliders: help me to hide zero prices in the bestseller and also bought sliders 🙂

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 29, 2015 at 13:03

    Hello,

    You can refer to this article http://emc2innovation.com/removing-zero-prices-from-wp-ecommerce/ for the solution. Please try the code mentioned there.

    Best regards,
    Jack Richardson.

    Avatar: Petuhoff
    Petuhoff
    Participant
    June 29, 2015 at 14:19

    As I wrote before, I solved the issue with single product and grid view, this article is about this.
    The only problem to solve is to remove zero prices from the sliders. Exactly from products.php from “code” folder. That’s the question! 🙂 And as it’s your code, I’m waiting for advice 🙂

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 29, 2015 at 20:57

    Hello,

    I’ve replaced the code in wp-content/themes/blanco/wpsc-products_page.php in line 176:
    <p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="<?php if(wpsc_product_on_special()) echo 'currentprice'; ?> pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
    with
    <?php if (wpsc_the_product_price() !== "0.00 Руб") : ?><p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="<?php if(wpsc_product_on_special()) echo 'currentprice'; ?> pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p><?php endif; ?>

    Also the code has been replaced in the file wp-content/themes/blanco/code/products.php in lines 431 and 435:
    echo '<p class="pricedisplay"><span class="currentprice pricedisplay">'.$post_price.'</span></p>';
    with
    if (wpsc_the_product_price() !== '0.00 Руб'): echo '<p class="pricedisplay"><span class="currentprice pricedisplay">'.$post_price.'</span></p>';endif;
    and
    echo '<span>'.$post_price.'</span>';
    with
    if (wpsc_the_product_price() !== '0.00 Руб'): echo '<span>'.$post_price.'</span>';endif;

    Please check your site now.

    Best regards,
    Jack Richardson.

    Avatar: Petuhoff
    Petuhoff
    Participant
    June 30, 2015 at 09:53

    Good day! I’ve checked it and it works fine. Thank you so much!
    There is one another carousel “Related products”, which is still with zeroes. It’s in the wpsc-single_product.php. Hope, it’s the last.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 30, 2015 at 21:49

    Hello,

    The following code has been replaced in the wp-content/themes/blanco/wpsc-single_product.php file in line 433:
    <span><?php echo $product['price'] ?></span>
    with
    <?php if ($product['price'] !== "<span class='pricedisplay'>0.00 Руб</span>"): ?> <span><?php echo $product['price'] ?></span> <?php endif; ?>

    Please check Related products carousel in single product pages.

    Best regards,
    Jack Richardson.

    Avatar: Petuhoff
    Petuhoff
    Participant
    June 30, 2015 at 22:40

    Hi! I’ve checked it. Everything works fine! I’ll recommend you to all!

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 30, 2015 at 23:03

    Hello,

    You are welcome! We are always glad to help you.

    Best regards,
    Jack Richardson.

  • Viewing 9 results - 1 through 9 (of 9 total)

The issue related to '‘How to remove zero price?’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.