Skip to content

Instantly share code, notes, and snippets.

@rvlasenko
Last active September 20, 2016 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvlasenko/281be86e6f04fd175e95322b0ff50569 to your computer and use it in GitHub Desktop.
Save rvlasenko/281be86e6f04fd175e95322b0ff50569 to your computer and use it in GitHub Desktop.
diff --git a/app/functions/fn.cart.php b/app/functions/fn.cart.php
index 2d2176d..97f8c49 100644
--- a/app/functions/fn.cart.php
+++ b/app/functions/fn.cart.php
@@ -7871,6 +7871,20 @@ function fn_checkout_update_steps(&$cart, &$auth, $params)
// Check if we need to send notification with new email to customer
$email = db_get_field('SELECT email FROM ?:users WHERE user_id = ?i', $auth['user_id']);
+ $fields = array('firstname', 'lastname');
+ $is_checkout_show = db_get_hash_single_array(
+ 'SELECT checkout_show, field_name'
+ . ' FROM ?:profile_fields'
+ . ' WHERE field_name IN (?a)',
+ array('field_name', 'checkout_show'), $fields
+ );
+
+ if ($is_checkout_show['firstname'] == 'N') {
+ unset($user_data['firstname']);
+ }
+ if ($is_checkout_show['lastname'] == 'N') {
+ unset($user_data['lastname']);
+ }
$send_notification = false;
if (isset($user_data['email']) && $user_data['email'] != $email) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment