Author Topic: Help with quantity  (Read 3193 times)

oscar.colon

  • Beginner
  • *
  • Posts: 4
Help with quantity
« on: October 30, 2010, 22:44:09 pm »
I really need helps with an issue.

I need to find how to put a limit when a customer buy a item, for example:

In one categorie the customer can buy only one product of all, in the anohter category he can buy only one of each (this is simple i limited 1 to 1 in max min quantity) but i cant find where or how can i limit to one off all products in the same category.

i cant find a solution, someone can help me? Please post the cost and how can i contact.

Thank you

John M

  • Jr. Member
  • **
  • Posts: 216
  • Do what you do Best
    • JSM-Inc Web and Graphics Design
  • Skype Name: johnnysmallz
  • VirtueMart Version: 2.6
Re: Help with quantity
« Reply #1 on: October 30, 2010, 23:20:25 pm »
You can do it in the database under your products table column is product_order_levels  A bit of SQL to set all to 1,1

***SELECT STATEMENT TO GATHER PRODUCTS AND IDS OF CATS ASSOCIATED WITH IT
SELECT * FROM jml_vm_product_category_xref
INNER JOIN jml_vm_product ON jml_vm_product_category_xref.product_id = jml_vm_product.product_id

**SET STATEMENT TO SET THE LIMITS
UPDATE jml_vm_product
INNER JOIN jml_vm_product_category_xref ON jml_vm_product_category_xref.product_id = jml_vm_product.product_id
SET product_order_levels='1,1'
WHERE jml_vm_product_category_xref.product_id='the ID of the category you want to change'

"Life is not a journey to the grave with the intention of arriving safely in a well preserved body, rather to skid in broadside, thoroughly worn out, and loudly proclaiming, Damn that was fun, what a ride!"

oscar.colon

  • Beginner
  • *
  • Posts: 4
Re: Help with quantity
« Reply #2 on: November 01, 2010, 00:07:17 am »
Hello john M., thnaks by the answer.

I try your SQL code, and this only set 1,1 and the customer can buy 1 of all item in one category. This is not wath i want. I try to explain:

--- category 1
      base1
      base2
      base3

Here you can buy only one base1 if you try to buy another virtuemart must show "You cant buy another".

--- category 2
     add1
     add2
     add3

Here you can buy one of any product (this is fixed now, i set min and max to 1)

The problem is in the first category, i set 1,1 but you can add the 3 products to the cart, this isn't rigth.

I'm use ajax option to add products to the cart. May be its over there the solution, modify this code before close the cart. I'm not find where is this code or wath chage, i'm not a java programmer ;-).

Thank you again!

Oscar.