Display delivery time in magento - magento

I want to display delivery time of products along with IN STOCK on my magento(1.7) based shopping cart.
For eg: "Delivered in 2-3 business days."
Is there any such option available in Magento community version?

One way that you can implement this is to add a new attribute to the product with all the different delivery options available.
You can then populate this and use the data to update the front end store. Emails etc.

This will be working for regular products.
<?php if ($qtyStock = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty()>0):{?>
<p class="availability in-stock">
<span class="label"><?php echo $this->helper('catalog')->__('Availability:') ?></span>
<span class="value"><?php echo $this->helper('catalog')->__('In stock') ?></span>
<span class="value"><p>Delivery Time:</p>
<div id="delivery_time"><p>Delivered in 2-3 business days.</p></div></span>
</p>
<?php } else: { ?>
<p class="availability out-of-stock">
<span class="label"><?php echo $this->helper('catalog')->__('Availability:') ?></span>
<span class="value"><?php echo $this->helper('catalog')->__('Out of stock') ?></span>
</p>
<?php } endif; ?>

Related

Retail Price for MAP enabled product in product view reloads to Special Price

I wanted to show the retail price for MAP enabled products. I tried to edit the view.phtml file and did this:
<div class="pro-info">
<?php if($_product->getData('msrp_enabled') == 1): ?>
<div class="price-box">
<p class="regular-price">
<span class="price-label">Retail Price:</span>
<span id="product-price-<?php echo $_product->getId(); ?>" class="price">
<span class="price">
<?php echo $this->helper('core')->formatPrice($_product->getPrice(), false) ?>
</span>
</span>
</p>
</div>
<?php endif;?>
And this displayed the Retail Price but the problem is; For some products it will display the special price. First when the site is loading it will display retail price and then suddenly change and show the special price instead.
I tried to view source of the page via Ctrl+U and it displays original price in Retail Price but in the frontend page it displays special price.
I also noticed that for some product Product.OptionsPrice([]) has values in it and for some it doesn't. And whichever product has values in Product.OptionsPrice([]) has the issue.
Can anyone help??
It had something to do with the id in the span tag.
<span id="product-price-<?php echo $_product->getId(); ?>" class="price">
Changed it to <span id="old-price-<?php echo $_product->getId(); ?>" class="price">

Magento - Let the user choose between exlude tax of include tax

I have a product with multiple options.
The user chooses how much he wants to pay for the product.
First I have created a dropdown box with the values €5,- €10,- etc.
The product price i have put to €0.
When I choose 10 euros, the product changes to 10 euros - that's good.
Now I want a checkbox where users can choose between Exclude Tax and Include Tax, so if I choose excluding tax the product will be inserted in the shopping cart as €10,00 witch is ok (excluding tax).
But when I choose Including tax the product needs to be inserted in the shopping cart as 10 /1.21 = €8,26 (excluding tax).
How can I make this possible?
EDIT:
I have the following code:
$event = $observer->getEvent();
$quote_item = $event->getQuoteItem();
if (is_array($quote_item->getOptions())) {
foreach ($quote_item->getOptions() as $optionValue) {
echo ???? . ' --> ' . $optionValue->getValue() . '<br />';
}
}
This will give me the values from the options.
But how do I get the real option_id? I get the option_type_id now.
If you look to below page
app/design/frontend/default/default/template/catalog/product/price.phtml
you will find below code
<?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
<span class="price-excluding-tax">
<span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
</span>
</span>
<span class="price-including-tax">
<span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span>
<span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?>
</span>
</span>
<?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
<span class="price-excluding-tax">
<span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
</span>
</span>
to implement you can refer
Changing the price in quote while adding product to cart: magento

How to show configurable product stock status?

I have this phtml file which shows stock status:
<?php $_product = $this->getProduct() ?>
<?php $productQty = (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); ?>
<?php if ($productQty > 100): ?>
<div class="catalog-stock over-stock">
<span class="qry-text"><?php echo $this->__('In stock:'); ?></span>
<span class="qry-count">100+</span>
</div>
<?php elseif ($productQty > 0 && $productQty <= 100): ?>
<div class="catalog-stock normal-stock">
<span class="qry-text"><?php echo $this->__('In stock:'); ?></span>
<span class="qry-count"><?php echo $productQty; ?></span>
</div>
<?php elseif ($deliveryDate = $_product->getStockDeliveryDate()): ?>
<div class="catalog-stock no-stock">
<span class="qry-text"><?php echo $this->__('Expected'); ?></span>
<span class="qry-count"><?php echo $deliveryDate; ?></span>
</div>
<?php elseif ($_product->getTypeId() != 'configurable' && $_product->getTypeId() != 'grouped' && $_product->getTypeId() != 'bundle'): ?>
<div class="catalog-stock no-stock">
<span class="qry-text"><?php echo $this->__('Expected'); ?></span>
<span class="qry-count"><?php echo $this->__('n/a'); ?></span>
</div>
<?php endif; ?>
I call it with this line <?php echo $this->getChildHtml('product_type_data') ?> from product/view/view.phtml
When used with simple product it works perfectly, but how to do same thing with configurable product?
What I want is to change stock status depending on what configurations is selected.
One solution is to check if product is configurable and then display all values at same time and hide with css. But if I do this I have problem - how to know which product is selected and show it's stock status?
I guess best option would be to do this with ajax, but I spent hours trying to do that and didn't succeed.

Magento continue shopping url change

Is there any setting in magento backend to change continue shopping url ? If there any settings is there let me know How I can change. I am using Magento 1.7.x
Sadly not, I've always wondered why this hasn't been in the configuration. You have two choices, you can either extend Mage_Checkout_Block_Cart to apply logic to determine what URL to use or you can set the the URL in the template.
<?php $this->setContinueShoppingUrl('http://URL.com'); ?>
<div class="page-title">
<h1><?php echo $this->__('Shopping Cart is Empty') ?></h1>
</div>
<div class="cart-empty">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<p><?php echo $this->__('You have no items in your shopping cart.') ?></p>
<p><?php echo $this->__('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?></p>
</div>
However, if you're going to set it in the template, you might as well just remove change <?php echo $this->__('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?> to <?php echo $this->__('Click here to continue shopping.') ?>
To change redirect url of continue shopping button in "NOT" empty shopping cart just add the second code line following highlighted with asterix ** in ...your_theme/default/checkout/cart.phtml:
<?php if($this->getContinueShoppingUrl()): ?>
**<?php $this->setContinueShoppingUrl('http://yoursite.com/...'); ?>**
<button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
<?php endif; ?>
cheap & effective
Thanks to previous answer/hint

Magento - Tax Excluded on Product Details Page but Included on Listing Page

My problem is that I don't have the same price in Product Details and Listing Page.
I want to have all over the website the prices Included Tax.
How Can I solve this problem probably of configuration in Magento backend.
Thanks a lot.
for Product List :
look at the following file
root/app/design/frontend/default/default/template/catalog/product/price.phtml
you will see the following code which you can change what you want :
<?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
<span class="price-excluding-tax">
<span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
</span>
</span>
<span class="price-including-tax">
<span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span>
<span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?>
</span>
</span>
<?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
<span class="price-excluding-tax">
<span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
</span>
</span>

Resources