product details
This commit is contained in:
@@ -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)
|
||||
})),
|
||||
})) : [],
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user