klaviyo / SFCC_Klaviyo

Salesforce Commerce Cloud Certified Cartridges for SFRA and Site Genesis
1 stars 9 forks source link

Initial check-in of new Klaviyo cartridge at completion of Maze project #25

Closed aidrian-maze closed 1 year ago

aidrian-maze commented 1 year ago

I believe at some point i thought that "templateVars" might be a bit generic considering that these code snippets will be mixed in among what in some cases might be multiple blocks of other custom code in SiteGen controllers... ie, someone else might have already used "templateVars." This isn't an issue in SFRA as our .append functions live in their own scope. we could standardize to one or the other - just keep in mind that never the twain shall meet in the sense that site owners will either be adding snippets for SiteGen or using the SFRA cartridge, but not both.

On Mon, Jun 5, 2023 at 6:07 PM Claire Kolln (Integrations Ecom) < @.***> wrote:

@.**** commented on this pull request.

In _sitegen/controllers/COCustomer.js https://github.com/klaviyo/SFCC_Klaviyo/pull/25#discussion_r1218644754:

  • */ +function start() {
  • var oauthLoginForm = app.getForm('oauthlogin');
  • app.getForm('singleshipping').clear();
  • app.getForm('multishipping').clear();
  • app.getForm('billing').clear();
  • Transaction.wrap(function () {
  • Cart.goc().removeAllPaymentInstruments();
  • });
  • / Klaviyo Started Checkout event tracking /
  • var KLCheckoutHelpers = require('*/cartridge/scripts/klaviyo/checkoutHelpers');
  • var customerEmail = KLCheckoutHelpers.getEmailFromBasket();
  • var KLTplVars = KLCheckoutHelpers.startedCheckoutHelper(true, customerEmail);

@aidrian-maze https://github.com/aidrian-maze is there a reason that for SG the var name for template variables is KLTplVars and for SFRA it is templateVars? If not can we use templateVars for both for consistency?

— Reply to this email directly, view it on GitHub https://github.com/klaviyo/SFCC_Klaviyo/pull/25#pullrequestreview-1463589671, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARIZNIDKR4PJU6TSJLKIDP3XJZKDZANCNFSM6AAAAAAY3KTAEY . You are receiving this because you were mentioned.Message ID: @.***>

cykolln commented 1 year ago

This isn't an issue in SFRA as our .append functions live in their own

Ah okay thanks for clarifying, we can leave it as is given this