X hide

Magento Private Sales v3.x Developers Guide and API Reference

From Plumrocket Documentation

In order to display countdown timer for any product, follow the instructions below.

Display countdown timer for a product

Changes to be made Website Frontend - Product Grid

In order to display product countdown timer for products, say in the product list page - paste the following code into the file template:

app/design/frontend/THEME/default/template/catalog/product/list.phtml
Code Example

This is an example of the code to be used:

 <?php if (!( ($_cc = Mage::registry('current_category')) && $_cc->getData('privatesale_date_start'))) { ?>
 <?php echo $this->getLayout()->createBlock('privatesales/event_product')->setTemplate('privatesales/event/item.phtml')->setProduct($_product)->toHtml() ?>
 <?php } ?>

Where "$_product" is a product object the countdown timer you need to set up for.

Find the code:

 <ul class="products-list<?php if($listClasses) echo $listClasses; ?>" id="products-list">
 <?php foreach ($_productCollection as $_product): ?>
 <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
 <?php //Product Image ?>
 !!-<div class="product-image-wrapper grid12-4 mobile-grid-half">-!!
 <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image" style="max-width:<?php echo $imgWidth; ?>px;">
 <img id="product-collection-image-<?php echo $_product->getId(); ?>"
 src="<?php echo $helpImg->getImg($_product, $imgWidth, $imgHeight, 'small_image'); ?>"
 alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />


The code should be replaced with the following:

 <ul class="products-list<?php if($listClasses) echo $listClasses; ?>" id="products-list">
 <?php foreach ($_productCollection as $_product): ?>
 <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
 <?php //Product Image ?>
 !!-<div class="product-image-wrapper grid12-4 mobile-grid-half">
 <?php if (!( ($_cc = Mage::registry('current_category')) && $_cc->getData('privatesale_date_start'))) { ?>
 <?php echo $this->getLayout()->createBlock('privatesales/event_product')->setTemplate('privatesales/event/item.phtml')->setProduct($_product)->toHtml() ?>
 <?php } ?>-!!
 <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image" style="max-width:<?php echo $imgWidth; ?>px;">
 <img id="product-collection-image-<?php echo $_product->getId(); ?>"
 src="<?php echo $helpImg->getImg($_product, $imgWidth, $imgHeight, 'small_image'); ?>"
 alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  1. Product countdown timer.

Magento private sales and flash sales developers guide.jpg

Navigation