Limit cart to 1 product per attribute/type - Magento - magento

Our company sells pharmaceuticals online and by law we are limited to how much of a particular drug a customer can purchase.
For singular products with one brand this is easily controllable through default Magento functionality, my problem arises when we have different brands of a particular drug.
In a nutshell I can currently limit a customer to 1 pack of paracetamol from brand A but there is nothing to stop them getting another pack from brand B at the same time.
I would like to be able to check the cart for products with a particular attribute and limit them to 1 per cart. Ideally this would be when the customer clicks add to cart and the message would be displayed via the default Magento alerts that we currently have.
EDIT: I think the easiest way to solve this would be to check the SKU codes currently in the basket when adding a product to the cart. If there is a match, Throw up an error else add the item to the cart.

I think this link will help you but you need to modify as per your requirement. http://ceckoslab.com/magento/magento-check-if-product-is-in-cart/..
This link is to check the cart whether the same product is added or not? So modify this as per you requirement

You can set maximum allowed quantity in cart from admin panel. System->configuration. From left tab see catalog->inventory. Set Maximum qty allowed in shopping cart to 1.
If you want to add check on whole cart. see this paid extension

Related

Volusion Soft Add To Cart - Show cart Total instead of Subtotal

In the Volusion shopping carts "soft add to cart" feature, which is turned on in product options with "Enable Add To Cart Popup", the popup shows the "Subtotal" of products currently in the cart.
The issue is this Subtotal does not include quantity discounts and therefore shows customers a higher price than the actual Subtotal after discounts are applied.
For that reason, we would like to display the cart Total, which includes any quantity discounts applied.
The problem is, I cannot find a place where this can be done in the HTML we have access to and if I were to find it, I'm not sure of the proper Volusion syntax to use to call up the Total instead of the Subtotal.
Thanks!
I had a different issue, but the same problem (soft add to cart did not display the proper info).
In my case, we allow engraving on our products, for an additional charge, and when selected this option was not displayed in the popup cart. As a result, customers were not sure if they chose it or not.
My solution was to add a Shopping Cart block to the page, as part of the template, using jQuery.
If you call http://yourUrl/AjaxCart.asp you'll see the discount info you need in the JSON data, as well as the line items in the order.

Magento 1.9 Custom Math Pricing / Simple Product Issue with Price

I've installed an extension, Custom Math Pricing by Mico Solutions, and I am experiencing 2 issues with my site now.
Issue 1: When I customize the product, the price is updated correctly on the product page, however, when the product is sent to the cart, a portion of the price is missing (length x price per foot). I checked in the database to look for the price and could only find records of the wrong price so the price is only showing for the product page. The portion of the calculation that is missing from the price includes an attribute which is set as a variable rather than custom options. The custom options calculate perfectly.
Issue 2: When I customize a simple product and add it to the cart, I cannot go back to that product page and customize it a second time, the price remains fixed on the "base" price. Let's say the product has a base price of $10.00. When I customize it, the price stays at $10.00 but is different in the cart. I have to delete my browser cache and cookies in order to customize it again and by doing that, my cart is emptied.
So my question is, where in the code can I find the pricing that is being sent to the sales_flat_quote table in the database. Additionally, how can I debug or correct the issue of customizing a product a 2nd time?
It seems like you've got an issue with conflicting extensions. Your best bet is to go to the Admin modules section (Admin > System > Configuration > Advanced > Advanced) and disable anything else that appears to deal with product pricing. Reset the cache and index and try again. I am somewhat familiar with this extension and it's not compatible with configurable products... make sure your products are simple product types when adding products.

Magento: Add multiple products to cart at once

I have a number of configurable products in Magento CE 1.9
I would like to give users the ability to view a product and add multiple sizes to their cart with one click .
Product Title
Small : Select Quantity
Medium: Select Quantity
Large: Select Quantity
Add to Cart
The cart would then need to show how many of each size has been selected and show the total cost for that product.
Is this doable, and what is the best approach?
Many thanks
You could do it but it would be a lot of information for your customer, so what in my experience solves best you problem is to use an ajax cart module, that can add products to cart without leaving the pages, so if the customer want many sizes or colors, he keep adding the one he want.
Here follow a module that is already developed, but if you want a custom development my company can do for you just get in contact with me. ( module: <---- not my company module but worked once with a customer)

Magento Qty Increments

Basically all my products in magento are single units, however everything is sold in packs say 10 units to a pack. Theres the Enable Qty Increments on the product options in Magento and then you enter the Qty increments, which works without problems. However by default when you go to the product on the front end, hit add to cart it tries to add just 1 unit not the minimum of 10 is there a way, when you hit add to cart it adds the minimum qty of 10 rather than 1?
I know this is a while after you posted the problem & you probably have a fix already..
We are looking at this problem ourselves.. & have an issue with Bundled products not allowing us to add more than one instance of the product on each page.. hard to explain..
What I am thinking to do is remove the quantity box from the actual product.. Customers can select in a drop down if they want packs of 5 - 10 - or singles.. if they require odd numbers they can adjust the number still in the checkout..
does that all make sense..
Add to cart & Qty box are on the products.phtml page i think... I am still looking at all my options though.. Setting up a selection of Grouped products at the moment..
Just a passing suggestion ;)
Edit.. // What we have done as a final solution.. Use // Promotions /
Shopping Cart Rules.. You can make specific rules for Bulk categories
& Products in set numbers.. This will be a lot easier for our staff to
manage.. just drop requested products into a category called "bulk"
..wish I had thought of it earlier :)
In Admin panel go to
System >> Configuration >> Catalog >> Inventory >> Product Stock Options and set Qty Increments to what you want.
Magento provides Bundled Products to achieve such sell of products in packets.
Create a Bundle Product and follow these steps at Bundled Items tab in product edit form
Add New Option
Provide Title, select input type checkbox or multiselect and set Is Required to Yes
Search your product in below grid and add this product providing "Qty to add" to 10
Add selected product to option and then save product.

Hide buy button in product page in same products

I have one issue. It's able to make in magento that in some products don't show add to cart button. Because I want make these products just informational and not buyable.
Is any hack in magento like this?
You could add a custom attribute to your products that would mark them as not available for sale. After doing this, you can just modify your templates to not show the buy/add to cart buttons if the attribute is set to true.
Of course, good practice would suggest that you also prevent these products from actually being added to the cart manually, just hook an observer to the card add event and check for the attribute and skip if it's set to true.
It's not necessary to customize code
just set product stock 0 then enable Display Out of Stock Products
set product stock 0
Enable Display Out of Stock Products
Set Minimum Qty Allowed in Shopping Cart to 1
that's it.
When customer want to add product to cart, the system will not accept is because of the stock level.
PS : I suggest this technique is because of your request which you specified "but buyable" in your question.
Here is the extension Click here for extension which I guess is suitable for your question:
Call For Price

Resources