Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function estimatedDeliveryDateModifierForProduct($product, $qtyInCart) {
- //Is the product a pre order product?
- if ($preOrderDate = $product->getPreOrderDate())
- {
- $diff = date_diff(
- new DateTime,
- new DateTime($preOrderDate)
- );
- return $diff->format('%a');
- }
- //If it has to be backordered...
- if ($product->getQty() < $qtyInCart) {
- if (empty($product->getSupplierId())) {
- return Mage::getStoreConfig('supplier/stock_file/delivery_modifier');
- } else {
- return Mage::getModel('supplier/supplier')->getCalDeliveryTime($product->getSupplierId());
- }
- }
- if (Mage::Helper('catalog')->productIsBike($product)) {
- return 2;
- }
- //If we got here, the item is in stock and it
- //is not a bike. We can ship it in 1 day.
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement