$printer) { if (count($printer['materials'])) { foreach ($printer['materials'] as $material_key => $material_id) { if ($_POST['material_id']==$material_id) unset ( $printers_array[$printer_key]['materials'][$material_key] ); } } } update_option( 'p3dlite_printers', $printers_array ); } if ( isset( $_POST['action'] ) && $_POST['action']=='remove_coating' ) { $coatings_array = get_option( 'p3dlite_coatings' ); unset( $coatings_array[$_POST['coating_id']] ); $coatings_array=array_values( $coatings_array ); update_option( 'p3dlite_coatings', $coatings_array ); } if ( isset( $_POST['action'] ) && $_POST['action']=='remove_request' ) { $price_requests=get_option( 'p3dlite_price_requests' ); unset( $price_requests[$_POST['request_id']] ); update_option( 'p3dlite_price_requests', $price_requests ); } if ( isset( $_POST['p3dlite_printer_name'] ) && count( $_POST['p3dlite_printer_name'] )>0 ) { for ( $i=0;$i0 ) { $printers[$i]['materials']=$_POST['p3dlite_printer_materials'][$i]; } } update_option( 'p3dlite_printers', $printers ); } if ( isset( $_POST['p3dlite_material_name'] ) && count( $_POST['p3dlite_material_name'] )>0 ) { for ( $i=0;$i0 ) { for ( $i=0;$i0 ) { $settings=get_option( 'p3dlite_settings' ); foreach ( $_POST['p3d_buynow'] as $key=>$price ) { list ( $post_id, $printer_id, $material_id, $coating_id, $base64_filename ) = explode( '_', $key ); $filename=base64_decode( $base64_filename ); $price_requests=get_option( 'p3dlite_price_requests' ); if ( count( $price_requests ) ) { $email=$price_requests[$key]['email']; $variation=$price_requests[$key]['attributes']; if ( $price ) { $price_requests[$key]['price']=$price; $db_printers=get_option( 'p3dlite_printers' ); $db_materials=get_option( 'p3dlite_materials' ); $db_coatings=get_option( 'p3dlite_coatings' ); $upload_dir = wp_upload_dir(); $link = $upload_dir['baseurl'].'/p3d/'.urlencode($filename); $subject=__( "Your model's price" , '3dprint-lite' ); $message=""; $message.=__( "Printer:" , '3dprint-lite' )." ".__($db_printers[$printer_id]['name'], '3dprint-lite')."
"; $message.=__( "Material:" , '3dprint-lite' )." ".__($db_materials[$material_id]['name'], '3dprint-lite')."
"; $message.=__( "Coating:" , '3dprint-lite' )." ".__($db_coatings[$coating_id]['name'], '3dprint-lite')."
"; $message.=__( "Model:" , '3dprint-lite' )." ".$filename."
"; foreach ( $variation as $key => $value ) { if ( strpos( $key, 'attribute_' )===0 ) { $attribute_name=str_replace( 'attribute_', '', $key ); $attribute_name=strtoupper( str_replace( '_', ' ', $key ) ); if ( !strstr( $key, 'p3dlite_' ) ) $message.=$attribute_name.": $value
"; } } $message.=''.__( "Price:" , '3dprint-lite' )." ".p3dlite_format_price($price, $settings['currency'], $settings['currency_position'])."
"; $message.=''.__( "Comments:" , '3dprint-lite' )." ".$_POST['p3d_comments']."
"; do_action( 'p3dlite_send_quote', $message ); $headers = array( 'Content-Type: text/html; charset=UTF-8' ); if (wp_mail( $email, $subject, $message, $headers )) { update_option( 'p3dlite_price_requests', $price_requests ); }//todo: else show error } }//if ( count( $price_requests ) ) }//foreach ( $_POST['p3d_buynow'] as $key=>$price ) do_action( 'p3dlite_after_send_quotes' ); }//if ( isset( $_POST['p3d_buynow'] ) && count( $_POST['p3d_buynow'] )>0 ) $printers=get_option( 'p3dlite_printers' ); $materials=get_option( 'p3dlite_materials' ); $coatings=get_option( 'p3dlite_coatings' ); $settings=get_option( 'p3dlite_settings' ); $price_requests=get_option( 'p3dlite_price_requests' ); ?>


px × px
°
°
°
>
>
>
>
>


0 ) { $i=0; foreach ( $printers as $printer ) { ?>

ID #$i";?>
  <?php _e( 'Remove Printer', '3dprint-lite' );?>


0 ) { $i=0; foreach ( $materials as $material ) { ?>

ID #$i";?>
  <?php _e( 'Remove Material', '3dprint-lite' );?>


0 ) { $i=0; foreach ( $coatings as $coating ) { ?>

ID #$i";?>
  <?php _e( 'Remove Coating', '3dprint-lite' );?>

0 ) { ?> $price_request ) { list ( $post_id, $printer_id, $material_id, $coating_id, $base64_filename ) = explode( '_', $product_key ); $upload_dir = wp_upload_dir(); $filename=base64_decode( $base64_filename ); if ( $price_request['price']=='' ) { $attr_st=''; foreach ( $price_request['attributes'] as $attr_key => $attr_value ) { if ( $attr_key=='attribute_pa_p3dlite_printer' ) { $attr_st.=__( "Printer" , '3dprint-lite' ).": ".$price_request['printer']."
"; } elseif ( $attr_key=='attribute_pa_p3dlite_material' ) { $attr_st.=__( "Material" , '3dprint-lite' ).": ".$price_request['material']."
"; } elseif ( $attr_key=='attribute_pa_p3dlite_coating' ) { $attr_st.=__( "Coating" , '3dprint-lite' )." : ".$price_request['coating']."
"; } elseif ( $attr_key=='attribute_pa_p3dlite_model' ) { $link = $upload_dir['baseurl'].'/p3d/'.urlencode( p3dlite_basename( $attr_value ) ); if (file_exists($upload_dir['basedir']."/p3d/$attr_value.zip")) { $link="$link.zip"; $attr_value="$attr_value.zip"; } $attr_st.=__( "Model" , '3dprint-lite' ).": ".p3dlite_basename( $attr_value )."
"; } elseif ( $attr_key=='attribute_pa_p3dlite_unit' ) { $attr_st.=__( "Unit" , '3dprint-lite' ).": ".__( $attr_value )."
"; } else { //$product_attributes=( $product->get_attributes() ); $attribute_name=str_replace( 'attribute_', '', $attr_key ); $attribute_name=strtoupper( str_replace( '_', ' ', $attr_key ) ); $attr_st.=$attribute_name .": $attr_value
"; } } if (isset($price_request['estimated_price'])) { $attr_st.= __('Estimated Price:')." ".p3dlite_format_price($price_request['estimated_price'], $settings['currency'], $settings['currency_position'])."
"; } echo ' '; } } ?>
X
'.__( 'Remove Request', '3dprint-lite' ).' '.get_permalink( $post_id ).' '.__( 'Email:', '3dprint-lite' ).' '.$price_request['email'].'
'.__( 'Comment:', '3dprint-lite' ).' '.$price_request['request_comment'].'
'.$attr_st.' * '.$settings['currency'].'