선택 목록 확장 가격 보강
위치 또는 기타 요인에 따라 가격 책정을 조정하려면 선택 목록 확장 가격 보강을 사용하십시오.
선택 목록 확장 가격 보강을 사용하여 지정된 선택 목록 확장 필드의 필드 옵션 가격 책정을 동적으로 변경할 수 있습니다.
필수 구성요소
지원 사이트를 통해 CPQ 지원 케이스를 제출하거나 사용자 환경에 대한 보강 기능을 사용하도록 요청 support@logik.io 이메일을 보내십시오. 보강 사용 사례를 제공하십시오.
선택 목록 확장 필드가 보강의 영향을 받으려면 "보강에 사용" 토글이 켜져 있어야 합니다.
관리자에서 Blueprint CPQ 로 이동하면 보강 탭이 표시됩니다.
실제 사용 중인 선택 목록 확장 가격 책정 보강의 데모를 시청하십시오.
데모 스크립트
데모 비디오에는 다음 스크립트가 사용되었습니다.
let sourcesArr = [];
let componentArr = [];
let accessoryArr = [];
pleRequest.forEach(o => {
if(o.fieldVariableName == "alternateEnergySources") {
sourcesArr.push(o.optionValue);
//o.price = "1000";
}
if(o.fieldVariableName == "alternateEnergyComponents") {
componentArr.push(o.optionValue);
//o.price = "900";
}
if(o.fieldVariableName == "alternateEnergyAccessory") {
accessoryArr.push(o.optionValue);
//o.price = "800";
}
});
var sourceMap = new Map();
if(sourcesArr != null && sourcesArr.length != 0) {
var sourceRows = lookup("Select Energy, BasePrice from AlternateEnergyPricing where Zip = :zip and Energy IN (:value)", { "zip": cfg.zipCode, "value": sourcesArr });
for (var row of sourceRows) {
sourceMap.set(row.get("Energy"), row.get("BasePrice"));
}
} else { //source PLE not part of request. So populate this map for other PLEs
console.log("Entered non PLE in request case");
sourcesArr = ["Solar", "Wind", "Nuclear"];
var sourceRows = lookup("Select Energy, BasePrice from AlternateEnergyPricing where Zip = :zip and Energy IN (:value)", { "zip": cfg.zipCode, "value": sourcesArr });
for (var row of sourceRows) {
sourceMap.set(row.get("Energy"), row.get("BasePrice"));
}
console.log(sourcesArr);
console.log(sourceMap);
}
var multiplierMap = new Map();
if(cfg.alternateEnergySources != "") {
var multiplierRows = lookup("Select Group, Factor from AlternateEnergyMultiplier where Zip = :zip and Energy = :energyVal", { "zip": cfg.zipCode, "energyVal": cfg.alternateEnergySources });
for (var row of multiplierRows) {
multiplierMap.set(row.get("Group"), row.get("Factor"));
}
}
let sourcePrice = sourceMap.get(cfg.alternateEnergySources);
if(sourcePrice != null) {
pleRequest.forEach(o => {
if(o.fieldVariableName == "alternateEnergySources") {
o.price = sourceMap.get(o.optionValue);
}
if(o.fieldVariableName == "alternateEnergyComponents") {
let compPrice = multiplierMap.get("Component");
if(compPrice != null) {
o.price = sourcePrice*compPrice;
}
}
if(o.fieldVariableName == "alternateEnergyAccessory") {
let multA = multiplierMap.get("Accessory");
if(multA != null) {
o.price = sourcePrice*multA;
}
}
});
}
console.log(sourcesArr);
console.log(componentArr);
console.log(accessoryArr);
console.log(sourceMap);
console.log(multiplierMap);
return pleRequest;
샘플 설계, 사용 사례 및 pleRequest 요소
샘플 보강 스크립트 설계:
- 선택 목록 옵션을 반복하고 나중에 참조할 수 있도록 저장(pleRequest.forEach())
- 옵션에 대한 가격을 가져와 저장합니다(테이블 조회 또는 함수 자체를 통해).
- 올바른 옵션의 가격 설정(pleRequest.forEach())
사용 사례:
- 우편 번호 종속 가격 책정
- 가격 승수 및 할인
- Delta 가격 책정
- 독립 구성요소 가격 책정 빼기
pleRequest 요소:
- pleRequest.fieldVariableName: 선택 목록 필드의 변수 이름
- pleRequest.optionValue: 필드에 정의된 선택 목록 옵션
- pleRequest.productId: PLE 매핑의 제품 ID
- pleRequest.price: 확장에서 설정할 가격
pleRequest 객체에서 요소를 참조하는 것은 ProductList, cfg 및 cfgRequest와 같은 객체를 참조하는 것과 유사합니다. 변수가 pleRequest 로 대체되는 경우( for 루프 또는 forEach 함수 사용) 요소는 변수 뒤에 계속 참조되고 그 뒤에 마침표가 표시됩니다.