Hi,
This is my first foray into PHP language and I need a little help here.
1. Please reference to this site -> https://www.clothingrepublic.com/ind...ure-club.html#
Basically if a product quantity is 1, it will display the following message:
Only 1 left
NATURE CLUB-Pink-XS
S$12.00
2. What I wanted to achieve is, when the quantity reaches "0". It will display another message like "Out Of Stock".
I believe these are the codes that trigger the events
Please do take note that I am absolutely new to this, any help rendered is greatly appreciated.PHP Code:<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/**
* @see Mage_CatalogInventory_Block_Stockqty_Composite
*/
?>
<table align="right" id="" class="stock-qty-details">
<thead>
<tr>
<?php if ($this->isMsgVisible()): ?>
<a href="#" id="<?php echo $this->getPlaceholderId() ?>" class="stock-qty">
<?php echo $this->__('Only %s left', $this->getStockQty()) ?>
</a>
</tr>
</thead>
<tbody>
<?php foreach ($this->getChildProducts() as $childProduct) : ?>
<?php $childProductStockQty = $this->getProductStockQty($childProduct); ?>
<?php if ($childProductStockQty > 0) : ?>
<tr>
<td><?php echo $childProduct->getName() ?></td>
</tr>
<?php endif ?>
<?php endforeach ?>
</tbody>
</table>
<!--script type="text/javascript">
//<![CDATA[
$('<?php //echo $this->getPlaceholderId() ?>').observe('click', function(event){
$('<?php //echo $this->getDetailsPlaceholderId() ?>').toggleClassName('no-display');
event.stop();
});
//]]>
</script-->
<?php endif; ?>
Best Regards,
Chris.



Reply With Quote

The website is running on Magento platform, could it be any of the reasons on not working?


Bookmarks