diff --git a/Newsletter/lib/subscriber.php b/Newsletter/lib/subscriber.php index 6304951da..7682a83ae 100644 --- a/Newsletter/lib/subscriber.php +++ b/Newsletter/lib/subscriber.php @@ -22,15 +22,7 @@ function df_subscriber($v = null, $w = null):S { return !$v ? $r : ( df_is_email($v) ? $r->loadBySubscriberEmail($v, df_website_id($w)) : ( $v instanceof C ? $r->loadByCustomer(df_customer_id($v), $v->getWebsiteId()) : ( - /** - * 2024-06-02 - * 1.1) @uses \Magento\Quote\Model\Quote::getCustomerEmail() - * 1.2) @uses \Magento\Sales\Api\Data\OrderInterface::getCustomerEmail() - * 1.3) @uses \Magento\Sales\Model\Order::getCustomerEmail() - * 1.4) @see \Magento\Quote\Api\Data\CartInterface does not have a method or a field for the customer's email. - * 2) The customer's email can be absent in a quote. - */ - df_is_oq($v) ? $r->loadBySubscriberEmail($v->getCustomerEmail(), df_website_id($v)) : + df_is_oq($v) ? $r->loadBySubscriberEmail(df_oq_email($v), df_website_id($v)) : df_error(['v' => $v]) ) ) diff --git a/OQ/lib/oq/get.php b/OQ/lib/oq/get.php index 1a4331c51..5bf927b4e 100644 --- a/OQ/lib/oq/get.php +++ b/OQ/lib/oq/get.php @@ -2,8 +2,10 @@ use Df\Core\Exception as DFE; use Df\Quote\Model\Quote as DfQ; use Magento\Customer\Model\Customer as C; +use Magento\Quote\Api\Data\CartInterface as IQ; use Magento\Quote\Model\Quote as Q; use Magento\Quote\Model\Quote\Address as QA; +use Magento\Sales\Api\Data\OrderInterface as IO; use Magento\Sales\Model\Order as O; use Magento\Sales\Model\Order\Address as OA; @@ -67,6 +69,18 @@ function df_oq_customer_name($oq):string {return dfcf(function($oq) { return $r ?: (df_is_o($oq) ? $oq->getCustomerName() : (string)__('Guest')); }, [$oq]);} +/** + * 2024-06-02 + * 1.1) @uses \Magento\Quote\Model\Quote::getCustomerEmail() + * 1.2) @uses \Magento\Sales\Api\Data\OrderInterface::getCustomerEmail() + * 1.3) @uses \Magento\Sales\Model\Order::getCustomerEmail() + * 1.4) @see \Magento\Quote\Api\Data\CartInterface does not have a method or a field for the customer's email. + * 2) The customer's email can be absent in a quote. + * @used-by df_subscriber() + * @param O|IO|Q|IQ $oq + */ +function df_oq_email($oq):?string {return $oq->getCustomerEmail();} + /** * 2018-11-14 * @used-by \Df\Payment\Metadata::vars() diff --git a/composer.json b/composer.json index 1237aaac0..9cf9a5cfd 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/core" - ,"version": "11.0.9" + ,"version": "11.1.0" ,"description": "Mage2.PRO core package." ,"type": "magento2-module" ,"homepage": "https://mage2.pro"