Child pages
  • Add Free Product To Cart
Skip to end of metadata
Go to start of metadata


Having hard time finding an answer to your question?

Check out our Knowledge Base.

Extension page:

Spring a surprise on customers when they place an order. The Add Free Product To Cart Magento extension allows you to set up rules to present a gift to your clients or offer a discount on any product. 




1. Backup your web directory and store database.

 Click to view details

You can make backup copies with any tool you find appropriate

If you are going to use the native Magento backup function, navigate to System -> Tools -> Backups and perform System and Database backups

 2. Log in to the Magento backend

 3. Disable compilation

 Click to view details

Navigate to System -> Tools -> Compilation.

If Compiler status is Disabled, you can skip to the next step

If Compiler is enabled, disable it.

IMPORTANT: after the extension is installed, you can enable the compilation again; IT IS CRUCIAL that you use "Run Compilation Process" function, not just "Enable button"


Installing an extension with the Compilation enabled will result in store downtime.

 4. Flush store cache

 Click to view details

You can flush the store cache in 2 ways:

  • via the backend:

Navigate to System -> Cache Management menu, and click Flush Magento Cache button

  • via filesystem:

On your server, navigate to Magento root folder, then proceed to /var/cache/; delete all the content there.

 5. Download the extension package from your account and extract the downloaded archive

 6. Copy the content of /Step_1/ folder to your store's root directory

If you are using a custom theme,

 read the instructions here.

The extension comes with 2 design packages: /base/default/ and /rwd/default/ .

In case you are using a custom theme, it is recommended to copy the design files to your current theme's folders. In case there are several themes in use at the same store, the design files must be copied to each of them.

  • Find this folder in the package: /step_1/app/design/frontend/base/default/ ; copy its content to /app/design/frontend/[your_package]/[your_theme]/
  • Find this folder in the package: /step_1/skin/frontend/base/default/ ; copy its content to /skin/frontend/[your_package]/[your_theme]/

 7. Copy the content of /Step_2/ folder to your store's root directory

 8. Flush store cache again; log out from the backend and log in again.


General Configuration

Go to Promotions->Add Free Product To Cart->Settings (or to System->Configuration->aheadWorks Extensions->Add Free Product To Cart) to configure the extension's general options.


General tab:

  • Enable Extension : "Yes/No" 
  • Allow to re-add free product if it was deleted from cart: the option defines whether a free items will be added back to cart in case a customer has removed them manually (after the cart update).



Popup tab:


  • Display option "Do not show this pop up again": This option works if customer click 'Decline' only. It does not work if it is ticked and 'Accept' button is clicked. 
    NOTE: The combination 'Do not show this popup again' and clicking 'Declined', will cancel all further rules processing for the current shopping cart content.
  • Display pop up on shopping cart and on checkout page only (AJAX Cart Pro extension required) - allows displaying the Add Free Product to Cart pop up on the cart and checkout pages only;
  • Cookie lifetime: this option defines for how long the pop-up window will remain inactive after a customer closes it



Setting Up Rules 

Rule Info | Conditions | Action 

You can add new rules and manage the existent ones in Promotions->Add Free Product To Cart->Rules backend page.


Rule Info tab:

Here, you can specify the basic rule parameters: Rule Name, Description (visible to admin users only), Status, Storeview, Customer Groups, From-To dates.

Pay attention to the below options:

  • Show Pop Up on adding Item(s) to Cart: If set to 'No', the product will be added to cart automatically. 
    If this option set to 'Yes' a popup prompting a confirmation to add product to cart will be displayed. If several rules are triggered at a time, the popup will show the full list of currently available free items.

     How does it look like?

    If the current cart content matches several rules, the customer will get the below pop-up window

    *in case AJAX Cart Pro is installed, the popup(s) will be displayed on Cart View, or Checkout pages, depending on what page customer visit first.

  • Priority: this option defines the order of rules processing. Can work in conjunction with "Stop Further Rules Processing" option



Conditions tab:

In this tab, you should define the conditions for the rule to get triggered.

The available conditions are identical to those of the native Shopping Cart Price Rules, and include Cart Attributes (Total Amount/ Quantity, etc) and Product Attributes.



Action tab:

Currently, the extension supports 2 bonus types (you can switch between them via "Apply" selector), each of the bonus types has different set of options.

Percent of product price discount

This option adds the selected product to cart when the rule conditions are met; it also allows applying the discount (up to 100%) to the bonus item

  • Discount Amount Applied to Product, %: specify a discount amount to be applied for the product. If you want to add a product for free, set this option to '100' 
  • Free Shipping:  choose whether to ship the product free of charge.
  • Stop Further Rules Processing: if this option is enabled, any other Add Free Product... rules with lower priority will not be executed.


  • Action Product:  select the product which should be added to cart. 
    The following types of the products are supported:
      • Simple (without custom options)
      • Virtual (without custom options)
      • Downloadable (without custom options; the option in the products settings->Downloadable Information->Links->'Links can be purchased separately' must be set to 'No')

Note, a single rule can add a single product at a time. If you need to add several products, create appropriate quantity of the rules with similar conditions, but with different actions.

Buy X get one free

This bonus type is quantity-based, and works much like that in the native Shopping Cart Price rules. It gives 1 free item* for each X products* (the quantity specified in "Target Qty (Buy X)" field) in the cart.

The following types of the products are supported:

    • Simple (without custom options)
    • Virtual (without custom options)
    • Downloadable (without custom options; the option in the products settings->Downloadable Information->Links->'Links can be purchased separately' must be set to 'No')

*NOTE: both the main and the bonus items are the same Magento product in this case.



If you require to disable the extension without removing it completely, go to System->Configuration->Advanced->Advanced->Disable Modules Output and disable the module AW_Afptc.  Also, the extension can be switched off following steps 1-5 below, without deleting the files of the extension.

1. Disable compilation, in case it is enabled.

2. Login to your FTP, navigate to app/etc/modules/

3. Open the file AW_Afptc.xml and change the following line: 



Now your Magento is unaware of the existence of the extension.

4.Clear the cache under var/cache

5.Make sure that the site is working properly, otherwise roll back the changes and apply to our technical support.

6.If everything works fine, it is safe to delete the files of the extension.

7. In case you need to clean the database, make a backup and then run the following query in MySQL: 

Note, if you are using the table with prefixes, you must specify them in all table names.  
If you are not sure how to do that or expect any troubles with it, please contact your server administrator regarding the matter. 
If you remove the tables as it is described above, you will need to create all rules again after the extension is reinstalled.



After the extension installation the store gives an error, or blank page, or suggests to start Magento installation procedure.

Change the owner of the extracted extension files to the web server user and set 775 permissions on them. Clear the store cache and try again.

 After the installation System->Configuration->Add Free Product To Cart returns 404 error.

Logout from backend and login back again.

There is no aheadWorks extensions under my configuration section, or having the extension tab clicked I get a blank page, or Access Denied error.

Clear the store cache, browser cookies, logout and login again.

My configuration changes do not appear on the store.

 Clear the store cache, clear your browser cache and domain cookies and refresh the page.


You can always find the latest version of the software, full documentation, demos, screenshots and reviews at  
License agreement:  
Contact us:
Copyright © 2019 aheadWorks


  • No labels