1

Is it possible to make it so when an image is click a product is added to the cart?

At the moment , i have tried the below:

<?php if ($login && Mage::getSingleton('customer/session')->getCustomerGroupId()==5)
{?>
<div><?php

echo '<img src="http://www.mydomain.co.uk/images/basket_banner_v2.png">'; }?>
</div> 

Which makes sure the correct banner is shown for the group and then displays the image, however i dont know how to make that image add a product tot he cart when it is click or even if it is possible.

I have tried wrapping the image in anchor tags but it just redirects to the cart without doing anything.

<a href="http://www.mydomain.co.uk/checkout/cart/add?product=[11341]&qty=[1]">
2
  • what is the issue?
    – Amit Bera
    Commented May 8, 2015 at 9:41
  • I dont know how to make the image clickable so that when it is click a certain product is added to the cart, either by SKU or product ID
    – Adam Allen
    Commented May 8, 2015 at 9:43

1 Answer 1

1

I found the answer through one of after a bit more digging it can be found here:

I want to use ADD TO CART via URL in Magento 1.8 but don't know which files to change

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.