Title: Allow Only Last Item In Cart
Author: Savan Dholu
Published: <strong>July 13, 2021</strong>
Last modified: November 8, 2021

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/allow-only-last-item-in-cart/assets/icon-128x128.png?rev=2563187)

# Allow Only Last Item In Cart

 By [Savan Dholu](https://profiles.wordpress.org/savan91/)

[Download](https://downloads.wordpress.org/plugin/allow-only-last-item-in-cart.zip)

 * [Details](https://wordpress.org/plugins/allow-only-last-item-in-cart/#description)
 * [Reviews](https://wordpress.org/plugins/allow-only-last-item-in-cart/#reviews)
 *  [Installation](https://wordpress.org/plugins/allow-only-last-item-in-cart/#installation)
 * [Development](https://wordpress.org/plugins/allow-only-last-item-in-cart/#developers)

 [Support](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/)

## Description

This Plugin gives you the functionality when the user clicks on Add to Cart button
it will clear all previous cart data entirely and add new cart data, only allow 
one product purchase at a time.

## Installation

Upload the allow_only_last_item_in_cart plugin to your plugin directory, activate
it

For backwards compatibility, if this section is missing, the full length of the 
short description will be used, and
 Markdown parsed.

e.g.

 1. Upload `allow_only_last_item_in_cart.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place `<?php do_action('allow_only_last_item_in_cart'); ?>` in your templates

A few notes about the sections above:

 * “Contributors” is a comma separated list of wordpress.org usernames
 * “Tags” is a comma separated list of tags that apply to the plugin
 * “Requires at least” is the lowest version that the plugin will work on
 * “Tested up to” is the highest version that you’ve _successfully used to test 
   the plugin_. Note that it might work on
    higher versions… this is just the highest
   one you’ve verified.
 * Stable tag should indicate the Subversion “tag” of the latest stable version,
   or “trunk,” if you use `/trunk/` for
    stable.
 * Note that the `readme.txt` of the stable tag is the one that is considered the
   defining one for the plugin, so
    if the `/trunk/readme.txt` file says that the
   stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that’ll be used for displaying
   information about the plugin. In this situation, the only thing considered from
   the trunk `readme.txt` is the stable tag pointer. Thus, if you develop in trunk,
   you can update the trunk `readme.txt` to reflect changes in your in-development
   version, without having that information incorrectly disclosed about the current
   stable version that lacks those changes — as long as the trunk’s `readme.txt`
   points to the correct stable tag.
 * If no stable tag is provided, it is assumed that trunk is stable, but you should
   specify “trunk” if that’s where
    you put the stable version, in order to eliminate
   any doubt.

## Reviews

![](https://secure.gravatar.com/avatar/7c6d7e0f3bed3a1bbba3734561ae27ae35026d67a36a05a3c83e43c758a99a8b?
s=60&d=retro&r=g)

### 󠀁[An Amazing Plugin](https://wordpress.org/support/topic/an-amazing-plugin-33/)󠁿

 [Savan Dholu](https://profiles.wordpress.org/savan91/) September 1, 2021

Just added working automatically Relevant and Better!!

 [ Read all 4 reviews ](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/)

## Contributors & Developers

“Allow Only Last Item In Cart” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ Savan Dholu ](https://profiles.wordpress.org/savan91/)

[Translate “Allow Only Last Item In Cart” into your language.](https://translate.wordpress.org/projects/wp-plugins/allow-only-last-item-in-cart)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/allow-only-last-item-in-cart/),
check out the [SVN repository](https://plugins.svn.wordpress.org/allow-only-last-item-in-cart/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/allow-only-last-item-in-cart/)
by [RSS](https://plugins.trac.wordpress.org/log/allow-only-last-item-in-cart/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0

 * A change since the previous version.
 * Another change.

#### 0.5

 * List versions from most recent at top to oldest at bottom.

## Meta

 *  Version **1.0.0**
 *  Last updated **5 years ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.7 or higher **
 *  Tested up to **5.7.20**
 *  PHP version ** 7.0 or higher **
 * Tags
 * [comments](https://wordpress.org/plugins/tags/comments/)[spam](https://wordpress.org/plugins/tags/spam/)
 *  [Advanced View](https://wordpress.org/plugins/allow-only-last-item-in-cart/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/reviews/)

## Contributors

 *   [ Savan Dholu ](https://profiles.wordpress.org/savan91/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/allow-only-last-item-in-cart/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.virtualheight.com/)