Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Pre-Order button if Condition Met for Magento 1.7+
 
edimensions
Jr. Member
 
Total Posts:  1
Joined:  2011-10-27
 

Hello, I am new here and after searching for a while could not figure out how to do the following.  It seems simple enough I just need the “Add to cart” button to change and say “Pre-Order” when an attribute condition is met.  I have setup the attribute “preorder” and set it to yes or no now I just have to write an if statement and the way I was trying was in the ‘addtocart.phtml’

The code is: 

<?php $buttonTitle $this->__('Add to Cart'); ?>

Now as far as I could tell I just have to add something like:

<?php if($_product->getAttribute('preorder') == 'yes'): ?>
<?php $buttonTitle 
$this->__('Pre-Order'); ?>
<?php 
endif; ?>

//this should end the if if preorder is set to no than the button titled Pre-Order should be skipped and continue with the following.

?php $buttonTitle $this->__('Add to Cart'); ?>

I’ve tried many variations and it just seemed to get rid of the add to cart button completely.  If I just change the text in the ‘Add to Cart’ to ‘Pre-Order’ it would change it globally but I just need it to change if preorder is found to be true.  Any help would be appreciated.  Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Customy
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2011-05-11
Czech Republic
 

Please review our solution for Pre-Order button display where products are out of stock and backorders are enabled.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

Hi there, if you need to replace the Add to Cart button with the Pre order button and clearly notify customers that particular products are available for pre order please take a look at this module: http://amasty.com/magento-pre-order.html.

The extension enables you:

- easily customize Pre Order button and place it on product and category pages;
- specify any additional notes that will be placed on a product and shopping cart pages (eg. “Available in 14 days")
- create warning messages to remind customers that the product is pre ordered
- easily manage pre orders on order grid;

Take a look at the screenshots below to get a better idea of the module’s functionality:

Image Attachments
pre-order-category-page.pngpre-order-configurable-product.pngpre-order-shopping-cart.pngpre-order-account-page.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Rob Staff
Jr. Member
 
Avatar
Total Posts:  14
Joined:  2009-08-19
 

Here is how to DIY if you have time....http://www.pixelpaul.net/create-pre-order-products-in-magento/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top