code php number quantity product

  • Posts: 9
  • Thank you received: 0
9 years 4 months ago #226645

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.8

Good morning, a cordial greeting to the staff and to all of the forums,
Who would know tell me what I have to write php code to get the amount in the number of a product? I would write it to return the quantity remaining for a product on articles or modules joomla.

example: Number of tickets remaining: 35

Thank you in advance and I hope someone can help me
thank you

Last edit: 9 years 4 months ago by handlyweb.

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
9 years 4 months ago #226675

$product_id = 10;
if(!defined('DS'))
	define('DS',DIRECTORY_SEPARATOR);
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
			return true;
$class = hikashop_get('class.product');
$product = $class->get($product_id);
echo $product->product_quantity;

The following user(s) said Thank You: handlyweb

Please Log in or Create an account to join the conversation.

Time to create page: 0.153 seconds
Powered by Kunena Forum