home iconemail icon

Spokane Web Design - Web Hosting - Search Engine Optimization (SEO)

web design logotop edge

Archive for the ‘Magento’ Category

We created an eCommerce website in the Magento framework for Marle Worm Growers. We wanted to keep the organic feel to go along with the company’s eco-friendly, all natural principles. If you need red worms or organic fertilizing products, be sure to check the website out!

magento ecommerceFor people using the Magento ecommerce framework (v.1.6.1 used in this example) you have seen that once you go to view your shopping cart and hit the continue shopping button, it takes you back to the last product you viewed, and not the last category, as would be logical.

To fix this issue find the file :
app/design/frontend/base/default/template/checkout/cart.phtml

If you have a theme installed, you should look here first:
app/design/frontend/default/YOUR THEME NAME/template/checkout/cart.phtml

Now that you have the file you need, look for this code that starts the loop for every item in the cart(line 109 on my version):

<?php foreach($this->getItems() as $_item): ?>

Below that input the following code that will change the path of the continue shopping button by setting the product url to the category url inside the loop:

<?php

$_categories = $_item->getProduct()->getCategoryIds();
$_category = Mage::getModel(‘catalog/category’)->load($_categories[0]);
$url = $this->getUrl($_category->getUrlPath());
Mage::getSingleton(‘checkout/session’)->setContinueShoppingUrl($url);

?>

If you have multiple products it will always set the url to the last product.

If you have need for a website designer, call us today 509-475-1177

bottom edge