redgroup
Member
Posted 1 year ago #
Hello everyone,
I posted this on the WPEC forum but didn't get an answer, so just posted it again and thought I would also try here. My client is insisting this needs to be done.
I need to display the stock count on the frontend so it displays to the customers. Can this be done? If not, please let me know so I can pass the word on. If it can, how do implement it into the pages?
The stock count does exist in the backend so there is obviously a variable, but I can't seem to get it to work.
Thanks,
Lee
mukesh panchal
Member
Posted 1 year ago #
for this solution change this code in wpsc-single-product.php
<?php if(wpsc_show_stock_availability()): ?>
<?php if(wpsc_product_has_stock()) : ?>
<div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="in_stock"><?php _e('Product in stock', 'wpsc'); ?></div>
<?php else: ?>
<div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="out_of_stock"><?php _e('Product not in stock', 'wpsc'); ?></div>
<?php endif; ?>
<?php endif; ?>
To this code:
<?php if(wpsc_show_stock_availability()): ?>
<?php if(wpsc_product_has_stock()) : ?>
<div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="in_stock"><?php _e('Product in stock', 'wpsc'); ?><?php echo wpsc_product_remaining_stock(); ?></div>
<?php else: ?>
<div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="out_of_stock"><?php _e('Product not in stock', 'wpsc'); ?></div>
<?php endif; ?>
<?php endif; ?>
then chack it ...
farhanfaisal
Member
Posted 6 months ago #
Thanks mukesh.. Helped me here..