@brief Deletes a payment plan associated with a product

@param int $product_id The ID of the product the payment plan is associated with
@return array $_paymentPlans Array of updated payment plans
515167
public function deletePaymentPlan($product_id)
    {
        $idx = $this->_products[$product_id]["payment_plan"];
        unset($this->_products[$product_id]["payment_plan"]);
        unset($this->_products[$product_id]["type"]);
        $this->_paymentPlans[$idx] = null;

        return $this->_paymentPlans;
    }
365064
private function createDeleteForm(Product $product)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('ecommerce_product_delete', array('id' => $product->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
149844
static function cleanupOrder( $orderID )
    {
        $db = eZDB::instance();
        $orderID =(int) $orderID;
        $rows = $db->arrayQuery( "SELECT productcollection_id, order_nr FROM ezorder WHERE id='$orderID'" );
        if ( count( $rows ) > 0 )
        {
            // Who deletes which order in shop should be logged.
            eZAudit::writeAudit( 'order-delete', array( 'Order ID' => $orderID,
                                                        'Comment' => 'Removed the order and its related data from the database: eZOrder::cleanupOrder()' ) );

            $productCollectionID = $rows[0]['productcollection_id'];
            $orderNr = (int)$rows[0]['order_nr'];
            $db = eZDB::instance();
            $db->begin();
            $db->query( "DELETE FROM ezorder where id='$orderID'" );
            $db->query( "DELETE FROM ezproductcollection where id='$productCollectionID'" );
            $db->query( "DELETE FROM ezproductcollection_item where productcollection_id='$productCollectionID'" );
            $db->query( "DELETE FROM ezorder_status_history WHERE order_id=$orderNr" );
            $db->commit();
        }
    }
486155
protected function setProductProductBundle($product_id)
    {
        $this->data_product = $this->product->get($product_id);

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

        $this->prepareProductBundle($this->data_product);
    }
509908
protected function deleteLinked($field_id)
    {
        $this->db->delete('field_value', array('field_id' => $field_id));
        $this->db->delete('field_translation', array('field_id' => $field_id));
        $this->db->delete('product_class_field', array('field_id' => $field_id));
    }
334211
public function removeAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $cart = $this->getCurrentCart();
        $repository = $em->getRepository('EcommerceBundle:CartItem');
        $item = $repository->find($id);

        if (!$item || false === $cart->hasItem($item)) {
            // Write flash message
            return $this->redirect($this->generateUrl('ecommerce_checkout_detail'));
        }

        // Update models
        $cart->removeItem($item);
        $cart->setTotalItems(count($cart->getItems()));
        $em->flush();
        // Write flash message

        return $this->redirect($this->generateUrl('ecommerce_checkout_detail'));
    }
1174884
public function deleteAction($productId, $attributeId)
    {
        $this->getVariantAttributeManager()->removeVariantAttributeRelation(
            $productId,
            $attributeId
        );

        $this->getDoctrine()->getEntityManager()->flush();

        $view = $this->view(null, Response::HTTP_NO_CONTENT);

        return $this->handleView($view);
    }
527748
public function actionRemove(int $productId, int $combinationId = null)
    {
        \Yii::$app->cart->removeItem($productId, $combinationId);
        return $this->redirect(\Yii::$app->request->referrer);
    }
789962
public function delete()
	{
		$result = $this->getClient()->delete();

		$ids = (array) $this->getView()->param( 'id' );
		$tags = array( 'product' );

		foreach( $ids as $id ) {
			$tags[] = 'product-' . $id;
		}

		$this->getContext()->getCache()->deleteByTags( $tags );

		return $result;
	}
222322
public function delete(ProductDeleteEvent $event)
    {
        if (null !== $product = ProductQuery::create()->findPk($event->getProductId())) {
            $con = Propel::getWriteConnection(ProductTableMap::DATABASE_NAME);
            $con->beginTransaction();

            try {
                $fileList = ['images' => [], 'documentList' => []];

                // Get product's files to delete after product deletion
                $fileList['images']['list'] = ProductImageQuery::create()
                    ->findByProductId($event->getProductId());
                $fileList['images']['type'] = TheliaEvents::IMAGE_DELETE;

                $fileList['documentList']['list'] = ProductDocumentQuery::create()
                    ->findByProductId($event->getProductId());
                $fileList['documentList']['type'] = TheliaEvents::DOCUMENT_DELETE;

                // Delete product
                $product
                    ->setDispatcher($this->eventDispatcher)
                    ->delete($con)
                ;

                $event->setProduct($product);

                // Dispatch delete product's files event
                foreach ($fileList as $fileTypeList) {
                    foreach ($fileTypeList['list'] as $fileToDelete) {
                        $fileDeleteEvent = new FileDeleteEvent($fileToDelete);
                        $this->eventDispatcher->dispatch($fileTypeList['type'], $fileDeleteEvent);
                    }
                }

                $con->commit();
            } catch (\Exception $e) {
                $con->rollBack();
                throw $e;
            }
        }
    }
1321959
protected function deleteLinked($store_id)
    {
        $this->db->delete('triggers', array('store_id' => $store_id));
        $this->db->delete('wishlist', array('store_id' => $store_id));
        $this->db->delete('collection', array('store_id' => $store_id));
        $this->db->delete('product_sku', array('store_id' => $store_id));
    }
492299
public function delete($cart_id)
    {
        $result = array();
        $this->hook->attach('cart.delete.item.before', $cart_id, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        $cart = $this->cart->get($cart_id);

        if (empty($cart) || !$this->cart->delete($cart_id)) {
            return $this->getResultError();
        }

        $result = $this->getResultDelete($cart);
        $this->hook->attach('cart.delete.item.after', $cart_id, $result, $this);
        return $result;
    }
20230
protected function canDeleteProductClass()
    {
        return isset($this->data_product_class['product_class_id'])
            && $this->access('product_class_delete')
            && $this->product_class->canDelete($this->data_product_class['product_class_id']);
    }
727882
public function editProduct($product_id = null)
    {
        $this->setProduct($product_id);
        $this->setTitleEditProduct();
        $this->setBreadcrumbEditProduct();

        $this->setData('product', $this->data_product);
        $this->setData('size_units', $this->convertor->getUnitNames('size'));
        $this->setData('weight_units', $this->convertor->getUnitNames('weight'));
        $this->setData('default_currency', $this->currency->getDefault());
        $this->setData('subtract_default', $this->config->get('product_subtract', 0));
        $this->setData('classes', $this->product_class->getList(array('status' => 1)));
        $this->setData('languages', $this->language->getList(array('enabled' => true)));

        $this->submitEditProduct();

        $this->setDataFieldsEditProduct();
        $this->setDataAuthorEditProduct();
        $this->setDataRelatedEditProduct();
        $this->setDataCategoriesEditProduct();
        $this->setDataImagesEditProduct();

        $this->setJsEditProduct();
        $this->outputEditProduct();
    }
688629
public function delete($product_id)
    {
        $result = null;
        $this->hook->attach('product.related.delete.before', $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        foreach (array('product_id', 'item_product_id') as $field) {
            if (!$this->db->delete('product_related', array($field => $product_id))) {
                return false;
            }
        }

        $this->hook->attach('product.related.delete.after', $product_id, $result, $this);
        return (bool) $result;
    }
1333296
public function deleteProduct($productId)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_PRODUCT_DELETE_URL . 'access_token=' . $this->getAccessToken(), [
            'product_id' => $productId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
1368318
public function canDelete($file_id)
    {
        $sql = 'SELECT NOT EXISTS (SELECT file_id FROM product_sku WHERE file_id=:id)';
        return (bool) $this->db->fetchColumn($sql, array('id' => (int) $file_id));
    }