Author Topic: Cart Module: Change quantity based on product's category  (Read 2208 times)


  • Beginner
  • *
  • Posts: 5
Cart Module: Change quantity based on product's category
« on: January 26, 2012, 01:50:58 am »

I'm using a workaround to allow custom donation amounts. I have the price for the product set to $1, then the user will fill in their desired amount via the quantity box. So if they enter 20, the total price for their donation will be $20.

This works find, except in the Cart module, it still says:
20 x Donation

I've already found a way to change the quantity to 1 based on the product ID, but I need to be able to do it by the product's category ID or alias, in case the client adds future donation products. Otherwise, someone will have to add those IDs to the templates.

I figured out a way to get the category ID, but it only works if you're currently on that category page:
Code: [Select]
$virtuemart_category_id = JRequest::getInt('virtuemart_category_id');
if ($virtuemart_category_id == '10' ) {...

Anyone know how I can call the category ID based on the product's category?