iansvo / monstercommerce-snippets

Useful code snippets for the Monster Commerce (nsCommerce Space)
MIT License
0 stars 0 forks source link

Office Sign Company #1

Closed trichter01 closed 8 years ago

trichter01 commented 8 years ago

Hi Ian,

Awesome work on the code here! I am trying to get this working with our site officesigncompany.com, but continue to encounter error for the order confirmation module. Any help or suggestions would be much appreciated!

Thanks!

iansvo commented 8 years ago

Hey there,

Are you still having issues? If so, can you please post the specific error you're seeing?

trichter01 commented 8 years ago

These are the errors I am receiving when testing in chrome:

Last result collected from https://www.officesigncompany.com/checkout.aspx?complete at 2015/11/30 07:15 ▲! Incorrect number format: “gts-o-total” How to Fix: Follow the required format when providing the total price associated with the order in the “gts-o-total” field of the Google Trusted Stores Order Confirmation JavaScript code. Required format: “123.45” Your value: “”. Learn more ▲! Incorrect number format: “gts-o-discounts” How to Fix: Follow the required format when providing the discounts associated with the order in the “gts-o-total” field of the Google Trusted Stores Order Confirmation JavaScript code. Required format: “-123.45” Your value: “”. Learn more ▲! Incorrect number format: “gts-o-shipping-total” How to Fix: Follow the required format when providing the shipping total associated with the order in the “gts-o-shipping-total” field of the Google Trusted Stores Order Confirmation JavaScript code. Required format: “123.45” Your value: “”. Learn more ▲! Incorrect number format: “gts-o-tax-total” How to Fix: Follow the required format when providing the total taxes associated with the order in the “gts-o-shipping-total” field of the Google Trusted Stores Order Confirmation JavaScript code. Required format: “123.45” Your value: “”. Learn more ▲! Incorrect date format: “gts-o-est-ship-date” How to Fix: Follow the required format when providing the estimated shipping date associated with the order in the “gts-o-est-ship-date” field of the Google Trusted Stores Order Confirmation JavaScript code. Required format: “YYYY-MM-DD” Your value: “”. Learn more ▲! Item level details of the order confirmation module are missing How to Fix: Provide the item level details associated with the order in the “gts-i-item-” fields of the Google Trusted Stores Order Confirmation JavaScript code. Learn more ▲! Item name is missing: “gts-i-name” How to Fix: Provide the item name associated with the order in the “gts-i-name” field of the Google Trusted Stores Order Confirmation JavaScript code. Learn more ▲! Item price is missing: “gts-i-price” How to Fix: Provide the item name associated with the order in the “gts-i-price” field of the Google Trusted Stores Order Confirmation JavaScript code. Learn more ▲! Item quantity is missing: “gts-i-quantity” How to Fix: Provide the item name associated with the order in the “gts-i-name” field of the Google Trusted Stores Order Confirmation JavaScript code. Item quantity is required but appears to be missing from the order confirmation module. Please review the JavaScript code and confirm it is present. Learn more ▲! Optional: Google Shopping Item ID is missing: “gts-i-prodsearch-id” How to Fix: Provide the Google Shopping Item ID associated with the product in the “gts-i-prodsearch-id” field of the Google Trusted Stores Order Confirmation JavaScript code. This is a recommended but optional field. This field does not affect core functionality, and leaving this warning unresolved will not prevent you from entering the monitoring period. However, merchants using Google Shopping should correct these errors to ensure proper integration. This integration will allow Google to more easily correlate specific products to data that you have provided in connection with Google Trusted Stores. If you have chosen to leave out this field, you may disregard this warning. Learn more ▲! Optional: Google Shopping Account ID is missing: “gts-i-prodsearch-store-id” How to Fix: Provide the Google Shopping Account ID associated with the product in the “gts-i-prodsearch-store-id” field of the Google Trusted Stores Order Confirmation JavaScript code. This is a recommended but optional field. This field does not affect core functionality, and leaving this warning unresolved will not prevent you from entering the monitoring period. However, merchants using Google Shopping should correct these errors to ensure proper integration. This integration will allow Google to more easily correlate specific products to data that you have provided in connection with Google Trusted Stores. If you have chosen to leave out this field, you may disregard this warning. Learn more ▲! Incorrect date format: “gts-o-est-delivery-date” How to Fix: Follow the required format when providing the estimated delivery date associated with the order in the “gts-o-est-delivery-date” field of the Google Trusted Stores Order Confirmation JavaScript code. Required format: “YYYY-MM-DD” Your value: “”. Learn more

-Travis

trichter01 commented 8 years ago

...And this is the script I've got on the confirmation message: -Travis google-trusted-stores-scripts.txt

iansvo commented 8 years ago

Hey there, sorry again it took so long to get back to you! Things are very busy with the holidays.

At any rate, I'm looking at your page now after doing a test order, and I can see that you have minified the code you included in your payment method's "confirmation message" field (which is the right place for it to go).

However, the minification you did apparently preserved the comments in the code, so a huge section of the code is commented out. You can tell this in 2 very obvious ways:

  1. In the inspection cool, a bunch of the code shows green (e.g. commented out) which it shouldn't
  2. If you attempt to log certain variables to the console (such as orderTotalRaw) the result is undefined. This makes sense because the variable declarations at the beginning of the script are not commented out, but the parts of the script that define them are clearly commented out lower in the script.

That being said, you have 2 choices for proceeding:

  1. Don't minify the code prior to placing it in your confirmation message
  2. Minify the code in a way that fully removes comments.

Hope that helps!

trichter01 commented 8 years ago

Ian, thank you kindly for responding! I have passed all tests and entered into the qualification period!

Thanks again, -TR

iansvo commented 8 years ago

Righteous! That's what I like to hear.

Thanks for posting. Happy selling!