I have a oscommerce database with hebrew language and text are inserted in "øôàì" type with charset latin1_swedish_ci . I want to import database to opencart but data are insert in opencart as "רפאל" with charset utf8_general_ci . My question is how i convert "øôàì" type of data in as "רפאל" before inserted into opencart . Please help me solve it .
Thanks
Related
I want to implement a task similar to the one here Getting stock information in opencart 2.3.0.2, but my problem is that when deleting a product, the information about the warehouse will disappear. I want to enter the data into the table order_product, but I still don’t understand how. Help me please.
I can't figure out how to write information about the rest of the goods to the database. I don't understand how to implement it.
Hmm... You want to save product`s stock information in order_product table?
So first you must to add custom field in oc_order_product
ALTER TABLE `oc_order_product` ADD `stock_status` INT(11) NOT NULL AFTER `reward`;
Then in catalog/controller/checkout/confirm.php in $order_data['products'][] = array( You must add key - stock_status
'stock' => $this->model_catalog_product->getProduct($product['product_id'])['stock_status'],
So we modified our controller in customer side, and now our data receive the stock_status.
After receive products data from customer side, we must save in oc_order_table
Open path - catalog/model/checkout/order.php and edit addOrder function... After reward = '" . (int)$product['reward'] . "' in products loop add after comma:
stock_status = '" . $this->db->escape(product['stock_status']) . "'
I write an example, how to save data from customer side about product stock data.
Anyone help me?
"Select List" (name: P2_SHOPS_LIST) that is created with the following SQL
SQL Statement: SELECT SHOP_NAME, GROUP_ID FROM T_ENTRY_SHOPS WHERE ID=:P2_LOV_ID;
It is necessary "GROUP_ID" because it is PK . But I need edit "SHOP_NAME" value and display to Text Field.
I think I can get the currently displayed SHOP_NAME by combining the above SQL with the selection row number, but is there any way to access this value with No SQL? Like
:P2_SHOPS_LIST.SHOP_NAME
(This gave me an error XD).
In the context of JavaScript, you can use the following
$('#P2_SHOPS_LIST option:selected').text()
This can be passed through to PL/SQL via a dynamic action, such as on change of your select list.
Or you could set your text item on change via a JS based action, using 'Set Value' and that code as the expression.
The opencart 3.0.2.0 system will limit users from entering their address in checkout more than 128 characters, is there any possible ways to modify this?
I do have some customers complain to me about this.
You can change it with this query:
ALTER TABLE `oc_address` CHANGE `address_1` `address_1` VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
Note: if your database prefix is not oc_, edit above query and use your actual database prefix.
This query will change the address_1 limit from 128 to 256.
Hi I'm having a problem adding metadata to some jpg images.
I am querying a filemaker database via pyodbc
sql = cur.execute("""SELECT division, attribute_20, brand_name FROM table WHERE item_number=?""", (prod))
row = cur.fetchone()
when I print(row[0]) i get an output of 'BRN' and the type is 'unicode'
However when I try too add this as metadata xmp.set_property(consts.XMP_NS_DC, u'DivisionName', row[0])
it only inputs the first letter. <dc:DivisionName>B</dc:DivisionName>
I have tried converting this to a string but it's the same problem.
Any help would be really appreciated!
Richard
I'm having difficulty getting my pyodbc inserted hyperlinks to work in my Access 2003 database. It appears to look like a hyperlink but does nothing when clicked on. For it to work, I have to edit it in Access and only then does it recognize that, "oh yeah that is a hyperlink".
import pyodbc
cnxn = pyodbc.connect("DRIVER={Microsoft Access Driver (*.mdb)};DBQ= C:\\Users\\multidata\\Documents\\db1.mdb;")
cur = cnxn.cursor()
#hyperlink is the text file. table1 is hyperlink column in ms access
cur.execute("INSERT INTO test(table1, table2) values ('C:\\Users\\multidata\\Desktop\\MC1\\7-31-14_711_EX_2153.txt ', 'y')")
cnxn.commit()
cnxn.close()
A Hyperlink field in Access is a text field containing a number of "parts" separated by hash marks (#). Those various parts are described in the MSDN article here.
If we want to insert a bare URL or file_path into a Hyperlink field we need to enclose it in hash marks, e.g.
import pyodbc
conn_str = (
r'DRIVER={Microsoft Access Driver (*.mdb)};'
r'DBQ=C:\Users\Public\a2003test.mdb;'
)
cnxn = pyodbc.connect(conn_str)
crsr = cnxn.cursor()
hyperlink = r'C:\Users\Gord\Desktop\foo.txt'
sql = "UPDATE Table1 SET docLink=? WHERE ID=1"
crsr.execute(sql, ['#'+hyperlink+'#'])
cnxn.commit()
crsr.close()
cnxn.close()