PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
← All changes | api/Resource/FrontendResource/CustomerAddressResource.php +10 -2 1.3.27 → 1.6.5 View file →
@@ -113,9 +113,9 @@
113 113 }
114 114 $data['customer_id'] = $id;
115 115
116 116 // set others data as meta
117 - $otherData = Arr::only($data, ['company_name', 'first_name', 'last_name', 'phone']);
117 + $otherData = Arr::only($data, ['company_name', 'vat_number', 'legal_registration_id', 'first_name', 'last_name', 'phone']);
118 118 Arr::set($data, 'meta.other_data', $otherData);
119 119
120 120 $isCreated = static::getQuery()->create($data);
121 121
@@ -169,8 +169,16 @@
169 169 ['code' => 404, 'message' => __('Address not found, please reload the page and try again!', 'fluent-cart')]
170 170 ]);
171 171 }
172 172
173 + $otherData = Arr::only($data, ['company_name', 'vat_number', 'legal_registration_id', 'first_name', 'last_name', 'phone']);
174 + $existingMeta = is_array($address->meta) ? $address->meta : [];
175 + Arr::set($existingMeta, 'other_data', array_merge(
176 + Arr::get($existingMeta, 'other_data', []),
177 + $otherData
178 + ));
179 + $data['meta'] = $existingMeta;
180 +
173 181 $isUpdated = $address->update($data);
174 182
175 183 if ($isUpdated) {
176 184 static::makeSuccessResponse($isUpdated, __('Customer address updated successfully!', 'fluent-cart'));
@@ -243,5 +251,5 @@
243 251 return static::makeErrorResponse([
244 252 ['code' => 400, 'message' => __('Address set as primary failed.', 'fluent-cart')]
245 253 ]);
246 254 }
247 -}
255 +}