Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since this is not possible by default within, magento what you could try is : </p> <p>Create 2 fields in Admin -> Catalog -> Attribute for <code>tierprice_to_date</code> and <code>tierprice_from_date</code> and add it to <code>price</code> group in your Attribute Sets.</p> <p>In /app/design/frontend/base/default/template/catalog/product/view.phtml</p> <pre><code>if(date between tierprice_from_date and tierprice_to_date){ echo $this-&gt;getTierPriceHtml(); } </code></pre> <p>Then create a custom module with observer that check the price when items are added to cart using event <code>'sales_quote_add_item'</code>: </p> <p>Create: app/code/local/MageIgniter/TierPriceDateRange/etc/config.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;MageIgniter_TierPriceDateRange&gt; &lt;version&gt;1.0.1&lt;/version&gt; &lt;/MageIgniter_TierPriceDateRange&gt; &lt;/modules&gt; &lt;global&gt; &lt;models&gt; &lt;tierpricedaterange&gt; &lt;class&gt;MageIgniter_TierPriceDateRange_Model&lt;/class&gt; &lt;/tierpricedaterange&gt; &lt;/models&gt; &lt;events&gt; &lt;sales_quote_add_item&gt; &lt;observers&gt; &lt;tierpricedaterange_observer&gt; &lt;type&gt;singleton&lt;/type&gt; &lt;class&gt;tierpricedaterange/observer&lt;/class&gt; &lt;method&gt;updatePrice&lt;/method&gt; &lt;/tierpricedaterange_observer&gt; &lt;/observers&gt; &lt;/sales_quote_add_item&gt; &lt;/events&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <p>Create: app/code/local/MageIgniter/TierPriceDateRange/Model/Observer.php</p> <pre><code>class MageIgniter_TierPriceDateRange_Model_Observer { public function updatePrice($observer) { if(date NOT between tierprice_from_date and tierprice_to_date){ $cartItem = $observer-&gt;getEvent()-&gt;getQuoteItem(); // check if a tier price was apply and change it back to the original price (none tier price) $product = Mage::getModule('catalog/product')-&gt;load($product-&gt;getId()); if($cartItem-&gt;getPrice() == $product-&gt;getTierPrice($cartItem-&gt;getQty())){ $new_price = $product-&gt;getPrice(); $product-&gt;setOriginalCustomPrice($new_price); $product-&gt;save(); } } return $this; } </code></pre> <p>Create: app/etc/modules/MageIgniter_TierPriceDateRange.xml </p> <pre><code> &lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;MageIgniter_TierPriceDateRange&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/MageIgniter_TierPriceDateRange&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <p>Then clear cache, if any. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload