Fengfan Trigger 2pcs Mobile Game Controller 6-finger game trigger portable
${function() {
const variantData = data.variant || {"id":"dbb0fcdb-1d7d-48fe-afac-5ba5893df2d9","product_id":"836ff2b4-dd50-4174-b0fd-d02463dda974","title":"black trigger","weight_unit":"lb","inventory_quantity":922,"sku":"601","barcode":"","position":2,"option1":"black trigger","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/0bcf88f345b86be0fe4ea3e092316160.jpeg","path":"0bcf88f345b86be0fe4ea3e092316160.jpeg","width":800,"height":800,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":12.99,"min_quantity":1}],"weight":"0.2","compare_at_price":"48.99","price":"12.99","retail_price":"48.99","available":true,"url":"\/products\/fengfan-trigger-2pcs-mobile-game-controller-6-finger-game-trigger-portable?variant=dbb0fcdb-1d7d-48fe-afac-5ba5893df2d9","available_quantity":922,"options":[{"name":"\u989c\u8272","value":"black trigger"}],"off_ratio":"73","flashsale_info":{"variant_id":"dbb0fcdb-1d7d-48fe-afac-5ba5893df2d9","product_id":"","quantity":0,"discount_id":"f3c79ea1-aa60-4a0c-a420-9b6865166fd1","limit_time":-1,"limit_buy":-1,"user_limit_buy":-1,"discount_sales":242,"discount_sales_rate":"21","discount_stock":922,"ends_at":-1,"starts_at":1708924622,"allow_oversold":"uncheck","allocation_method":"none","price":"12.99","compare_at_price":"48.99","discount_price":"12.99","customary_saved_price":"36","customary_off_ratio":"73","discount_saved_price":"36","discount_off_ratio":"73","use_before_price":false,"before_price":"0","title":"","properties":"","color_setting_promotional_copy":"","discount_quantity":0,"is_need_split":false},"sales":109};
const saveType = "amount";
const productLabelDiscountOn = false;
return `
-
${saveType == 'percentage'
? `-${variantData.off_ratio}%`
: `- `
}
`;
}()}
颜色:
black trigger
${function(){
const optName = "颜色";
const optionValue = data.originData.selectData ? data.originData.selectData[optName].value : data.originData.value;
const optionValueText = optionValue ? (optionValue) : '';
return `${optionValueText} `;
}()}
${function(){
const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data);
return `${tipText}
`
}()}
Add to cart
$12.99
${function(){
const wholesale_enabled = false;
const qty = data.quantity || 1;
const currentSelectVariant = data.variant;
const defaultVariant = (data.product && data.product.variants && data.product.variants[0]);
const productVariant = {"id":"dbb0fcdb-1d7d-48fe-afac-5ba5893df2d9","product_id":"836ff2b4-dd50-4174-b0fd-d02463dda974","title":"black trigger","weight_unit":"lb","inventory_quantity":922,"sku":"601","barcode":"","position":2,"option1":"black trigger","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/0bcf88f345b86be0fe4ea3e092316160.jpeg","path":"0bcf88f345b86be0fe4ea3e092316160.jpeg","width":800,"height":800,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":12.99,"min_quantity":1}],"weight":"0.2","compare_at_price":"48.99","price":"12.99","retail_price":"48.99","available":true,"url":"\/products\/fengfan-trigger-2pcs-mobile-game-controller-6-finger-game-trigger-portable?variant=dbb0fcdb-1d7d-48fe-afac-5ba5893df2d9","available_quantity":922,"options":[{"name":"\u989c\u8272","value":"black trigger"}],"off_ratio":"73","flashsale_info":{"variant_id":"dbb0fcdb-1d7d-48fe-afac-5ba5893df2d9","product_id":"","quantity":0,"discount_id":"f3c79ea1-aa60-4a0c-a420-9b6865166fd1","limit_time":-1,"limit_buy":-1,"user_limit_buy":-1,"discount_sales":242,"discount_sales_rate":"21","discount_stock":922,"ends_at":-1,"starts_at":1708924622,"allow_oversold":"uncheck","allocation_method":"none","price":"12.99","compare_at_price":"48.99","discount_price":"12.99","customary_saved_price":"36","customary_off_ratio":"73","discount_saved_price":"36","discount_off_ratio":"73","use_before_price":false,"before_price":"0","title":"","properties":"","color_setting_promotional_copy":"","discount_quantity":0,"is_need_split":false},"sales":109};
const variantData = currentSelectVariant || defaultVariant || productVariant;
const wholesale_price = variantData.wholesale_price || [];
if(wholesale_enabled && wholesale_price.length > 0) {
let wholesaleIndex = wholesale_price.findIndex(item => {
return item.min_quantity > qty;
});
if(wholesaleIndex < 0){
wholesaleIndex = wholesale_price.length - 1;
}else if(wholesaleIndex > 0){
wholesaleIndex = wholesaleIndex - 1;
}
const wholesalePrice = wholesale_price[wholesaleIndex] || '';
return `
`
}else {
const price = variantData && variantData.price;
return price != undefined ? `
` : ' ';
}
}()}
Buy now
Product was out of stock.
Product is unavailable.
/** @private {string} */
class SpzCustomAnchorScroll extends SPZ.BaseElement {
static deferredMount() {
return false;
}
constructor(element) {
super(element);
/** @private {Element} */
this.scrollableContainer_ = null;
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.LOGIC;
}
buildCallback() {
this.viewport_ = this.getViewport();
this.initActions_();
}
setTarget(containerId, targetId) {
this.containerId = '#' + containerId;
this.targetId = '#' + targetId;
}
scrollToTarget() {
const container = document.querySelector(this.containerId);
const target = container.querySelector(this.targetId);
const {scrollTop} = container;
const eleOffsetTop = this.getOffsetTop_(target, container);
this.viewport_
.interpolateScrollIntoView_(
container,
scrollTop,
scrollTop + eleOffsetTop
);
}
initActions_() {
this.registerAction(
'scrollToTarget',
(invocation) => this.scrollToTarget(invocation?.caller)
);
this.registerAction(
'setTarget',
(invocation) => this.setTarget(invocation?.args?.containerId, invocation?.args?.targetId)
);
}
/**
* @param {Element} element
* @param {Element} container
* @return {number}
* @private
*/
getOffsetTop_(element, container) {
if (!element./*OK*/ getClientRects().length) {
return 0;
}
const rect = element./*OK*/ getBoundingClientRect();
if (rect.width || rect.height) {
return rect.top - container./*OK*/ getBoundingClientRect().top;
}
return rect.top;
}
}
SPZ.defineElement('spz-custom-anchor-scroll', SpzCustomAnchorScroll);
const STRENGTHEN_TRUST_URL = "/api/strengthen_trust/settings";
class SpzCustomStrengthenTrust extends SPZ.BaseElement {
constructor(element) {
super(element);
this.renderElement_ = null;
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.CONTAINER;
}
buildCallback() {
this.xhr_ = SPZServices.xhrFor(this.win);
const renderId = this.element.getAttribute('render-id');
SPZCore.Dom.waitForChild(
document.body,
() => !!document.getElementById(renderId),
() => {
this.renderElement_ = SPZCore.Dom.scopedQuerySelector(
document.body,
`#${renderId}`
);
if (this.renderElement_) {
this.render_();
}
this.registerAction('track', (invocation) => {
this.track_(invocation.args);
});
}
);
}
render_() {
this.fetchData_().then((data) => {
if (!data) {
return;
}
SPZ.whenApiDefined(this.renderElement_).then((apis) => {
apis?.render(data);
document.querySelector('#strengthen-trust-render-1539149753700').addEventListener('click',(event)=>{
if(event.target.nodeName == 'A'){
this.track_({type: 'trust_content_click'});
}
})
});
});
}
track_(data = {}) {
const track = window.sa && window.sa.track;
if (!track) {
return;
}
track('trust_enhancement_event', data);
}
parseJSON_(string) {
let result = {};
try {
result = JSON.parse(string);
} catch (e) {}
return result;
}
fetchData_() {
return this.xhr_
.fetchJson(STRENGTHEN_TRUST_URL)
.then((responseData) => {
if (!responseData || !responseData.data) {
return null;
}
const data = responseData.data;
const moduleSettings = (data.module_settings || []).reduce((result, moduleSetting) => {
return result.concat(Object.assign(moduleSetting, {
logos: (moduleSetting.logos || []).map((item) => {
return moduleSetting.logos_type == 'custom' ? this.parseJSON_(item) : item;
})
}));
}, []);
return Object.assign(data, {
module_settings: moduleSettings,
isEditor: window.self !== window.top,
});
});
}
}
SPZ.defineElement('spz-custom-strengthen-trust', SpzCustomStrengthenTrust);
${data.module_title}
To display this card to customers, you need to go to "Booster & Store Conversion" to turn on the trust enhancement feature.
${item.content.replaceAll("{store_name}","hubeifengfan")}
To display this card to customers, you need to go to "Booster & Store Conversion" to turn on the trust enhancement feature.
Here are what our customers say.
Newest
Most liked
Highest ratings
Lowest ratings
Wow you reached the bottom
Most liked
Highest ratings
Lowest ratings
×
${function(){
const limit = typeof data === 'number' ? data : 0;
return `
Pictures/Videos (${limit || 0}/5 )
` }()}
${(function(){
const closeIcon =
'
';
if (item.type === 'image') {
return `
${closeIcon}
`
}
return `
${closeIcon}
`
})()}
Submit Comments Anonymously
class SpzCustomFileUpload extends SPZ.BaseElement {
constructor(element) {
super(element);
this.uploadCount_ = 0;
this.fileList_ = [];
}
buildCallback() {
this.action = SPZServices.actionServiceForDoc(this.element);
this.registerAction('upload', (data) => {
this.handleFileUpload_(data.event?.detail?.data || []);
});
this.registerAction('delete', (data) => {
this.handleFileDelete_(data?.args?.data);
});
this.registerAction('preview', (data) => {
this.handleFilePreview_(data?.args?.data);
});
this.registerAction('limit', (data) => {
this.handleFileLimit_();
});
this.registerAction('sizeLimit', (data) => {
this.handleFileSizeLimit_();
});
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.LOGIC;
}
setData_(count, file) {
this.uploadCount_ = count;
this.fileList_ = file;
}
handleFileUpload_(data) {
data.forEach(i => {
if(this.fileList_.some(j => j.url === i.url)) return;
this.fileList_.push(i);
})
this.uploadCount_++;
sessionStorage.setItem('fileList', JSON.stringify(this.fileList_));
this.triggerEvent_("handleFileUpload", { count: this.uploadCount_, files: this.fileList_});
if(this.fileList_.length >= 5){
document.querySelector('#review_upload').style.display = 'none';
}
if(this.fileList_.length > 0){
document.querySelector('.apps-reviews-write-anonymous-box').style.marginTop = '8px';
}
}
handleFileDelete_(index) {
this.fileList_.splice(index, 1);
this.uploadCount_--;
sessionStorage.setItem('fileList', JSON.stringify(this.fileList_));
this.triggerEvent_("handleFileDelete", { count: this.uploadCount_, files: this.fileList_});
document.querySelector('#review_upload').style.display = 'block';
if(this.fileList_?.length === 0){
document.querySelector('.apps-reviews-write-anonymous-box').style.marginTop = '132px';
}
}
handleFilePreview_(index) {
const finalPreviewData = this.fileList_[index];
const filePreviewModal = document.getElementById('filePreviewModal');
const fullScreenVideo = document.getElementById('fullScreenVideo');
const fullScreenImage = document.getElementById('fullScreenImage');
const previewModalClose = document.getElementById('previewModalClose');
const previewLoading = document.getElementById('previewLoading');
filePreviewModal.style.display = 'block';
previewLoading.style.display = 'flex';
if(finalPreviewData?.type === 'video'){
const media = this.mediaParse_(this.fileList_[index]?.url);
fullScreenVideo.addEventListener('canplaythrough', function() {
previewLoading.style.display = 'none';
});
fullScreenImage.src = '';
fullScreenImage.style.display = 'none';
fullScreenVideo.style.display = 'block';
fullScreenVideo.src = media.mp4 || '';
} else {
fullScreenImage.onload = function() {
previewLoading.style.display = 'none';
};
fullScreenVideo.src = '';
fullScreenVideo.style.display = 'none';
fullScreenImage.style.display = 'block';
fullScreenImage.src = finalPreviewData.url;
}
previewModalClose.addEventListener('click', function() {
filePreviewModal.style.display = 'none';
});
}
handleFileLimit_() {
alert(window.AppReviewsLocale.comment_file_limit || 'please do not upload files more than 5');
this.triggerEvent_("handleFileLimit");
}
handleFileSizeLimit_() {
alert(window.AppReviewsLocale.comment_file_size_limit || 'File size does not exceed 10M');
}
clear(){
this.fileList_ = [];
this.uploadCount_ = 0;
sessionStorage.setItem('fileList', JSON.stringify(this.fileList_));
this.triggerEvent_("handleClear", { count: this.uploadCount_, files: this.fileList_});
document.querySelector('#review_upload').style.display = 'block';
}
mediaParse_(url) {
var result = {};
try {
url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) {
try {
result[key] = decodeURIComponent(value);
} catch (e) {
result[key] = value;
}
});
result.preview_image = url.split('?')[0];
} catch (e) {};
return result;
}
triggerEvent_(name, data) {
const event = SPZUtils.Event.create(this.win, name, data);
this.action.trigger(this.element, name, event);
}
}
SPZ.defineElement('spz-custom-file-upload', SpzCustomFileUpload);
The review would not show in product details on storefront since it does not support to.