$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[(int)$_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 ) { $coatings[$i]['materials']=$_POST['p3dlite_coating_materials'][$i]; } } update_option( 'p3dlite_coatings', $coatings ); } if ( isset( $_POST['p3dlite_settings'] ) && !empty( $_POST['p3dlite_settings'] ) ) { update_option( 'p3dlite_settings', array_map('sanitize_text_field', $_POST['p3dlite_settings'] )); } if ( isset( $_POST['p3dlite_buynow'] ) && count( $_POST['p3dlite_buynow'] )>0 ) { $settings=get_option( 'p3dlite_settings' ); foreach ( $_POST['p3dlite_buynow'] as $key=>$price ) { list ( $post_id, $printer_id, $material_id, $coating_id, $base64_filename ) = explode( '_', $key ); $price_requests=get_option( 'p3dlite_price_requests' ); if (!is_numeric($post_id)) { //new way $price_request=$price_requests[$key]; $post_id = $price_request['product_id']; $printer_id = $price_request['printer_id']; $material_id = $price_request['material_id']; $coating_id = $price_request['coating_id']; $filename = base64_decode($price_request['base64_filename']); #print_r($price_requests[$product_key]); #echo "$product_id, $printer_id, $material_id, $coating_id, $infill, $unit, $scale, $email_address, $filename";exit; } else { $filename=base64_decode( $base64_filename ); } $comments = $_POST['p3d_comments'][$key]; 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' )." ".$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 ); } else { echo '

' . __('Could not email the quote(s)! Check if your wordpress site can send emails.' ,'3dprint-lite').'

'; } } }//if ( count( $price_requests ) ) }//foreach ( $_POST['p3dlite_buynow'] as $key=>$price ) do_action( 'p3dlite_after_send_quotes' ); }//if ( isset( $_POST['p3dlite_buynow'] ) && count( $_POST['p3dlite_buynow'] )>0 ) # p3dlite_check_install(); $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' ); if (count($printers)==0) { $default_printers[]=array( 'name' => 'Default Printer', 'width' => '300', 'length' => '400', 'height' => '300', 'platform_shape' => 'rectangle', 'diameter' => '100', 'full_color' => '1', 'min_side' => '1', 'price' => '0.02', 'shininess' => 'plastic', 'transparency' => 'opaque', 'glow' => '0', 'materials' => array(0,1), 'price_type' => 'box_volume' ); update_option( 'p3dlite_printers', $default_printers ); $printers=get_option( 'p3dlite_printers' ); } if (count($materials)==0) { $default_materials[]=array( 'name' => 'PLA (1.75 mm) Green', 'type' => 'filament', 'density' => '1.26', 'length' => '330', 'diameter' => '1.75', 'weight' => '1', 'price' => '0.03', 'price_type' => 'gram', 'roll_price' => '20', 'color' => '#08c101' ); update_option( 'p3dlite_materials', $default_materials ); $materials=get_option( 'p3dlite_materials' ); } add_thickbox(); ?>


px × px
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

Premium version', '3dprint-lite'); ?>

this video you can see how to configure NinjaForms integration.', '3dprint-lite' );?>

 
 


 

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

> > >

ID #$i";?>
 

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

 '.$material['name'];?>

ID #$i";?>
 


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

 '.$coating['name'];?>

ID #$i";?>
 

0 ) { ?> $price_request ) { list ( $post_id, $printer_id, $material_id, $coating_id, $unit, $scale, $email_address, $base64_filename ) = explode( '_', $product_key ); if (!is_numeric($post_id)) { //new way $post_id = $price_request['product_id']; $printer = $price_request['printer']; $material = $price_request['material']; $coating = $price_request['coating']; $infill = $price_request['infill']; $unit = $price_request['unit']; $scale = $price_request['scale']; $email_address = $price_request['email']; $filename = base64_decode($price_request['base64_filename']); #print_r($price_requests[$product_key]); #echo "$product_id, $printer_id, $material_id, $coating_id, $infill, $unit, $scale, $email_address, $filename";exit; } else { $filename=base64_decode( $base64_filename ); } $upload_dir = wp_upload_dir(); 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' ) { $upload_dir = wp_upload_dir(); $filepath = $upload_dir['basedir']."/p3d/$attr_value"; $original_file = p3dlite_get_original($attr_value); $link = $upload_dir['baseurl'].'/p3d/'.rawurlencode( p3dlite_basename( $attr_value ) ); if (file_exists($original_file) && p3dlite_basename($filepath) != p3dlite_basename($original_file)) { $original_link = $upload_dir['baseurl'] ."/p3d/". rawurlencode(p3dlite_basename($original_file)) ; $attr_st.=__( "Model" , '3dprint-lite' )." : ".p3dlite_basename( $attr_value )."
"; $attr_st.=__( 'Original file', '3dprint-lite' ).' : '.urldecode(urldecode(p3dlite_basename($original_file))).'
'; } else { $attr_st.=__( "Model" , '3dprint-lite' )." : ".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
"; } } $attr_st.= __('Resize Scale', '3dprint-lite')." : ".$price_request['resize_scale']."
"; $attr_st.= __('Dimensions', '3dprint-lite')." : ".$price_request['scale_x']." × ".$price_request['scale_y']." × ".$price_request['scale_z']." ".__('cm', '3dprint-lite')."
"; if (isset($price_request['estimated_price'])) { $attr_st.= __('Estimated Price', '3dprint-lite')." : ".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'].'

Premium version', '3dprint-lite'); ?>