cart_contents as $cart_item_key => $cart_item ) {
if ( $cart_item['variation_id'] ) {
$variation_id = $cart_item['variation_id'];
} else {
$variation_id = $cart_item['product_id'];
}
if ( isset( $cart_item["asowp_meta_data"]) ) {
if ( isset( $cart_item['asowp_meta_data']["recaps"]['custom_price'] ) ) {
$item_price = apply_filters( 'asowp_cart_item_price', $cart_item['asowp_meta_data']["recaps"]['custom_price'], $variation_id );
$cart_item['data']->set_price( $item_price );
}
}
// Ajout d'un filtre pour mettre à jour le prix total de l'element dans le panier.
}
}
/**
*
*/
public function asowp_change_product_image_in_cart( $product_image_code, $values) {
if ( isset( $values['asowp_meta_data']["recaps"] ) ) {
$previews = $values['asowp_meta_data']["recaps"]["designImages"];
if(isset($previews["face1"])){
$product_image_code = "";
}else{
$product_image_code = "
";
}
return $product_image_code;
}
}
public function display_previewBtn_editBtn_in_cart($cart_item){
$product = $cart_item['data'];
$have_pages_settings = get_option("asowp_config_page");
// Construisez les URL pour les aperçus et les éditions (ajustez selon vos besoins)
//$preview_url = get_permalink($product->get_id());
//$preview_data = get_transient( 'preview_' . $product->get_id() );
//$npd_product = new asowp_Product_Config( $product->get_id() );
if(isset($cart_item['asowp_meta_data']["recaps"])){
$product_name = '';
$modal_id = uniqid('asowp-recaps');
ob_start();
?>