Jump to content

Edit History

Moncef Grey

Moncef Grey

I added p.`condition` at the end to sql query in getProducts method like this: 

$sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, cp.`id_customization`, pl.`name`, p.`is_virtual`,
                        pl.`description_short`, pl.`available_now`, pl.`available_later`, product_shop.`id_category_default`, p.`id_supplier`,
                        p.`id_manufacturer`, m.`name` AS manufacturer_name, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`,
                        product_shop.`available_for_order`, product_shop.`show_price`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`,
                        stock.`quantity` AS quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, p.`weight`,
                        p.`available_date`, p.`date_add`, p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category,
                        CONCAT(LPAD(cp.`id_product`, 10, 0), LPAD(IFNULL(cp.`id_product_attribute`, 0), 10, 0), IFNULL(cp.`id_address_delivery`, 0), IFNULL(cp.`id_customization`, 0)) AS unique_id, cp.id_address_delivery,
                        product_shop.advanced_stock_management, ps.product_supplier_reference supplier_reference, p.`condition`');

 

Yet when i run this code in cart-detailed-product-line.tpl file, nothing shows in the console, even i added the condition ( New ) to all the products in the cart from the BO!
 

<script>
  console.log('{$product.condition.label}');
</script>

 

Moncef Grey

Moncef Grey

6 hours ago, WebSoft said:

./classes/Cart.php

Add p.`condition` to sql query.

Thanks for your reply,

Sorry I'm still a beginner in PrestaShop and Php as well, can you please explain more?

 

Thanks

×
×
  • Create New...