// 70번째 라인 부근에 아래 코드 삽입
var crema_product_no = $('#crema_product_num').val();
// 바로 아래의 4줄 주석처리 후 9~10번 라인(2줄) 삽입
//if( $.sp_isNumeric(sp_review) ){
// if( $.sp_getNum(sp_review) > 0 ){ $('.sp-detail-navigation > ul > li[data-target="#prdReview"]').append('<i>'+ $.sp_getNum(sp_review) +'</i>'); }
// $('#prdReview .sp-detail-navigation > ul > li[data-target="#prdReview"]').addClass('active');
//}
$('.sp-detail-navigation > ul > li[data-target="#prdReview"]').append('<i class="crema-product-reviews-count" data-product-code="' + crema_product_no + '" data-hide-if-zero="1"></i>');
$('#prdReview .sp-detail-navigation > ul > li[data-target="#prdReview"]').addClass('active');
detail.html
<!--상품트릭-->
<div id="sp-detail-count" class="sp-product-item sp-product-item-detail">
<!-- 바로 아래의 코드를 #sp-detail-count 안쪽에 삽입하시면 됩니다. -->
<input id="crema_product_num" value="{$product_no}" />
</div>
detail_reviews_count.js
// product/detail.html 과 같은 위치에 detail_reviews_count.js 파일을 생성하여 아래 소스 복붙
// 리뷰 수와 상품 평점을 업데이트하는 함수
function UpdateCount() {
if (typeof(crema) === "object") {
c_c = new crema.ProductReviewsCountWidget;
c_c.attach();
c_s.attach();
}
console.log("%c[CREMA]%c REVIEWS COUNT WAS UPDATED.", "font-weight: bold; color: black;", "color: green");
}
window.cremaOnLoad = function() {
setTimeout(function() {
UpdateReviewsCount();
}, 500);
};
locations = [
['Location', 51.82606620000001, 4.413209400000028],
['Location', 51.82606620000001, 4.413209400000028]
];
function initMap(){
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 17,
center: new google.maps.LatLng(locations[0][1], locations[0][2] )
});
var bounds = new google.maps.LatLngBounds();
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
//extend the bounds to include each marker's position
bounds.extend(marker.position);
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
//now fit the map to the newly inclusive bounds
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initMap);
//covert array to object with the same key and value
export function createConstants(...constants) {
return constants.reduce((acc, constant) => {
return {
...acc,
[constant]: constant,
};
}, {});
}