Jump to content

[Solved] html newsletter automatically generated based on product ID´s


justouletdk

Recommended Posts

Use the following:

echo Product::getPriceStatic($id_product, true);



Set the first parameter to ID of the product you want the price for and the second parameter to whether you want tax to be included. There are many more parameters, but those two are the important ones.

Link to comment
Share on other sites

Solved this by using a piece of the code form xmlexport script which can be found here

foreach ($products as $product) {
if($product['id_product']==3135){
 $prodObj = new Product($product['id_product'], false, $id_lang);
 $product['url'] = $link->getProductLink($prodObj);
 $cover = Product::getCover($product['id_product']);
 $product['imageUrl'] = _PS_BASE_URL_.$link->getImageLink($prodObj->link_rewrite, $product['id_product'].'-'.$cover['id_image'], 'large');

 $product['price_inc'] = ($product['price'] * (1 + $product['tax_rate'] / 100)) - $product['reduction_price']; 
 $product['price_for'] = ($product['price'] * (1 + $product['tax_rate'] / 100)); 
 $product['description_short'] = my_strip_tags($product['description_short']);
echo $product['url'];
echo $product['imageUrl'];
echo $product['price_for'];
echo $product['price_inc'];
}

}



where 3135 is where the id of the product should be. ['price_for'] stands for price without discount. There was probably a 1000 times easier way to do this:) ?

Link to comment
Share on other sites

  • 1 year later...

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...