Jump to content

How can i get the Sale Price in my module


langziyang

Recommended Posts

i have mymodule hook on displayProductButtons. like this:

post-620354-0-57998800-1392702292_thumb.png

 

mymodule.php is:

public function hookdisplayProductButtons($params) {
        $this->context->smarty->assign(array(
            'my_module_price' =>what is code??????????????????
        ));
        return $this->display(__FILE__, 'mymodule.tpl');
    }

i find ProductCore::getPriceStatic($_GET('id_product')) Method。can get the price(like 17.00),but when i add the specific price. the Method always get the 17.00.

now i want get the sale price on hookdisplayProductButtons().how can use the Core Method?

 

and where i can  find the Method is Guide?

Link to comment
Share on other sites

i have mymodule hook on displayProductButtons. like this:

attachicon.gif3.png

 

mymodule.php is:

public function hookdisplayProductButtons($params) {
        $this->context->smarty->assign(array(
            'my_module_price' =>what is code??????????????????
        ));
        return $this->display(__FILE__, 'mymodule.tpl');
    }

i find ProductCore::getPriceStatic($_GET('id_product')) Method。can get the price(like 17.00),but when i add the specific price. the Method always get the 17.00.

now i want get the sale price on hookdisplayProductButtons().how can use the Core Method?

 

and where i can  find the Method is Guide?

Here is complete code.

public function hookdisplayProductButtons($params) {
	// Added By divyeshp - Starts
	$id_product = Tools::getValue('id_product');
	$product = new Product($id_product);
	$price = Tools::ps_round($product->getPrice(true), 2);
	// Added By divyeshp - Ends	
	$this->context->smarty->assign(array(
	    'my_module_price' => $price,
	));
	return $this->display(__FILE__, 'mymodule.tpl');
}
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...