How do I add an "add to cart" button to a Joomla module?
Posted by Steve Naqvi on 02 December 2009 02:27 AM
In Joomla, "mod_custom" modules are exempt from processing plugins.
If you don't want to hassle changing Joomla core files (which we do not recommend) or installing additional software, you could just add a HTML form manually to your mod_custom pages.

You just need to change the value in the line where the "oa_id" is defined to the id number of the desired product to add a different product into your cart. (In the attached example we used the oa_id "10")

A basic html form is needed to achieve add the add to cart plugin to a module.

##################EXAMPLE CODE################################################
<p>Quantity: </p>
<pre>
    <form action="http://www.fightfluvirus.com/index.php?option=com_ixxocart" method="POST">
        <input name="oa" value="AddItem" type="hidden">
        <input name="oa_id" value="10" type="hidden">
        <input name="backurl" value="http://www.fightfluvirus.com/index.php?option=com_ixxocart&amp;p=cart" type="hidden">
        <input name="oa_quantity" value="1" type="text">
        <input style="width: 100px;" value="Add to Cart" type="submit">
    </form>
</pre>

#########################################################################
(111 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).