The repo for Purrform's main BigCommerce store.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #7 from Teser301/store-cusomer-message

Store customer message

authored by

Rogerio Romao and committed by
GitHub
70ea3823 5f307e9d

+25 -1
+1 -1
config.json
··· 1 1 { 2 - "name": "DEV Theme - delivery dates refactored", 2 + "name": "DEV Theme - store msg externally", 3 3 "version": "6.10.0", 4 4 "template_engine": "handlebars_v4", 5 5 "meta": {
+24
templates/pages/checkout.html
··· 646 646 : 'Will be in'; 647 647 648 648 const fullInstructions = `${deliveryDate} | ${deliveryInstructions}`; 649 + 650 + // send the message to the middleware server to store in supabase as a backup if BC fails to store it 651 + fetch( 652 + `https://purrform-apps-027e.onrender.com/storeCustomerMessage?checkoutId={{cart_id}}&message=${fullInstructions}`, 653 + { 654 + method: 'GET', 655 + headers: { 656 + 'Content-Type': 'application/json', 657 + }, 658 + } 659 + ) 660 + .then((response) => { 661 + if (!response.ok) { 662 + throw new Error('Failed to store customer message'); 663 + } 664 + console.log('Customer message stored successfully'); 665 + }) 666 + .catch((error) => { 667 + console.error( 668 + 'Error storing customer message in supabase:', 669 + error 670 + ); 671 + }); 672 + 649 673 const realCommentsInput = document.querySelector( 650 674 'input[name="orderComment"]' 651 675 );