Commit 0f9655fd authored by imac's avatar imac

[Bugfix]Fiche technique

parent 6d84938d
...@@ -18,8 +18,10 @@ $fiche_num = str_pad($nb_fiche, 6, "0", STR_PAD_LEFT); ...@@ -18,8 +18,10 @@ $fiche_num = str_pad($nb_fiche, 6, "0", STR_PAD_LEFT);
$product_id = $_GET['product_id']; $product_id = $_GET['product_id'];
$variation_id = $_GET['variation_id']; $variation_id = $_GET['variation_id'];
$file_title = ""; $file_title = "";
$product_cats = wp_get_post_terms($product_id, 'product_cat'); $parent_cat = wp_get_post_terms($product_id, 'product_cat', array( 'parent' => 0,'fields' => 'ids' ));
$file_title.=$product_cats[1]->name; $sub_cat = wp_get_post_terms($product_id, 'product_cat', array( 'parent' =>$parent_cat[0],'fields' => 'names' ));
$file_title.=$sub_cat[0];
//fiche variable //fiche variable
if($variation_id !='undefined'){ if($variation_id !='undefined'){
...@@ -284,8 +286,8 @@ $file_content = "<html> ...@@ -284,8 +286,8 @@ $file_content = "<html>
<th>l (cm)</th> <th>l (cm)</th>
<th>H (cm)</th> <th>H (cm)</th>
<th>Volume (cm3)</th> <th>Volume (cm3)</th>
<th>Poids net (g)</th> <th>Poids net (Kg)</th>
<th>Poids brut (g)</th> <th>Poids brut (Kg)</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -319,7 +321,7 @@ $file_content = "<html> ...@@ -319,7 +321,7 @@ $file_content = "<html>
<th>l (cm)</th> <th>l (cm)</th>
<th>H (cm)</th> <th>H (cm)</th>
<th>Volume (cm3)</th> <th>Volume (cm3)</th>
<th>Poids brut (g)</th> <th>Poids brut (Kg)</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -363,6 +365,6 @@ $mpdf=new mPDF('utf-8', 'Letter', 0, '', 0, 0, 20, 20, 0, 0); ...@@ -363,6 +365,6 @@ $mpdf=new mPDF('utf-8', 'Letter', 0, '', 0, 0, 20, 20, 0, 0);
$mpdf->WriteHTML($file_content); $mpdf->WriteHTML($file_content);
$mpdf->Output('fiches-techniques/fiche-'.$fiche_num.'.pdf'); $mpdf->Output('fiches-techniques/fiche-'.$fiche_num.'.pdf');
$pdf ='/nap/fiches-techniques/fiche-'.$fiche_num.'.pdf'; $pdf ='/fiches-techniques/fiche-'.$fiche_num.'.pdf';
header('Location:'.$pdf ); header('Location:'.$pdf );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment