lygiafoster
Member
Posted 2 years ago #
Please, I saw something like this in other sites using wp-ecommerce, but couldn’t figure out how to enable:
When a product run out of stock, I would like to replace the "Add to cart" button for a "tell me when available" button linked to a form where the visitor can fill out his personal data for me to contact him. As I said, I saw that in a couple of sites using WP-ecommerce, but couldn’t do that in my site. Is it a plug-in; the gold version or there is a simple way to do that? :)
WP 2.9.2
WP Shopping Cart Version 3.7.5.3
Thanks in advance,
Lygia
lygiafoster
Member
Posted 2 years ago #
Between lines 217-235 in products_page.php located in WP Shopping Cart default theme there is a code that I think is the key for what I want. Any idea how can I modify this code to achieve what I need?
<!-- END OF QUANTITY OPTION -->
<?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow') !='1')) : ?>
<?php if(wpsc_product_has_stock()) : ?>
<div class='wpsc_buy_button_container'>
<?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
<?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
<input class="wpsc_buy_button" type='button' value='<?php echo TXT_WPSC_BUYNOW; ?>' onclick='gotoexternallink("<?php echo $action; ?>")'>
<?php else: ?>
<input type="submit" value="<?php echo TXT_WPSC_ADDTOCART; ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
<?php endif; ?>
<div class='wpsc_loading_animation'>
<img title="Loading" alt="Loading" src="<?php echo WPSC_URL; ?>/images/indicator.gif" class="loadingimage"/>
<?php echo TXT_WPSC_UPDATING_CART; ?>
</div>
</div>
<?php else : ?>
<p class='soldout'><?php echo TXT_WPSC_PRODUCTSOLDOUT; ?></p>
<?php endif ; ?>
<?php endif ; ?>
lygiafoster
Member
Posted 2 years ago #
kaotikri
Member
Posted 1 year ago #
Ive seen this before too. Too bad no one knowledgeable is on here to help out. This would be a cool feature to add.