setOrderPCode class method

Sets shopping cart product codes

@access        public
@param        $orderPCode array
@return        boolean
174655
public function setOrderPCode($orderPCode)
    {
        if (!is_array($orderPCode)) {
            $this->orderPCode = null;

            return false;
        }
        $isValid = true;
        $index = 0;
        while ($isValid && $index < count($orderPCode)) {
            if (strlen($orderPCode[$index]) > 20) {
                $isValid = false;
            } else {
                $isValid = true;
            }
            $index++;
        }
        if (!$isValid) {
            $this->orderPCode = null;

            return false;
        }
        $this->orderPCode = $orderPCode;

        return true;
    }
822606
@Override
    public void setOrder(Order order) {
        this.order = order;
        if (order != null) {
            switch (order) {
                case SINGLE:
                    this.electronCount = 2;
                    break;
                case DOUBLE:
                    this.electronCount = 4;
                    break;
                case TRIPLE:
                    this.electronCount = 6;
                    break;
                case QUADRUPLE:
                    this.electronCount = 8;
                    break;
                case QUINTUPLE:
                    this.electronCount = 10;
                    break;
                case SEXTUPLE:
                    this.electronCount = 12;
                    break;
                default:
                    this.electronCount = 0;
                    break;
            }
        }
    }
1316772
public function loadOrderShippingMethod(
        CartInterface $cart,
        OrderInterface $order
    ) {
        $shippingMethodId = $cart->getShippingMethod();

        if (empty($shippingMethodId)) {
            return $this;
        }

        $shippingMethod = $this
            ->shippingWrapper
            ->getOneById($cart, $shippingMethodId);

        if ($shippingMethod instanceof ShippingMethod) {
            $order->setShippingAmount($shippingMethod->getPrice());
            $order->setShippingMethod($shippingMethod);
        }
    }
1214422
public function setOrderData($orderData)
    {
        $this->id = $orderData->getIncrementId();
        $this->email = $orderData->getCustomerEmail();
        $this->quoteId = $orderData->getQuoteId();
        $this->storeName = $orderData->getStoreName();
        $this->purchaseDate = $orderData->getCreatedAt();
        $this->deliveryMethod = $orderData->getShippingDescription();
        $this->deliveryTotal = (float)number_format(
            $orderData->getShippingAmount(),
            2,
            '.',
            ''
        );
        $this->currency = $orderData->getStoreCurrencyCode();
        $payment = $orderData->getPayment();

        if ($payment) {
            if ($payment->getMethod()) {
                $methodInstance = $payment->getMethodInstance($payment->getMethod());
                if ($methodInstance) {
                    $this->payment = $methodInstance->getTitle();
                }
            }
        }

        $this->couponCode = $orderData->getCouponCode();

        /*
         * custom order attributes
         */
        $website = $this->_storeManager->getStore($orderData->getStore())->getWebsite();

        $customAttributes
            = $this->helper->getConfigSelectedCustomOrderAttributes(
                $website
            );

        if ($customAttributes) {
            $fields = $this->helper->getOrderTableDescription();
            $this->custom = [];
            foreach ($customAttributes as $customAttribute) {
                if (isset($fields[$customAttribute])) {
                    $field = $fields[$customAttribute];
                    $value = $this->_getCustomAttributeValue(
                        $field,
                        $orderData
                    );
                    if ($value) {
                        $this->_assignCustom($field, $value);
                    }
                }
            }
        }

        /*
         * Billing address.
         */
        $this->processBillingAddress($orderData);

        /*
         * Shipping address.
         */
        $this->processShippingAddress($orderData);

        $syncCustomOption = $this->helper->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_ORDER_PRODUCT_CUSTOM_OPTIONS,
            $website
        );

        /*
         * Order items.
         */
        $this->processOrderItems($orderData, $syncCustomOption);

        $this->orderSubtotal = (float)number_format(
            $orderData->getData('subtotal'),
            2,
            '.',
            ''
        );
        $this->discountAmount = (float)number_format(
            $orderData->getData('discount_amount'),
            2,
            '.',
            ''
        );
        $orderTotal = abs(
            $orderData->getData('grand_total') - $orderData->getTotalRefunded()
        );
        $this->orderTotal = (float)number_format($orderTotal, 2, '.', '');
        $this->orderStatus = $orderData->getStatus();

        unset($this->_storeManager);

        return $this;
    }
896682
public function setOrderId($orderId)
    {
        if (!empty($orderId) && ctype_print($orderId)) {
            $this->orderId = trim($orderId);
        }

        return $this;
    }
464910
protected function setOrderAccountOrder($order_id)
    {
        $this->data_order = $this->order->get($order_id);

        if (empty($this->data_order)) {
            $this->outputHttpStatus(404);
        }

        $this->prepareOrderAccountOrder($this->data_order);
    }
793328
protected function prepareOrder(array &$order)
    {
        $this->setItemTotalFormatted($order, $this->price);
        $this->setItemTotalFormattedNumber($order, $this->price);
    }
413161
public function setOrderItemCategory($orderItemCategory) 
    {
        if (!$this->_isNumericArray($orderItemCategory)) {
            $orderItemCategory =  array ($orderItemCategory);    
        }
        $this->fields['OrderItemCategory']['FieldValue'] = $orderItemCategory;
        return $this;
    }
781645
public function setOrderItemCategory($orderItemCategory) 
    {
        if (!$this->_isNumericArray($orderItemCategory)) {
            $orderItemCategory =  array ($orderItemCategory);    
        }
        $this->_fields['OrderItemCategory']['FieldValue'] = $orderItemCategory;
        return $this;
    }
951994
public function setOrder(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
866858
public function setOrderBy($order)
	{
		if(is_null($order))
		{
			$this->getSelect()->setOrder(null);
			return $this;
		}

		if(!is_array($order))
		{
			$order = array($order);
		}

		$sort = array();
		foreach($order as $value)
		{
			$direction = 1;
			if (preg_match('/(.*\W)(ASC|DESC)\b/si', $value, $matches)) {
				$value = trim($matches[1]);
				switch($matches[2])
				{
					case "ASC":
						$direction = 1;
						break;
					case "DESC":
						$direction = -1;
						break;
				}
			}

			$sort[$value] = $direction;
		}

		$this->getSelect()->setOrder($sort);
		return $this;
	}
699436
public function checkOrderExists($orderNumber, $throwExceptionOnDuplicate = false)
    {
        $sgOrder = $this->get($orderNumber);
        if ($throwExceptionOnDuplicate && $sgOrder->getId() !== null) {
            throw new \ShopgateLibraryException(
                \ShopgateLibraryException::PLUGIN_DUPLICATE_ORDER,
                $orderNumber,
                true
            );
        }

        return $sgOrder;
    }
1202473
public function setOrderShipping($orderShipping = 0)
    {
        if (is_numeric($orderShipping) && $orderShipping >= 0) {
            $this->orderShipping = $orderShipping;

            return true;
        } elseif (is_numeric($orderShipping) && $orderShipping < 0) {
            $this->orderShipping = -1;

            return true;
        }

        $this->orderShipping = null;

        return false;
    }
366242
protected function ensureSortOrder(
        array $sortOrderCondition = [],
        string $sortOrderAttribute = 'sortOrder'
    ) {
        if ($this->getAttribute($sortOrderAttribute) === null) {
            $this->setAttribute(
                $sortOrderAttribute,
                $this->nextSortOrder(
                    $sortOrderCondition,
                    $sortOrderAttribute
                )
            );
        }
    }
383416
public function setOrderDate($orderDate = '')
    {
        if (strtotime($orderDate) === -1) {
            $this->orderDate = null;

            return false;
        }

        $dateFormatPattern = "^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))^";

        if (!preg_match($dateFormatPattern, $orderDate)) {
            $this->orderDate = null;

            return false;
        }

        if (strtotime($orderDate) > strtotime(date("Y-m-d H:i:s"))) {
            $this->orderDate = null;

            return false;
        }

        $this->orderDate = $orderDate;

        return true;
    }
1187111
static function archiveOrder( $orderID )
    {
        $db = eZDB::instance();
        $orderID =(int) $orderID;
        $db->query( "UPDATE ezorder SET is_archived='1' WHERE id='$orderID' " );
    }
1141846
public function setOrderID($orderID)
    {
        if (!Icepay_Parameter_Validation::orderID($orderID))
            throw new Exception('The Order ID cannot be longer than 10 characters', 1007);

        $this->orderID = $orderID;
        return $this;
    }