'.__( 'Please upload your model and select all options.' , '3dprint-lite' ).''; } if ( empty( $email_address ) ) { $error=true; $p3dlite_email_status_message=''.__( 'Please enter valid email address.' , '3dprint-lite' ).''; } if ( !$error ) { $product_key=$product_id.'_'.$printer_id.'_'.$material_id.'_'.$coating_id.'_'.$unit.'_'.$scale.'_'.$email_address.'_'.base64_encode( p3dlite_basename( $model_file ) ); $p3dlite_price_requests=(array)get_option( 'p3dlite_price_requests' ); $p3dlite_price_requests[$product_key]['printer'] = $db_printers[$printer_id]['name']; $p3dlite_price_requests[$product_key]['material'] = $db_materials[$material_id]['name']; $p3dlite_price_requests[$product_key]['coating'] = $db_coatings[$coating_id]['name']; foreach ( $_POST as $key => $value ) { if ( strpos( $key, 'attribute_' )===0 ) { if ( !strstr( $key, 'p3dlite_' ) ) $email_attrs[$key]=$value; $p3dlite_price_requests[$product_key]['attributes'][$key]=$value; } } $p3dlite_price_requests[$product_key]['price']=''; $p3dlite_price_requests[$product_key]['estimated_price']=(float)$_POST['p3dlite_estimated_price']; $p3dlite_price_requests[$product_key]['resize_scale']=(float)$_POST['p3dlite_resize_scale']; $p3dlite_price_requests[$product_key]['scale_x']=(float)$_POST['p3dlite_scale_x']; $p3dlite_price_requests[$product_key]['scale_y']=(float)$_POST['p3dlite_scale_y']; $p3dlite_price_requests[$product_key]['scale_z']=(float)$_POST['p3dlite_scale_z']; $p3dlite_price_requests[$product_key]['email']=$email_address; $p3dlite_price_requests[$product_key]['request_comment']=$request_comment; update_option( "p3dlite_price_requests", $p3dlite_price_requests ); // $request_comment $upload_dir = wp_upload_dir(); $filepath = $upload_dir['basedir']."/p3d/$model_file"; $original_file = p3dlite_get_original($model_file); $link = $upload_dir['baseurl'].'/p3d/'.rawurlencode( p3dlite_basename( $model_file ) ); //todo: email template $subject=__( "Price enquiry from $email_address" , '3dprint-lite' ); $message=__( "E-mail" , '3dprint-lite' ) ." : $email_address
"; $message.=__( "Product ID" , '3dprint-lite' )." : $product_id
"; $message.=__( "Printer" , '3dprint-lite' )." : ".$db_printers[$printer_id]['name']."
"; $message.=__( "Material" , '3dprint-lite' )." : ".$db_materials[$material_id]['name']."
"; $message.=__( "Coating" , '3dprint-lite' )." : ".$db_coatings[$coating_id]['name']."
"; // $message.=__( "Model:" , '3dprint-lite' )." ".$model_file."
"; if (file_exists($original_file) && p3dlite_basename($filepath) != p3dlite_basename($original_file)) { $original_link = $upload_dir['baseurl'] ."/p3d/". rawurlencode(p3dlite_basename($original_file)) ; $message.=__( "Model" , '3dprint-lite' )." : ".$model_file."
"; $message.=__( 'Original file', '3dprint' ).' : '.urldecode(urldecode(p3dlite_basename($original_file))).'
'; } else { $message.=__( "Model" , '3dprint' )." : ".p3dlite_basename( $model_file )."
"; } $message.= __('Dimensions', '3dprint-lite')." : ".(float)$_POST['p3dlite_scale_x']." × ".(float)$_POST['p3dlite_scale_y']." × ".(float)$_POST['p3dlite_scale_z']." ".__('cm', '3dprint-lite')."
"; $message.= __('Resize Scale', '3dprint-lite')." : ".(float)$_POST['p3dlite_resize_scale']."
"; $message.=__( "Estimated Price" , '3dprint-lite' )." : ".p3dlite_format_price($p3dlite_price_requests[$product_key]['estimated_price'], $settings['currency'], $settings['currency_position']).'
'; if ( isset( $email_attrs ) && count( $email_attrs ) ) { foreach ( $email_attrs as $key=>$value ) { $message.="$key: $value
"; } } $message.=__( "Comments" , '3dprint-lite' ) ." : $request_comment
"; $message.=__( "Manage Price Requests" , '3dprint-lite' )." : ".admin_url( 'admin.php?page=3dprint-lite#p3dlite_tabs-4' )."
"; $headers = array( 'Content-Type: text/html; charset=UTF-8' ); if ( wp_mail( $settings['email_address'], $subject, $message, $headers ) ) $p3dlite_email_status_message=''.__( 'Store owner has been notified about your request. You\'ll receive the email with the price shortly.' , '3dprint-lite' ).''; else $p3dlite_email_status_message=''.__( 'Could not send the email. Please try again later.' , '3dprint-lite' ).''; p3dlite_clear_cookies(); do_action( 'p3dlite_request_price' ); } } } add_shortcode( '3dprint-lite', 'p3d_lite' ); function p3d_lite( $atts ) { global $p3dlite_email_status_message, $post; $db_printers=get_option( 'p3dlite_printers' ); $db_materials=get_option( 'p3dlite_materials' ); $db_coatings=get_option( 'p3dlite_coatings' ); $settings=get_option( 'p3dlite_settings' ); ob_start(); ?>
Loading file

Upload

 

 

 

 


     
%
 
× ×  

	
:
:
:
:
: x x

'.__( 'Estimated Price:', '3dprint-lite' ).'';?>

Loading price
'.$p3dlite_email_status_message.'
'; ?>

$material) { # if (!in_array($key, $assigned_materials)) unset($db_materials[$key]); #} switch ($settings['materials_layout']) { case 'lists': include('templates/template_material_list.php'); break; case 'dropdowns': include('templates/template_material_dropdown.php'); break; case 'colors': include('templates/template_material_colors.php'); break; default: include('templates/template_material_list.php'); break; } switch ($settings['coatings_layout']) { case 'lists': include('templates/template_coating_list.php'); break; case 'dropdowns': include('templates/template_coating_dropdown.php'); break; case 'colors': include('templates/template_coating_colors.php'); break; default: include('templates/template_coating_list.php'); break; } switch ($settings['printers_layout']) { case 'lists': include('templates/template_printer_list.php'); break; case 'dropdowns': include('templates/template_printer_dropdown.php'); break; default: include('templates/template_printer_list.php'); break; } ?>