Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

delete and attribute value using sql
 
marc
Jr. Member
 
Total Posts:  7
Joined:  2007-09-02
 

i’m using saved credit card to process orders, the site currently stores the encrypted credit card number and the encrypted ccv number. When i invoice the order i want it to delete these numbers or replace them with xxxxxx ect but i am having trouble using sql to delete the right value.

i am currently setting this up in the app/code/core/mage/sales/model/order/invoice.php

and want it to work something like this, it connects to the database fine but i dont know or cant figure out the sql query to use which references the sales_quote_entity_varchar table with the actual order number: smile

public function pay()
{

$order id = $this->getOrderId();
$conn = Mage::getModel(’Core/Mysql4_Config’)->getReadConnection();
$conn->query(

UPDATE sales_quote_entity_varchar
SET value = xxx
WHERE orderId = $order id AND attribute_Id = 222);


$this->setState(self::STATE_PAID);
$this->getOrder()->getPayment()->pay($this);
$this->getOrder()->setTotalPaid(
$this->getOrder()->getTotalPaid()+$this->getGrandTotal()
);
$this->getOrder()->setBaseTotalPaid(
$this->getOrder()->getBaseTotalPaid()+$this->getBaseGrandTotal()
);
Mage::dispatchEvent(’sales_order_invoice_pay’, array($this->_eventObject=>$this));
return $this;
}

I’m sure that makes no sense, but if it does to someone i would much appreciate your help.

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top