चूंकि यह भीतर डिफ़ॉल्ट रूप से संभव नहीं है, Magento आप क्या कोशिश कर सकते है:
व्यवस्थापक में 2 क्षेत्रों बनाएं -> सूची ->tierprice_to_date
और tierprice_from_date
की विशेषता और के लिए इसे जोड़ने आपके गुण समूह में price
समूह।
/app/design/frontend/base/default/template/catalog/product/view.phtml
if(date between tierprice_from_date and tierprice_to_date){
echo $this->getTierPriceHtml();
}
में तो है कि किराए की जांच जब आइटम का उपयोग कर गाड़ी में जोड़ा जाता है पर्यवेक्षक के साथ कस्टम मॉड्यूल बनाना घटना 'sales_quote_add_item'
:
बनाएँ: एप्लिकेशन/कोड/स्थानीय/MageIgniter/TierPriceDateRange/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MageIgniter_TierPriceDateRange>
<version>1.0.1</version>
</MageIgniter_TierPriceDateRange>
</modules>
<global>
<models>
<tierpricedaterange>
<class>MageIgniter_TierPriceDateRange_Model</class>
</tierpricedaterange>
</models>
<events>
<sales_quote_add_item>
<observers>
<tierpricedaterange_observer>
<type>singleton</type>
<class>tierpricedaterange/observer</class>
<method>updatePrice</method>
</tierpricedaterange_observer>
</observers>
</sales_quote_add_item>
</events>
</global>
</config>
बनाएँ: एप्लिकेशन/कोड/स्थानीय/MageIgniter/TierPriceDa teRange/मॉडल/Observer.php
class MageIgniter_TierPriceDateRange_Model_Observer
{
public function updatePrice($observer) {
if(date NOT between tierprice_from_date and tierprice_to_date){
$cartItem = $observer->getEvent()->getQuoteItem();
// check if a tier price was apply and change it back to the original price (none tier price)
$product = Mage::getModule('catalog/product')->load($product->getId());
if($cartItem->getPrice() == $product->getTierPrice($cartItem->getQty())){
$new_price = $product->getPrice();
$product->setOriginalCustomPrice($new_price);
$product->save();
}
}
return $this;
}
बनाएँ: एप्लिकेशन/etc/मॉड्यूल/MageIgniter_TierPriceDateRange.xml
<?xml version="1.0"?>
<config>
<modules>
<MageIgniter_TierPriceDateRange>
<active>true</active>
<codePool>local</codePool>
</MageIgniter_TierPriceDateRange>
</modules>
</config>
तो स्पष्ट कैश, यदि कोई हो।
स्रोत
2013-01-29 14:28:48
मैं 'isStoreDateInInterval' फ़ंक्शन के उपयोग की अनुशंसा करता हूं। उपयोग: 'मेज :: ऐप() -> getLocale() -> isStoreDateInInterval (null, tierprice_from_date, tierprice_to_date' – Ian
क्या आप कृपया मुझे बता सकते हैं कि मैं प्रत्येक ग्राहक समूह को स्तरीय मूल्य अनुभाग में नए गुण कैसे निर्दिष्ट कर सकता हूं। मुझे अलग-अलग जोड़ना होगा प्रत्येक ग्राहक समूह के लिए डेटा। –
@RohitGoel http://stackoverflow.com/questions/18241595/how-do-you-add-custom-attributes-to-customer-groups-in-magento देखें –