You may need to show the book now button instead of add to cart button for the out of stock product. In this article, I will show the steps to achieve it for the bootstrap template.
Step 1. Import a language definition for book now button.
— Go to admin panel > Definitions > Languages > Edit.
— Import following language definition into general group:
button_book_now: Book now
Step 2. Replace the button in the new products module.
— Go to templates > bootstrap > modules > content > new_products.php
— Find following code snippet:
<?php echo $osC_Language->get('button_buy_now'); ?>
— Replace it with following code snippet:
<?php if ($osC_Product->getQuantity() > 0): ?> <?php echo $osC_Language->get('button_buy_now'); ?> <?php else: ?> <?php echo $osC_Language->get('button_book_now'); ?> <?php endif;?>
Step 2. Replace the button in the product listing.
— Go to templates > bootstrap > modules > product_listing.php.
— Find following code snippet:
<?php echo $osC_Language->get('button_buy_now'); ?>
— Replace it with following code snippet:
<?php if ($osC_Product->getQuantity() > 0): ?> <?php echo $osC_Language->get('button_buy_now'); ?> <?php else: ?> <?php echo $osC_Language->get('button_book_now'); ?> <?php endif;?>
Step 3. Replace the button in the product info page.
— Go to templates > bootstrap > content > products > info.php.
— Find following code snippet:
<?php echo $osC_Language->get('button_add_to_cart'); ?>
— Replace it with following code:
<?php if ($osC_Product->getQuantity() > 0): ?> <?php echo $osC_Language->get('button_add_to_cart'); ?> <?php else: ?> <?php echo $osC_Language->get('button_book_now'); ?> <?php endif;?>
Step 4. Replace the button in the feature products module.
— Go to templates > bootstrap > modules > content > feature_products.php
— Find following code snippet:
<?php echo $osC_Language->get('button_buy_now'); ?>
— Replace it with following code:
<?php if ($osC_Product->getQuantity() > 0): ?> <?php echo $osC_Language->get('button_buy_now'); ?> <?php else: ?> <?php echo $osC_Language->get('button_book_now'); ?> <?php endif;?>
Done. Now, all of buy now or add to cart buttons are replaced with book now button in your bootstrap template.
If you can’t complete above steps by yourself, please contact support@tomtaocart.com to get technical support. We provide free technical support service for arvixe users.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!