System supported developers customize design tool with Hooks Javascript, PHP
Javascript Hooks
Call Hook
1
2
3
4
|
jQuery(document).on( "Your_Event" , function ( event, obj1, object2){ // your code return obj1; } |
List Hooks
- load.item.design
Call when load image of product designParameter: [Image, item]- image: Object image
- item: Object value of image with {top, left, right, height, zIndex}
- select.item.design
Call when select one item design (text, cliparts, photo upload…)Parameter: [elment]- element: Object
- unselect.item.design
Call when unselect one item design (text, cliparts, photo upload…)
Parameter: [elment]- element: Object
- remove.item.design
Call when remove designParameter: [elment]- element: Object
- before.create.item.design
Call before add item designParameter: [elment]- element: Object
- after.create.item.design
Call after added item design
Parameter: [elment]- element: Object
- name.add.team.design
Call when add team name
Parameter: [elment]- element: Object
- number.add.team.design
Call when add team number
Parameter: [elment]- element: Object
- add.layers.design
Call when add layer of item design (append html in box layers)
Parameter: [elment]- element: Object
- before.add.text.design
Call before add text
Parameter:- text: Object with values {text, color, fontSize, fontFamily}
- after.add.text.design
Call after added text
Parameter: [elment]- elment: Object
- size.update.text.design
Call when change font, size, outline of text
Parameter: [width, height]- width: int
- height: int
- align.text.design
Call when align of text
Parameter: [elment, type]- elment: object
- type: string [left, right]
- resize.item.design
Call when resize text, cliparts, photo upload…
Parameter: [ui]- ul: object {top, left, width, height}
- rotate.item.design
Call when rotate text, cliparts, photo upload…
Parameter: [ui]- ul: object {top, left, width, height}
- move.item.design
Call when move text, cliparts, photo upload…
Parameter: [ui]- ul: object {top, left, width, height}
- after.load.design
Call when load design saved with text, cliparts, photo upload…
Parameter: [design]- design: object
- change.product.design
Call when change product design
Parameter: [product]- product: object
- changeView.product.design
Call when change views front, back, left, right of product
Parameter: [elment]- elment: object
- changeColor.product.design
Call when change color of product design
Parameter: [elment, index]- elment: object
- index: int
- before.save.design
Call when save design
Parameter: [data]- data: object
- after.save.design
Call after saved design
Parameter: [data]- data: object
Code examples:
- Create new file tshirtecommerce/addons/js/custom.js
- Find your hooks and add your code
1
2
3
4
|
jQuery(document).on( "before.save.design" , function ( event, data){ // your code return data; } |