Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 80c497f

Browse files
committed
@NataliaTepluhina please add this to docs:
Starting from Vue Storefront v1.6 now we have a special switch in `vue-storefront-api`: `config.orders.useServerQueue` which is set to `false` by default. With this option disabled the `order_2_magento` process is no longer needed as the incoming orders are directly send to Magento2. If it's set to `true` then - the old behavior of server-based Redis queued used to stack the orders first is being used
1 parent 182f530 commit 80c497f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/api/order.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ export default ({ config, db }) => resource({
7676
orderProxy.create(req.body).then((result) => {
7777
apiStatus(res, result, 200);
7878
}).catch(err => {
79-
console.error(err)
80-
apiStatus(res, err, 500);
79+
apiStatus(res, err.toString(), 500);
8180
})
8281
}
8382
},

src/platform/magento2/o2m.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function isNumeric(val) {
3030
* @param {Function} done callback - @example done(new Error()) - to acknowledge problems
3131
*/
3232
function processSingleOrder(orderData, config, job, done, logger = console) {
33-
3433
const TOTAL_STEPS = 4;
3534
const THREAD_ID = 'ORD:' + (job ? job.id : 1) + ' - '; // job id
3635
let currentStep = 1;
@@ -228,7 +227,7 @@ function processSingleOrder(orderData, config, job, done, logger = console) {
228227
redisClient.set("order$$totals$$" + orderData.order_id, JSON.stringify(result[1]));
229228

230229
if(job) job.progress(currentStep++, TOTAL_STEPS);
231-
return done(null, { magentoOrderId: result, transferedAt: new Date() });
230+
return done(null, { magentoOrderId: result, backendOrderId: result, transferedAt: new Date() });
232231
}).catch(err => {
233232
logger.error('Error placing an order', err, typeof err)
234233
if (job) job.attempts(6).backoff({ delay: 30*1000, type:'fixed' }).save()

src/platform/magento2/order.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class OrderProxy extends AbstractOrderProxy {
1515
return new Promise ((resolve, reject) => {
1616
try {
1717
processSingleOrder(orderData, inst.config, null, (error, result) => {
18+
console.log(error)
1819
if (error) reject (error)
1920
resolve (result)
2021
})

0 commit comments

Comments
 (0)