Magento continue shopping url change - magento

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

Related

Magento Save Value in Custom Attribute of Customer from one page checkout (billing.phtml)

I have made one attribute for customer registration. It is working fine on registration. I am getting problem on one page checkout. Like normal registration, i am also taking value from customer during one step checkout registration but problem is that it doesn't store the value in attribute. thank you in advance
code of billing.phtml which display textbox for attribute to take value from user
<li class="fields">
<div class="field">
<label for="<?php echo $attribute->getAttributeCode(); ?>" <?php if($attribute->getIsRequired()):?>class="required"><em>*</em> <?php else :?>><?php endif;?><?php echo $this->__($frontEndLabel) ?></label>
<div class="input-box">
<?php if($attribute->getFrontendInput()== 'text'):?>
<input type="text" name="billing[test]" id="billing:<?php echo $attribute->getAttributeCode(); ?>" title="<?php echo $this->__($frontEndLabel); ?>" class="input-text <?php echo $fieldRequiredClass; ?> <?php echo $fieldFrontendClass ;?>" />
<?php endif ?>
</div>
</div>
<?php endif ?>
<?php endforeach ?>
</li>
Just Update following code in your config.xml and check it
<fieldsets>
<checkout_onepage_quote>
<attributename>
<to_customer>*</to_customer>
</attributename>
</checkout_onepage_quote>
</fieldsets>

magento Default store view not working in front end

This question is the duplicate of this one. None answer this question so far.
I am running a magento 1.9.1.0. And I have two stores, One is English and other one is Arabic.
My default store view is English in system --> manage stores. But in
the front end, arabic page is loading by default.
Why is it so? Any one can please help me with this?
You have set the locale in default configuration scope
admin > system > configuration > General > Locale Option > Locale
Check your language.phtml
If you are using flags instead of dropdown make sure you define the default language.
by using <?php if ($_lang->getCode() != 'default'): ?>
refer to complete code below
<?php if(count($this->getStores())>1): ?>
<div class="form-language">
<div class="langs-wrapper">
<?php foreach ($this->getStores() as $_lang): ?>
<?php if ($_lang->getCode() != 'default'): ?>
<?php $selected = $_lang->getId() == $this->getCurrentStoreId() ?>
<a class="lang-flag<?php $selected && print ' selected' ?>" href="<?php echo $_lang->getCurrentUrl() ?>">
<img src="<?php echo $this->getSkinUrl('images/flags/' . $_lang->getCode() . '.png');?>" alt="<?php echo $this->htmlEscape($_lang->getName()) ?>" height="16" width="24">
</a>
<?php endif;?>
<?php endforeach ?>
</div>
</div>
<?php endif;?>

how to show add to cart after login only in every page with magento

I want to show add to cart button after login in every page in magento.
For that i have used below coding in app\design\frontend\default\sagsupplies\template\catalog\product\view.phtml page
<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>
<?php if (!$this->hasOptions()):?>
<div class="add-to-box">
<?php if($_product->isSaleable()): ?>
<?php echo $this->getChildHtml('addtocart') ?>
<?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->getChildHtml('addto') ?>
</div>
<?php echo $this->getChildHtml('extra_buttons') ?>
<?php elseif (!$_product->isSaleable()): ?>
<div class="add-to-box">
<?php echo $this->getChildHtml('addto') ?>
</div>
<?php endif; ?>
<?php } ?>
but it is not working.add to cart button still shows.I want to hide add to cart button in every page.If anyone knows this, please help me out.
Thanks!
1.In app\design\frontend\default\sagsupplies\template\catalog\product\list.phtml,
add the line,
if (Mage::getSingleton('customer/session')->isLoggedIn()):
before
if($_product->isSaleable())
2.app\design\frontend\default\sagsupplies\template\catalog\product\view\addtocart.phtml
add the line
if (Mage::getSingleton('customer/session')->isLoggedIn()):
before
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
<?php echo $this->getChildHtml('', true, true)

Hide Bundle Items in Magento

I'm looking for help with a rather frustrating Magento issue I can't seem to get my head around.
On our Magento site we have several Bundled Products. These work fine etc but all the items of the Bundled Product are displayed on the page; it makes the page unnecessarily long & the list isn't need as the items are fixed, customers can not change or edit any of the items.
Ideally what I would like to do is stop those items being displayed so it looks more like a normal product page.
I have tried editing the view.phtml file located in:
app/design/frontend/default/my_theme/template/catalog/product/
I found the following blocks of code:
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>
When the 'container2' lines are removed, it does remove the list of bundled items but also removes the 'Add to cart' button too.
Would appreciate any help on this as I haven't been able to resolve this issue using Google Sensei.
Step:1 First Remove below Lines from --template\catalog\product\view.phtml
if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif; ?>
Step2: Add Below Lines inplace of Above lines
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/view/addtocart.phtml')->toHtml(); ?>
Step3: --template\catalog\product\view\addtocart.phtml
Remove All Lines from file and add below code
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
<div class="add-to-cart">
<?php ?>
<label for="qty"><?php echo $this->__('Qty:') ?></label>
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
<!--<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>-->
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button></p>
<?php echo $this->getChildHtml('', true, true) ?>
</div>
Step4: - Go to admin panel, Go to products and if custom Options are marked as required mark them as not required.
See this screen shot for more info
Thanks...
Although this is a very old issue, but thought this might be useful for someone who runs into the requirement.
All you would want to do is, edit the .phtml file which renders the Bundle items.
This is how I solved it:
Usually the file you would want to edit would be:
YOUR_THEME->default->template->bundle->catalog->product->view->type->bundle->option->select.phtml
If you cant find this path in your theme, then:
Step1) Turn on Template hint from System->Configuration. Click on Developer, and under Debug tab, Enable the Template hint.
Step 2) Refresh or go to the product view page, where your bundle items are listed, locate the file through template hint.
Once you are in select.phtml file, you can do whatever you want to hide or display or change the code. I just added a div with "display:none" style, and it hid the whole "Bundle Item" block.

Magento Ecommerce - How to call and display a product's details into a CMS page?

I would like to be able to insert and display a product the same way it is displayed in the product page, but into a CMS page (with attributes, prices, order button, etc...)
I've succeeded in creating a single page by inserting copied parts of the source code of a product page but this is quite a lenghty and time consuming process considering that I'm planning to have quite a few pages done.
Therefore I would like to be able to call the product details into a CMS page.
I thought I could use the view.phtml and insert it into the desired CMS page but I couldn't figure out how to define the product_id either...
Thank you all in advance for your comments
Hmm, CMS Macro like this:
{{block type="catalog/product" template="catalog/product/line-item.phtml" sku_id="CI 101"}}
Referencing template catalog/product/line-item.phtml:
<?php //Template_Name/catalog/product/line-item.phtml
//{{block type="catalog/product" template="catalog/product/line-item.phtml" sku_id="CI 100"}}
//Feed template SKU for product listing
?>
<?php $_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->getData('sku_id')); ?>
<?php /* get special freight messages from custom variables */
$freightfree = Mage::getModel('core/variable')->loadByCode('free_freight_text')->getValue('plain');
$hazmat = Mage::getModel('core/variable')->loadByCode('hazmat_text')->getValue('plain');
$ormd = Mage::getModel('core/variable')->loadByCode('ormd_text')->getValue('plain');
?>
<!-- <div class="single-product"> -->
<div class="listing-type-list catalog-listing">
<div class="listing-item last">
<?php $specialshipping = $_product->getAttributeText('special_shipping_group') ?>
<?php // Product Image ?>
<div class="product-image">
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getSmallImageLabel()) ?>">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
</a>
</div>
<?php // Product description ?id= echo $_product->getId();?>
<div class="product-shop">
<h2><?php echo $this->htmlEscape($_product->getName())?></h5>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product) ?>
<?php endif; ?>
<?php echo $this->getPriceHtml($_product, true) ?>
<?php if(!$_product->getNotforsale()): ?>
<?php if(!$_product->getReplace_add_button()): ?>
<?php if($_product->isGrouped()): ?>
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('View Selection') ?></span></button>
<?php elseif($_product->getHasOptions()): ?>
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('View Options') ?></span></button>
<?php else: ?>
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
<?php endif; ?>
<?php else: ?>
<button class="form-button" onclick="setLocation('<?php echo $_product->getProductUrl() ?>')"><span><?php echo $_product->getAttributeText('replace_add_button') ?></span></button>
<?php endif; ?>
<?php endif; ?>
<div class="clear"></div>
<?php /* display special freight messages from custom variables */ ?>
<?php if($specialshipping == "Free Ground" || $specialshipping == "Free Gnd ORMD"): ?>
<?php echo '<span class="regular-price"><span class="freightfree">' . $freightfree . '</span></span>' ?>
<?php endif; ?>
<?php if($specialshipping == "ORM-D"): ?>
<?php echo '<span class="freightfree">' . $ormd . '</span>' ?>
<?php elseif($specialshipping == "Free Gnd ORMD"): ?>
<?php echo '<br><span class="freightfree">' . $ormd . '</span>' ?>
<?php elseif($specialshipping == "HazMat"): ?>
<?php echo '<span class="freightfree">' . $hazmat . '</span>' ?>
<?php endif; ?>
<div class="description">
<?php echo nl2br($_product->getShortDescription()) ?>
<small><?php echo $this->__('Learn More') ?></small>
</div>
<p class="add-to">
Brand Name: <?php echo $_product->getBrand() ?>
</p>
</div>
</div>
</div>
Be aware this is pulling in several custom attributes and variables you probably won't find on your system. The most important is the CMS Macro
{{block type="catalog/product" template="catalog/product/line-item.phtml" sku_id="CI 101"}}
and this line:
<?php $_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->getData('sku_id')); ?>
Use Macro as many times on the CMS page as you want.

Resources