Tag Archives: magento community

Magento MatrixRates UK, EU and Rest of world CSV file for shipping methods

So this is a fiddly one and there doesn’t seem to be a pre-configured CSV out there for people to download, customize and import back into their Matrix Rates module.

Here is Sprouts pre-configured CSV file with a full list of all the Magento country codes (a separate column with EU or ROW (Rest of world) for ease of use) and a order value setup for specifying shipping rates based on the total amount of the order.

The CSV is an edited version of the export from the WebShopApps MatrixRate free version so for best practice grab a copy of the module, install it and then import your tweaked CSV.

Be sure to remove columns B and C before you re-import it

Hope this saves people some time

Adding buy now button to Magento (Skip the cart)

Here’s a task that keeps coming up again and again.

I’ve come across numerous ways to do this by editing the Observer file, adding a new action etc yet they all seem like over kill!

Why not do it nice and easy via jQuery? Nothing to add apart from a couple of bits of code, check this out…

Add this into your view.phtml file (app/design/frontend/your_template/default/template/catalog/product/view.phtml)

<script>
function setcheckoutLocation(location)
{
jQuery.ajax({
type:”GET”,
url:location,
success:function(data){
window.location.href = “http://www.your-site.com/checkout/onepage/”;
}
});

}
</script>

I dropped it in at line 187, just after the Java that follows on from the </form> tag.

Now head over to your addtocart.phtml file (app/design/frontend/your_template/default/template/catalog/product/view) and add in:

<button type=”button” title=”Buy Now” class=”button btn-cart” onclick=”setcheckoutLocation(‘<?php echo $this->getAddToCartUrl($_product) ?>’)”><span><span>Buy Now</span></span></button>
<?php echo $this->getChildHtml(”, true, true) ?>

I put this in at line 40, straight after the ‘Add to cart’ button, make sure its within the <div class=”add-to-cart-buttons”> DIV and it will follow on nicely after your Add to cart button. Or remove the Add to cart button.

I opted to keep both buttons to tempt a upsell/multibuy.