Product Information in Prestashop

£可爱£侵袭症+ 提交于 2019-12-14 02:55:28

问题


Does anyone know how to get the product information by product ID and show the correct price in prestashop? I have tried a custom SQL query and I can get the product information, however I can't seem to show the correct price since Prestashop stores different price scenarios in separate tables. ex. ps_product, ps_specific_price, ps_attribute_impact


回答1:


you can use the prestashop class.

$product = new Product($id_product,false,$lang_id);

now you will have all details in $product variable. if you want to take any variable you take like this.

$name = $product->name;

it is for prestashop 1.5x




回答2:


I figured out the looping problem. I had to create an array to store all the information in. It ended up working like this

$products = array();
foreach($productIDs as $productID) {
$products[$productID['id_product']] = new Product($productID['id_product'], false, '1');
}


来源:https://stackoverflow.com/questions/20004378/product-information-in-prestashop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!