Hello, I am new to OpenCart. I have an API that takes in a file and some data from a form and creates a price for printing services. I have developed the form that submits the data to the API and the API returns an array that has the pricing information based on a file uploaded. How can I have OpenCart use the price generated for the product.
Cheers!
more info is needed.. I don't know your API
But If you use some additional api, when you receive prices update just record it's to DB product table something like this...
But If you use some additional api, when you receive prices update just record it's to DB product table something like this...
Code: Select all
$products = array(//array of your products data received from API);
foreach( $products as $product) {
$this->db->query("UPDATE `" . DB_PREFIX . "product` SET `price` = '" . (float)$product['price'] . "', `date_modified` = NOW() WHERE `product_id` = '" . (int)$product['product_id'] . "'");
}
//Of course if your received products array contains this data like "product_id" and "price"
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
Who is online
Users browsing this forum: No registered users and 264 guests