T-Shirt (We’ll Design)
- Description
- Additional information
- Reviews (0)
//all designs for the product designer var fpdProductsJSON = [[{"productTitle":"Shirt","productThumbnail":"http://artaray.com/wp-content/uploads/2018/03/over_shadow1.png","title":"Front","thumbnail":"http://artaray.com/wp-content/uploads/2018/03/base41.png","options":{"stageWidth":1200,"customAdds":{"uploads":true,"texts":true,"designs":true}},"elements":[{"type":"image","title":"Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/Shadow3.png","parameters":{"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":true,"boundingBoxMode":"clipping","customAdds":[]}},{"type":"image","title":"Shirt","source":"http://artaray.com/wp-content/uploads/2018/03/Shirt2.png","parameters":{"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","colors":"#ffffff,#ffcdcd,#e9e9e9,#dbdbdb,#12a244,#50275a,#24b1d9,#ff6190,#2374ae,#0ab791,#52c4e0,#5a5a5a,#575c3e,#fac638,#415161,#7d1c50,#991b29,#a5ed5f,#b81527,#ff6733,#eb72b3,#ec1450,#0d2a5d,#272c40,#47362b,#000000","colorLinkGroup":"base; price","fill":"#ffffff","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":false,"boundingBoxMode":"inside","customAdds":[]}},{"type":"image","title":"Design","source":"http://artaray.com/wp-content/uploads/2017/01/88-x-58mm.png","parameters":{"uploadZone":0,"left":613,"top":320,"scaleX":1.12,"scaleY":2.42,"degree":0,"price":0,"replace":"design","originX":"center","originY":"center","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":true,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":false,"boundingBoxMode":"inside","customAdds":[],"boundingBox":{"x":460,"y":120,"width":300,"height":400}}},{"type":"image","title":"Your Design","source":"http://artaray.com/wp-content/uploads/2017/01/88-x-58mm.png","parameters":{"uploadZone":1,"left":614,"top":321,"scaleX":1.05,"scaleY":2.4,"price":0,"originX":"center","originY":"center","opacity":0.42,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":true,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":false,"scaleMode":"fit","customAdds":{"uploads":true,"texts":true,"designs":true}}},{"type":"image","title":"Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/Shadow4.png","parameters":{"uploadZone":0,"left":599,"top":301,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","colorLinkGroup":"price","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":true,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":true,"boundingBoxMode":"inside","customAdds":[]}}]},{"title":"Back","thumbnail":"http://artaray.com/wp-content/uploads/2018/03/base61.png","options":{"stageWidth":1200,"customAdds":{"uploads":true,"texts":true,"designs":true}},"elements":[{"type":"image","title":"Back Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/shadows2.png","parameters":{"locked":false,"uploadZone":0,"left":600,"top":316,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","customAdds":[]}},{"type":"image","title":"Shirt","source":"http://artaray.com/wp-content/uploads/2018/03/base6.png","parameters":{"locked":false,"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"price":0,"originX":"center","originY":"center","colors":"Shirt","colorLinkGroup":"base","opacity":1,"removable":true,"draggable":true,"rotatable":true,"resizable":true,"zChangeable":true,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","customAdds":[]}},{"type":"image","title":"Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/over_shadow1.png","parameters":{"locked":false,"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":true,"autoSelect":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","customAdds":[]}}]}],[{"productTitle":"Design One","productThumbnail":"http://artaray.com/wp-content/uploads/2018/03/over_shadow1.png","title":"Front","thumbnail":"http://artaray.com/wp-content/uploads/2018/03/base41.png","options":{"stageWidth":1200,"customAdds":{"uploads":true,"texts":true,"designs":true}},"elements":[{"type":"image","title":"Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/Shadow3.png","parameters":{"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":true,"boundingBoxMode":"clipping","customAdds":[]}},{"type":"image","title":"Shirt","source":"http://artaray.com/wp-content/uploads/2018/03/Shirt2.png","parameters":{"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","colors":"#ffffff,#ffcdcd,#e9e9e9,#dbdbdb,#12a244,#50275a,#24b1d9,#ff6190,#2374ae,#0ab791,#52c4e0,#5a5a5a,#575c3e,#fac638,#415161,#7d1c50,#991b29,#a5ed5f,#b81527,#ff6733,#eb72b3,#ec1450,#0d2a5d,#272c40,#47362b,#000000","colorLinkGroup":"base; price","fill":"#ffffff","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":false,"boundingBoxMode":"inside","customAdds":[]}},{"type":"image","title":"Design Brief","source":"http://artaray.com/wp-content/uploads/2017/04/IMAG4926.jpg","parameters":{"uploadZone":1,"left":607,"top":317,"scaleX":0.14,"scaleY":0.11,"price":45,"originX":"center","originY":"center","draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":false,"scaleMode":"fit","customAdds":{"uploads":true,"texts":false,"designs":false}}},{"type":"text","title":"Step 1: Choose your tee colour.Step 2: Be creative.This is your space!Click here to upload a brief of your amazing design at the panel on rightWe'll do the rest. ","source":"Step 1: Choose your tee colour.\\nStep 2: Be creative.\\n\\nThis is your space!\\nClick here to upload a brief \\nof your amazing design \\nat the panel on right\\n\\nWe'll do the rest. ","parameters":{"uploadZone":0,"left":607,"top":322,"degree":356,"price":0,"originX":"center","originY":"center","fill":"#ffffff","opacity":1,"removable":true,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":true,"autoSelect":false,"excludeFromExport":false,"locked":true,"boundingBoxMode":"inside","fontSize":16,"minFontSize":1,"maxFontSize":1000,"widthFontSize":0,"lineHeight":1,"letterSpacing":0,"editable":true,"chargeAfterEditing":false,"fontWeight":"bold","fontStyle":"normal","textDecoration":"normal","textAlign":"center","maxLength":0,"maxLines":0,"strokeWidth":0,"curvable":false,"curved":false,"curveSpacing":10,"curveRadius":80,"curveReverse":false,"textBox":false,"customAdds":[],"boundingBox":"design"}},{"type":"image","title":"Design","source":"http://artaray.com/wp-content/uploads/2017/01/88-x-58mm.png","parameters":{"uploadZone":0,"left":608,"top":321,"scaleX":1.09,"scaleY":2.42,"degree":0,"price":75,"replace":"design","originX":"center","originY":"center","opacity":1,"removable":true,"draggable":true,"rotatable":true,"resizable":true,"zChangeable":true,"topped":false,"autoSelect":true,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":false,"boundingBoxMode":"inside","customAdds":[],"boundingBox":{"x":460,"y":120,"width":300,"height":400}}},{"type":"image","title":"Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/Shadow4.png","parameters":{"uploadZone":0,"left":599,"top":301,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","colorLinkGroup":"price","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":true,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"excludeFromExport":false,"advancedEditing":false,"locked":true,"boundingBoxMode":"inside","customAdds":[]}}]},{"title":"Back","thumbnail":"http://artaray.com/wp-content/uploads/2018/03/base61.png","options":{"stageWidth":1200,"customAdds":{"uploads":true,"texts":true,"designs":true}},"elements":[{"type":"image","title":"Back Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/shadows2.png","parameters":{"locked":false,"uploadZone":0,"left":600,"top":316,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","opacity":1,"removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","customAdds":[]}},{"type":"image","title":"Shirt","source":"http://artaray.com/wp-content/uploads/2018/03/base6.png","parameters":{"locked":false,"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"price":0,"originX":"center","originY":"center","colors":"Shirt","colorLinkGroup":"base","opacity":1,"removable":true,"draggable":true,"rotatable":true,"resizable":true,"zChangeable":true,"topped":false,"autoSelect":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","customAdds":[]}},{"type":"image","title":"Shadow","source":"http://artaray.com/wp-content/uploads/2018/03/over_shadow1.png","parameters":{"locked":false,"uploadZone":0,"left":600,"top":300,"scaleX":1,"scaleY":1,"degree":0,"originX":"center","originY":"center","removable":false,"draggable":false,"rotatable":false,"resizable":false,"zChangeable":false,"topped":true,"autoSelect":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","customAdds":[]}}]}]], fpdDesignsJSON = [{"title":"T-Shirts","thumbnail":"http://artaray.com/wp-content/uploads/2018/03/Shadow4.png","designs":[{"source":"http://artaray.com/wp-content/uploads/2017/01/heart_circle.png","title":"heart_circle","thumbnail":"http://artaray.com/wp-content/uploads/2017/01/heart_circle-300x300.png","parameters":{"left":0,"y":0,"z":-1,"minScaleLimit":"0.0100","colors":"black, blue, green, yellow, purple, jade, lime, ","price":15.99,"replaceInAllViews":false,"autoCenter":true,"draggable":true,"rotatable":true,"resizable":true,"zChangeable":true,"autoSelect":true,"topped":true,"uniScalingUnlockable":false,"boundingBoxMode":"none","removable":true,"advancedEditing":true,"excludeFromExport":false,"scaleX":1,"scaleY":1,"resizeToW":0,"resizeToH":0,"scaleMode":"fit"}}]}];
var fancyProductDesigner, $body, $selector, $productWrapper, $cartForm, $mainBarCon = null, $modalPrice = null, fpdProductCreated = false, fpdIsReady = false, adminAjaxURL = "http://artaray.com/wp-admin/admin-ajax.php";
jQuery(document).ready(function() {
//return;
$body = jQuery('body'); $selector = jQuery('#fancy-product-designer-603'); $productWrapper = jQuery('.post-603'); $cartForm = jQuery('[name="fpd_product"]:first').parents('form:first'); $mainBarCon = jQuery('.fpd-main-bar-position');
//merge image parameters with custom image parameters var customImageParams = jQuery.extend( {"left":0,"y":0,"z":-1,"minScaleLimit":"0.0100","price":0,"replaceInAllViews":false,"autoCenter":true,"draggable":true,"rotatable":true,"resizable":true,"zChangeable":true,"autoSelect":false,"topped":false,"uniScalingUnlockable":false,"boundingBoxMode":"inside","removable":true}, {"minW":100,"minH":100,"maxW":50000,"maxH":50000,"resizeToW":300,"resizeToH":300,"maxSize":10,"minDPI":72,"minScaleLimit":"0.0100","advancedEditing":true,"filter":"none"} );
var modalModeOpt = false; if(1) { modalModeOpt = '#fpd-start-customizing-button'; }
//get plugin options from UI Layout var uiLayoutOptions = {"stageWidth":890,"stageHeight":600,"gridColumns":"2","initialActiveModule":"products","selectedColor":"#f5f5f5","boundingBoxColor":"#005ede","outOfBoundaryColor":"#990000","cornerIconColor":"#000000","mainBarModules":["products","manage-layers","images","text","designs"],"actions":{"top":["info","load","save","guided-tour","qr-code"],"right":[],"bottom":["undo","reset-product","redo"],"left":[]},"toolbarPlacement":"inside-bottom"}, uiLayoutOptions = typeof uiLayoutOptions === 'object' ? uiLayoutOptions : {};
//call fancy product designer plugin
var pluginOptions = {
langJSON: {"toolbar":{"fill":"Fill","transform":"Transform","position":"Position","move_up":"Move Up","move_down":"Move Down","reset":"Reset","font_size":"Font Size","line_height":"Line Height","bold":"Bold","italic":"Italic","underline":"Underline","text_align":"Text Alignment","stroke":"Stroke","stroke_width":"Stroke Width","curved_text":"Curved Text","edit_text":"Edit Text","color":"Color","patterns":"Patterns","transparency":"Transparency","align_left":"Align Left","align_top":"Align Top","align_right":"Align Right","align_bottom":"Align Bottom","center_h":"Center Horizontal","center_v":"Center Vertical","flip_h":"Flip Horizontal","flip_v":"Flip Vertical","curved_text_switch":"Switch","curved_text_reverse":"Reverse","radius":"Radius","spacing":"Spacing","letter_spacing":"Letter Spacing","advanced_editing":"Advanced Editing","text_transform":"Text Transform","back":"Back"},"actions":{"reset_product":"Start Again","zoom":"Zoom","magnify_glass":"Magnify Glass","download":"Download","info":"Info","info_content":"* Finished artwork should use the full bleed dimensions for best results.
* Please be sure to keep all text within the safe margin.
Resolution
300 DPI","print":"Print","save":"Save","load":"Load","manage_layers":"Manage Layers","qr_code":"Add QR-Code","qr_code_input":"Enter a URL, some text...","qr_code_add_btn":"Add QR-Code","undo":"Undo","redo":"Redo","snap":"Center Snap","preview_lightbox":"Preview","save_placeholder":"Optional: Enter a title","ruler":"Toggle Ruler","previous_view":"Previous View","next_view":"Next View","start_guided_tour":"Start Guided Tour"},"modules":{"products":"Swap Product","images":"Add Image","upload_zone":"Click or drop your design\/images here","facebook_select_album":"Select An Album","text":"Add Text","text_input_placeholder":"Enter some text","text_add_btn":"Add Text","designs":"Choose From Designs","designs_search_in":"Search in","manage_layers":"Manage Layers","images_agreement":"I have the rights to use the images.","images_confirm_button":"Confirm","pixabay_search":"Search in Pixabay library","text_layers_clear":"Clear"},"image_editor":{"mask":"Mask","filters":"Filters","color_manipulation":"Color Manipulation","custom_cropping":"Custom Cropping","filter_none":"None","brightness":"Brightness","contrast":"Contrast","remove_white":"Remove White","remove_white_distance":"Distance","restore":"Restore Original","save":"Save"},"misc":{"initializing":"Initializing The Creative Designer","out_of_bounding_box":"Move element in its containment!","product_saved":"Product Saved!","loading_image":"Loading Image...","uploaded_image_size_alert":"Sorry! But the uploaded image size does not conform our indication of size.
Minimum Width: %minW pixels
Minimum Height: %minH pixels
Maximum Width: %maxW pixels
Maximum Height: %maxH pixels","modal_done":"- Finish and Pay -","minimum_dpi_info":"The JPEG image does not have the required DPI of %dpi.","maximum_size_info":"The image %filename exceeds the maximum file size of %mbMB.","customization_button":"Customize","shortcode_order:_success_sent":"The order has been successfully sent to the site owner!","shortcode_order:_fail_sent":"The order could not be sent. Please try again or contact the site owner!","not_supported_device_info":"Sorry! But the product designer can not be displayed on your device. Please use a device with a larger screen!","share:_button":"Share Design","share:_process":"An unique URL to share will be created for you...","share:_default_text":"Check out my design!","customization_required_info":"You need to customize the default design!","image_added":"Image Added!","reset_confirm":"Are you sure to reset everything?","popup_blocker_alert":"Please disable your pop-up blocker and try again.","shortcode_form:send":"Send","shortcode_form:name_placeholder":"Enter your name here","shortcode_form:email_placeholder":"Enter your email here","login_required_info":"You need to be logged in to upload images!","view_optional_unlock":"Unlock view","account_storage:login_required":"Please log into your account!","account_storage:products_loaded":"Saved Products Loaded.","guided_tour_back":"Back","guided_tour_next":"Next"},"plus":{"names_numbers":"Names & Numbers","names_numbers_add_new":"Add New","drawing":"Free Drawing","drawing_brush_type":"Brush Type","drawing_pencil":"Pencil","drawing_circle":"Circle","drawing_spray":"Spray","drawing_color":"Color","drawing_line_width":"Line Width","drawing_draw_here":"Draw Here","drawing_clear":"Clear","drawing_add":"Add","bulk_add_variations_title":"Bulk Order","bulk_add_variations_add":"Add","bulk_add_variations_term":"Please set all variations in the Bulk Order panel correctly!"},"woocommerce":{"catalog:_add_to_cart":"Customize","cart:_re-edit product":"Click here to re-edit","get_a_quote":"Get a quote","order:_email_view_customized_product":"View Customized Product","save_order":"Save Order","saving_order":"Saving Order","order_saved":"Order Saved","order_saving_failed":"Saving Order Failed. Please try again!","loading_product":"Loading product...","product_loading_fail":"Product could not be loaded. Please try again!"}},
fonts: [],
templatesDirectory: "http://artaray.com/wp-content/plugins/fancy-product-designer/assets/templates/",
facebookAppId: "",
instagramClientId: "",
instagramRedirectUri: "http://artaray.com/wp-content/plugins/fancy-product-designer/assets/templates/instagram_auth.php",
zoomStep: 0.2,
maxZoom: 5,
hexNames: {},
replaceInitialElements: 1,
lazyLoad: 0,
improvedResizeQuality: 0,
uploadZonesTopped: 1,
mainBarContainer: $mainBarCon.length ? $mainBarCon : false,
responsive: 1,
priceFormat: {
currency: "£%d",
},
modalMode: modalModeOpt,
templatesType: ['php', 'html'],
watermark: "http://artaray.com/wp-content/uploads/2016/11/ArtaRaytransparent-test-e1485930590248.png",
loadFirstProductInStage: 1,
unsavedProductAlert: 1,
hideDialogOnAdd: 1,
snapGridSize: [50, 50],
fitImagesInCanvas: 1,
inCanvasTextEditing: 1,
openTextInputOnSelect: 1,
saveActionBrowserStorage: 0,
uploadAgreementModal: 1,
autoOpenInfo: 1,
allowedImageTypes: ["jpeg","png","svg"],
replaceColorsInColorGroup: 0,
pixabayApiKey: "",
pixabayHighResImages: 0,
openModalInDesigner: 1,
imageSizeTooltip: 0,
applyFillWhenReplacing: 1,
highlightEditableObjects: "",
customImageAjaxSettings: {
url: "http://artaray.com/wp-content/plugins/fancy-product-designer/inc/custom-image-handler.php",
data: {
saveOnServer: 1,
uploadsDir: "/home/u992915892/public_html/wp-content/uploads/fancy_products_uploads/",
uploadsDirURL: "http://artaray.com/wp-content/uploads/fancy_products_uploads/"
}
},
elementParameters: {
originX: "center",
originY: "center",
},
imageParameters: {
padding: 0,
colorPrices: {},
replaceInAllViews: 0,
patterns: []
},
textParameters: {
padding: 10,
fontFamily: "Arial",
colorPrices: {},
replaceInAllViews: 0,
patterns: []
},
customImageParameters: customImageParams,
customTextParameters: {"left":0,"y":0,"z":-1,"colors":"#000000","price":0,"replaceInAllViews":false,"autoCenter":true,"draggable":true,"rotatable":true,"resizable":true,"zChangeable":true,"autoSelect":false,"topped":false,"curvable":true,"curveSpacing":10,"curveRadius":80,"curveReverse":true,"boundingBoxMode":"inside","fontSize":18,"minFontSize":1,"maxFontSize":1000,"maxLength":0,"maxLines":0,"textAlign":"left","removable":true},
fabricCanvasOptions: {
allowTouchScrolling: 1,
perPixelTargetFind: 1,
},
qrCodeProps: {
price: 0,
resizeToW: 0,
resizeToH: 0,
draggable: 0,
resizable: 0,
boundingBox: customImageParams.boundingBox,
boundingBoxMode: customImageParams.boundingBoxMode
},
boundingBoxProps: {
strokeWidth: 1 },
imageEditorSettings: {
masks: [] },
guidedTour: {
"module:products": "Select your product here",
"module:images": "Then if you have an image you can insert it here. Voila! ",
"module:text": "Anything you want, you can insert text here.",
"module:designs": "You can upload your png, jpeg, ai and psd design files here",
"module:manage-layers": "Use this section to select then edit the different layers of your design.",
"module:text-layers": "You can add more text layers",
"action:undo": "Undo your last acion",
"action:redo": "Redo your last action",
"action:guided-tour": "I'd be happy to show you around the basic controls of our designer. Just ask me :)"
} };
pluginOptions = jQuery.extend({}, pluginOptions, uiLayoutOptions);
var currencyPos = "left", currencySymbol = '£', currencyFormat; if(currencyPos == 'right') { currencyFormat = '%d' + currencySymbol; } else if(currencyPos == 'right_space') { currencyFormat = '%d' + ' ' + currencySymbol; } else if(currencyPos == 'left_space') { currencyFormat = currencySymbol + ' ' + '%d'; } else { currencyFormat = currencySymbol + '%d'; }
pluginOptions.priceFormat.currency = currencyFormat; pluginOptions.priceFormat.decimalSep = "."; pluginOptions.priceFormat.thousandSep = ","; fancyProductDesigner = new FancyProductDesigner($selector, pluginOptions);
//when load from cart or order, use loadProduct $selector .on('uiSet', function() {
//custom module placements jQuery('.fpd-sc-module-wrapper').each(function(i, moduleWrapper) {
if(typeof FancyProductDesigner === 'undefined') { return; }
var $moduleWrapper = jQuery(moduleWrapper), moduleType = $moduleWrapper.data('type'), $moduleClone = fancyProductDesigner.translatedUI.find('.fpd-modules > [data-module="'+moduleType+'"]').clone();
$moduleClone.appendTo($moduleWrapper);
switch(moduleType) { case 'products': new ProductsModule(fancyProductDesigner, $moduleClone); break; case 'text': new TextModule(fancyProductDesigner, $moduleClone); break; case 'designs': new DesignsModule(fancyProductDesigner, $moduleClone); break; case 'images': new ImagesModule(fancyProductDesigner, $moduleClone); break; }
if(typeof FancyProductDesignerPlus !== 'undefined') {
switch(moduleType) { case 'drawing': var fpdDrawingModule = new FPDDrawingModule(fancyProductDesigner, $moduleClone); fpdDrawingModule.drawCanvas.setWidth($moduleClone.width()); break; }
}
});
}) .on('ready', function() {
//setup products and designs from json fancyProductDesigner.setupProducts(fpdProductsJSON); fancyProductDesigner.setupDesigns(fpdDesignsJSON);
if(0) { var order = 0, product = order.product ? order.product : order; //deprecated: getProduct() as used instead getOrder() fancyProductDesigner.toggleSpinner(true); fancyProductDesigner.loadProduct(product); //PLUS if(fancyProductDesigner.bulkVariations && fancyProductDesigner.bulkVariations.setup && order.bulkVariations) { fancyProductDesigner.bulkVariations.setup(order.bulkVariations); } }
//requires login to upload images if ( 0 ) { jQuery('.fpd-upload-zone').replaceWith('
You need to be logged in to upload images!
'); } fpdIsReady = true;
//add price to modal $modalPrice = jQuery(''); jQuery('.fpd-modal-product-designer .fpd-done').after($modalPrice);
//shortcode: actions var $uiActions = fancyProductDesigner.translatedUI.children('.fpd-actions'); jQuery('.fpd-sc-action-placeholder').each(function(i, item) {
var $item = jQuery(item), actionName = $item.data('action'), layout = $item.data('layout'), $action = $uiActions.children('[data-action="'+actionName+'"]');
var $cloneAction = $action.clone().addClass('fpd-sc-action fpd-layout--'+layout);
$cloneAction.removeClass('fpd-disabled');
if(layout === 'icon-text' || layout === 'text') { $cloneAction.removeClass('fpd-tooltip') .children(':first').after(''+$cloneAction.attr('title')+''); }
$cloneAction.click(function() { if(fancyProductDesigner && fancyProductDesigner.actions && fpdProductCreated) { fancyProductDesigner.actions.doAction(jQuery(this)); } });
jQuery(item).replaceWith($cloneAction);
});
}) .on('productCreate', function() {
fpdProductCreated = true;
//calculate initial elemens length for customization required initialElementsLength = 0; fancyProductDesigner.getElements().forEach(function(view) { initialElementsLength += view.length; });
}) .on('undoRedoSet', function(evt, undos, redos) {
$body.removeClass('fpd-customization-required');
}) .on('viewSelect', function() {
jQuery('.fpd-sc-module-wrapper[data-type="names-numbers"]').each(function(i, moduleWrapper) {
if(typeof FPDNamesNumbersModule !== 'undefined') { var $moduleWrapper = jQuery(moduleWrapper); FPDNamesNumbersModule.setup(fancyProductDesigner, $moduleWrapper.children('.fpd-module')); }
});
}) .on('layersListUpdate', function() {
jQuery('.fpd-sc-module-wrapper[data-type="manage-layers"]').each(function(i, moduleWrapper) {
if(typeof FancyProductDesigner !== 'undefined') {
var $moduleWrapper = jQuery(moduleWrapper); LayersModule.createList(fancyProductDesigner, $moduleWrapper.children('.fpd-module'));
}
});
jQuery('.fpd-sc-module-wrapper[data-type="text-layers"]').each(function(i, moduleWrapper) {
if(typeof FancyProductDesigner !== 'undefined') {
var $moduleWrapper = jQuery(moduleWrapper); FPDTextLayersModule.createList(fancyProductDesigner, $moduleWrapper.children('.fpd-module'));
}
});
});
if(!pluginOptions.saveActionBrowserStorage) {
var loginRequiredText = "Please log into your account!";
$selector.on('actionSave', function(evt, title, thumbnail, product) {
if(0 === 0) { FPDUtil.showMessage(loginRequiredText); return; }
if(product) {
var data = { action: 'fpd_saveuserproduct', title: title, thumbnail: thumbnail, product: JSON.stringify(product), post_id : 603 };
jQuery.post(adminAjaxURL, data, function(response) {
FPDUtil.showMessage(response.error ? response.error : response.message);
}, 'json');
}
}) .on('actionLoad', function() {
if(0 === 0) { FPDUtil.showMessage(loginRequiredText); return; }
fancyProductDesigner.toggleSpinner(true);
var data = { action: 'fpd_loaduserproducts', post_id : 603 };
jQuery.post(adminAjaxURL, data, function(response) {
if(response.data) {
response.data.forEach(function(item) {
fancyProductDesigner.actions.addSavedProduct( item.thumbnail, item.product, item.title );
});
}
fancyProductDesigner.toggleSpinner(false);
FPDUtil.showMessage(response.error ? response.error : response.message);
}, 'json');
}) .on('actionLoad:Remove', function(evt, index, $item) {
var data = { action: 'fpd_removeuserproducts', index: index, post_id : 603 };
jQuery.post(adminAjaxURL, data, function(response) { }, 'json');
}); }
});
//WOOCOMMERCE JS
var numberOfDecimals = 2, variationSet = false;
jQuery(document).ready(function() {
var wcPrice = 18.99;
//check when variation has been selected jQuery(document) .on('found_variation', '.variations_form', function(evt, variation) {
var variationPrice; if(variation.display_price !== undefined) { wcPrice = variation.display_price; }
_setTotalPrice();
variationSet = true;
}) .on('reset_data', '.variations_form', function(evt, variation) { variationSet = false; });
//calculate initial price $selector.on('productCreate', function() {
_setTotalPrice();
if(0) { setTimeout(_setProductImage, 5); }
});
//listen when price changes $selector.on('priceChange', function() { _setTotalPrice(); });
//fill custom form with values and then submit $cartForm.on('click', ':submit', function(evt) {
evt.preventDefault();
//validate min quantity input $quantityInput = $cartForm.find('.quantity input'); if($quantityInput.length > 0 && parseInt($quantityInput.val()) < parseInt($quantityInput.attr('min'))) { return; } //check if product is created and all variations are selected if(!fpdProductCreated || $( this ).is('.wc-variation-selection-needed')) { return false; } var order = fancyProductDesigner.getOrder({ customizationRequired: 1 }); //PLUS var bulkVariations = null; if(fancyProductDesigner.bulkVariations) { bulkVariations = fancyProductDesigner.bulkVariations.getOrderVariations(); if(bulkVariations === false) { FPDUtil.showModal("Please set all variations in the Bulk Order panel correctly!"); order.product = false; } } if(order.product != false) { var priceSet = _setTotalPrice(); jQuery('.single_add_to_cart_button').addClass('fpd-disabled'); var tempDevicePixelRation = fabric.devicePixelRatio, viewOpts = fancyProductDesigner.viewInstances[0].options, multiplier = FPDUtil.getScalingByDimesions(viewOpts.stageWidth, viewOpts.stageHeight, 100, 100); fabric.devicePixelRatio = 1; fancyProductDesigner.viewInstances[0].toDataURL(function(dataURL) { $cartForm.find('input[name="fpd_product"]').val(JSON.stringify(order)); if(1) { $cartForm.find('input[name="fpd_product_thumbnail"]').val(dataURL); } if(bulkVariations) { $cartForm.find('input[name="fpd_bulk_variations_order"]') .val(JSON.stringify(bulkVariations)); } if(priceSet) { $cartForm.submit(); } fabric.devicePixelRatio = tempDevicePixelRation; }, 'transparent', {format: 'png', multiplier: multiplier}) } }); jQuery('.fpd-modal-product-designer').on('click', '.fpd-done', function(evt) { evt.preventDefault(); if($selector.parents('.woocommerce').length > 0) { _setProductImage(); }
if(1) { $cartForm.find(':submit').click(); }
});
jQuery('#fpd-extern-download-pdf').click(function(evt) {
evt.preventDefault(); if(fpdProductCreated) { fancyProductDesigner.actions.downloadFile('pdf'); } else { FPDUtil.showModal("The product is not created yet, try again when the product has been fully loaded into the designer"); }
});
jQuery('#fpd-save-order').click(function(evt) {
evt.preventDefault();
if(fpdProductCreated) {
fancyProductDesigner.toggleSpinner(true, 'Saving Order');
var data = { action: 'fpd_save_order', item_id: -1, fpd_order: JSON.stringify(fancyProductDesigner.getOrder()) };
jQuery.post( 'http://artaray.com/wp-admin/admin-ajax.php', data, function(response) {
fancyProductDesigner.toggleSpinner(false);
if(typeof response === 'object') { FPDUtil.showMessage('Order Saved'); } else { FPDUtil.showMessage('Saving Order Failed. Please try again!'); }
}, 'json');
} else { FPDUtil.showModal("The product is not created yet, try again when the product has been fully loaded into the designer"); }
});
//set total price depending from wc and fpd price function _setTotalPrice() {
//do not set price when wcbv is enabled, wcbv is doing price display if($body.hasClass('wcbv-product')) { return false; }
//PLUS: order quantity var totalPrice = (parseFloat(wcPrice) * fancyProductDesigner.orderQuantity) + parseFloat(fancyProductDesigner.calculatePrice()), htmlPrice;
totalPrice = totalPrice.toFixed(numberOfDecimals);
if(!$priceElem || $priceElem.length == 0) {
htmlPrice = fancyProductDesigner.formatPrice(totalPrice);
//check if variations are used var $priceElem, selectorPriceAmount = ".price:first .woocommerce-Price-amount:last"; if($productWrapper.find('.variations_form').length > 0) { //check if amount contains 2 prices or sale prices. If yes different prices are used if($productWrapper.find('.price:first > .amount').length >= 2 || $productWrapper.find('.price:first ins > .amount').length >= 2) { //different prices $priceElem = $cartForm.find('.woocommerce-Price-amount:first').length > 0 ? $cartForm.find(selectorPriceAmount) : $productWrapper.find('.single_variation .price .amount:last'); //fallback older WC version
} else { //same price $priceElem = $productWrapper.find('.woocommerce-Price-amount:first').length > 0 ? $productWrapper.find(selectorPriceAmount) : $productWrapper.find('.price:first .amount:last'); //fallback older WC version }
} //no variations are used else { $priceElem = $productWrapper.find('.woocommerce-Price-amount').length > 0 ? $productWrapper.find(selectorPriceAmount) : $productWrapper.find('.price:first .amount:last'); //fallback older WC version }
}
if($priceElem && $priceElem.length > 0) { $priceElem.html(htmlPrice); } else { FPDUtil.log('No price element could be found in the document!', 'info'); }
if($modalPrice) { $modalPrice.html(htmlPrice); }
if($cartForm.find('input[name="fpd_product_price"]').length > 0) { //set price without quantity $cartForm.find('input[name="fpd_product_price"]').val(parseFloat(wcPrice) + fancyProductDesigner.calculatePrice(false)); $cartForm.find('input[name="fpd_quantity"]').val(fancyProductDesigner.orderQuantity);
return true; } else { return false; }
};
function _setProductImage() {
if(jQuery('.fpd-modal-product-designer').length > 0 && 1) {
fancyProductDesigner.viewInstances[0].toDataURL(function(dataURL) {
var $firstProductImage = $productWrapper.find('.images'), //wc standard, flatsome theme firstImageSelector = '.woocommerce-product-gallery__image img, .slide:first img';
var image = new Image(); image.onload = function() { $firstProductImage.find(firstImageSelector) .attr('data-large_image_width', this.width) .attr('data-large_image_height', this.height); }; image.src = dataURL;
$firstProductImage .find(firstImageSelector) .attr('src', dataURL).attr('srcset', dataURL) //all images (display and zoom) .parent('a').attr('href', dataURL) //photoswipe image .children('img').attr('data-large_image', dataURL); //photoswipe large image
$firstProductImage .find('.flex-control-thumbs li:first img').attr('src', dataURL); //thumb gallery
}, 'transparent', {format: 'png'});
}
};
}); //document.ready
Idea, no design | Start consultation with two edits minimum from, £50.00 |
---|---|
Upload Design | Design ready and good to go! from, £15.00 |
Reviews
There are no reviews yet.