Getting Started with Camweara Virtual Try On API

Example code snippet

   <script onload="loadTryOnButton({
      psku:'earring6',
      page:'product',
      company:'Teststore',
      nonTryOnProductsReport:'true',
      buynow:{enable:'true'}
      prependButton:{class:'product-form'},
      MBprependButton:{class:'product-main_div'},
      styles:{
      tryonbutton:{backgroundColor:'white',color:'black',border:'1px solid black',borderRadius:'25px'},
      tryonbuttonHover:{backgroundColor:'black',color:'white',border:'none',borderRadius:'25px'},
      MBtryonbutton:{width:'100%',borderRadius:'25px'}
      },
      tryonButtonData:{text:'Virtual Try-On',faIcon:'fa fa-camera'},
      MBtryonButtonData:{text:'Virtual-Try-On',faIcon:'fa fa-books'},
      });"
      src="https://camweara.com/integrations/camweara_api.js"></script>

loadTryOnButton function arguments

psku:'string'

    note: The psku will accept srting and object , passing string(sku name)
    will get only the passed sku (ref: ex1) and passing the object(main:sku
    name,recommendedSkus:array or string) will load the sku with passed
    recommended skus (ref:ex2)

ex1: psku:'sku name' => this will get only the passed sku on virtual tryon
psku:{object}

ex2: psku:{main:'sku name',recommendedSkus:'array or sku name'} => this will get  the passed sku with recommended skus on virtual tryon
company:'string'

ex: company:'company name'
nonTryOnProductsReport:' boolean'

ex: nonTryOnProductsReport:'true' => will fetch all non tryOn skus
productCategory:'string'

productCategory:'specs' => will load only specs products

page:'string'

ex: page:'listing'
buynow:{object}

buynow object arguments

ex: buynow:{enable:'true', productIdShopify:'{{ pid1 }}'}
    note: pass true or false to enable or disable buynow button,
    productIdShopify is required for adding to cart only for shopify stores.
buynowCallback:{'functionName'}

ex: buynowCallback:{'mycallbackfunctionName'}
    note: page or accepts listing or product as of now
appendButton:{'object'}

ex-1: appendButton:{id:'id of the element'}  //to append the tryon button

ex-2: appendButton:{class:'class of the element'}  //to append the tryon button
    Note: you can only pass id if page:{'listing'}
    Note: appendButton will place the tryon button after div

MBappendButton:{'object'}

ex-1: MBappendButton:{id:'id of the element'}  //to append the tryon button for mobile if needed at different position

ex-2: MBappendButton:{class:'class of the element'}  //to append the tryon button for mobile if needed at different position
    Note: styles:{MBtryonbutton:'styles'} is mandatory if MBappendButton
    /MBprependButton is used
    Note: class is only applicable if page:{'product'}
    Note: appendButton will place the tryon button after div
prependButton:{'object'}

ex-1: prependButton:{id:'id of the element'}  //to prepend the tryon button

ex-2: prependButton:{class:'class of the element'}  //to prepend the tryon button
    Note: you can only pass id if page:{'listing'}
    Note:prependButton will place the tryon button before div

MBprependButton:{'object'}

ex-1: MBprependButton:{id:'id of the element'}  //to prepend the tryon button
for mobile if needed at different position

ex-2: MBprependButton:{class:'class of the element'}  //to prepend the tryon button for mobile if needed at different position
    Note: styles:{MBtryonbutton:'styles'} is mandatory if MBappendButton
    /MBprependButton is used
    Note: class is only applicable if page:{'product'}
    Note:prependButton will place the tryon button before div

styles:{'object'}

styles object arguments

tryonbutton:{styles}

ex: styles:{tryonbutton:width:'100%',borderRadius:'25px'}  //styles for tryon button

tryonbuttonHover:{styles}

ex: styles:{tryonbuttonHover:backgroundColor:'black',borderRadius:'15px'}  //styles for tryon button on Hover

styles for mobile screen

size

MBtryonbutton:{styles}

ex: styles:{MBtryonbutton:width:'100%',borderRadius:'25px'}  //styles for tryon button for mobile width

MBtryonbuttonHover:{styles}

ex: styles:{MBtryonbuttonHover:backgroundColor:'black',borderRadius:'15px'}  //styles for tryon button on Hover for mobile width

tryonbuttonData:{object}

tryonbuttonData object arguments

text:string

ex: tryonbuttonData:{text:'Try virtualy'}  //text shows on tryon button

faIcon:string

ex: tryonbuttonData:{faIcon:'fa fa-camera'}  //only fontawasome classname

MBtryonbuttonData:{object} //for mobile

MBtryonbuttonData object arguments

text:string

ex: MBtryonbuttonData:{text:'Try virtualy'}  //text shows on tryon button in mobile

faIcon:string

ex: MBtryonbuttonData:{faIcon:'fa fa-camera'}  //only fontawasome classname in mobile

note: faIcon only accepts Font Awesome 4 Icon classes

Thank You

Reach us at info@modakatech.com for any questions.