product details
This commit is contained in:
@@ -24,7 +24,7 @@ export const fromWCOrder = (WCOrder) => {
|
||||
reference: WCOrder['reference'],
|
||||
assignedTo: 'assigned to',
|
||||
fixedPrice: WCOrder.total,
|
||||
recurringPrice: 0,
|
||||
recurringPrice: WCOrder['recurring_price'],
|
||||
status: WCOrder.status,
|
||||
currency: WCOrder.currency,
|
||||
billing:{
|
||||
@@ -49,14 +49,15 @@ export const fromWCOrder = (WCOrder) => {
|
||||
payPeriod: packageLine['pay_period'],
|
||||
shortDesc: packageLine['short_desc'],
|
||||
dateCompleted: formatDate(packageLine['date_completed']),
|
||||
additionalPackages: packageLine['additional_packages'].map(additionalPackage => ({
|
||||
additionalPackages: packageLine['additional_packages'] ? packageLine['additional_packages'].map(additionalPackage => ({
|
||||
idPackage: additionalPackage.id,
|
||||
packageName: additionalPackage.name,
|
||||
})),
|
||||
options: packageLine['options'].map(packageOption => ({
|
||||
})) : [],
|
||||
options: packageLine['options'] ? packageLine['options'].map(packageOption => ({
|
||||
idPackage: packageOption.id,
|
||||
packageName: packageOption.name,
|
||||
})),
|
||||
groupName: packageOption['group_name'] || '',
|
||||
})) : [],
|
||||
};
|
||||
}),
|
||||
process: processInfo,
|
||||
|
||||
@@ -12,9 +12,9 @@ function extractPrices(wcPackageId, prices) {
|
||||
maxContractPeriod: price['max_contract_period'],
|
||||
packagePayPeriod: price['package_pay_period'],
|
||||
servicesContractPeriod: price['services_contract_period'],
|
||||
fixedExtra: price['minimal_fixed_price'],
|
||||
servicesExtra: price['minimal_services_price'],
|
||||
recurentExtra: price['recurrent_price']
|
||||
fixedExtra: price['fixed_extra'],
|
||||
servicesExtra: price['services_extra'],
|
||||
recurrentExtra: price['recurrent_extra']
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -46,29 +46,23 @@ export const fromWCPackage = wcPackage => {
|
||||
image: wcPackage.images[0].src || DEFAULT_PACKAGE_IMG,
|
||||
hasImage: !!wcPackage.images.length,
|
||||
name: wcPackage.name,
|
||||
country: 'Sweden',
|
||||
countryCode: 'se',
|
||||
currency: 'SEK',
|
||||
documents: [
|
||||
{
|
||||
idDocument: 1,
|
||||
documentName: 'test1',
|
||||
extension: '.php'
|
||||
},
|
||||
{
|
||||
idDocument: 2,
|
||||
documentName: 'test2',
|
||||
extension: '.php'
|
||||
}
|
||||
],
|
||||
country: wcPackage.country,
|
||||
countryCode: wcPackage['country_code'],
|
||||
currency: wcPackage.currency,
|
||||
documents: wcPackage.documents ? wcPackage.documents.map(document => ({
|
||||
idDocument: document.id,
|
||||
documentName: document.name,
|
||||
extension: document.extension,
|
||||
idPackage: wcPackage.id,
|
||||
})) : [],
|
||||
shortDescription: wcPackage.description,
|
||||
prices: extractPrices(wcPackage.id, wcPackage.prices) || [],
|
||||
groups: extractGroups(wcPackage.groups),
|
||||
additionalPackages: wcPackage['additional_packages'].map(additionalPackage =>({
|
||||
prices: extractPrices(wcPackage.id, wcPackage.prices || []),
|
||||
groups: extractGroups(wcPackage.groups || {}),
|
||||
additionalPackages: wcPackage['additional_packages'] ? wcPackage['additional_packages'].map(additionalPackage =>({
|
||||
idAdditionalPackage: additionalPackage.id,
|
||||
packageName: additionalPackage.name,
|
||||
shortDescription: additionalPackage.description,
|
||||
prices: extractPrices(additionalPackage.id, additionalPackage.prices)
|
||||
})),
|
||||
})) : [],
|
||||
}
|
||||
};
|
||||
@@ -19,7 +19,11 @@ class PriceHellper {
|
||||
}
|
||||
|
||||
hasRecurrentPrice(selectedPrice){
|
||||
return selectedPrice && (selectedPrice.recurentExtra > 0 || selectedPrice.servicesExtra > 0);
|
||||
return selectedPrice && (selectedPrice.recurrentExtra > 0 || selectedPrice.servicesExtra > 0);
|
||||
}
|
||||
|
||||
calculateCartItemTotal(cartItem) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user