Magento Forum

delete and attribute value using sql
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();

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

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.


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