Post by topy » Thu Jan 14, 2016 1:38 pm

Hello,

Can anyone give me a solution to add $stock variable on latest module? I want to display total numbers stock in home page.

Thank you !

Active Member

Posts

Joined
Mon Jun 20, 2011 2:52 pm

Post by grgr » Thu Jan 14, 2016 4:25 pm

Add quantity to ../catalog/controller/module/latest.php:

Code: Select all

				$data['products'][] = array(
					'product_id'  => $result['product_id'],
					'thumb'       => $image,
					'name'        => $result['name'],
					'description' =>
 								utf8_substr(strip_tags(html_entity_decode($result['description'],
								ENT_QUOTES, 'UTF-8')), 0, 
								$this->config->get('config_product_description_length')) . '..',
					'price'       => $price,
					'special'     => $special,
					'tax'         => $tax,
		'quantity'	=> $result['quantity'],
					'rating'      => $rating,
					'href'        => $this->url->link('product/product', 'product_id=' . $result['product_id']),
				);

Then in the template add this line wherever you want it:

Code: Select all

        <p>Quantity: <?php echo $product['quantity']; ?></p>

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by topy » Fri Jan 15, 2016 2:12 am

Thank you very much !!!!!!!

Active Member

Posts

Joined
Mon Jun 20, 2011 2:52 pm
Who is online

Users browsing this forum: No registered users and 3 guests