本文整理匯總了PHP中ps_product::get_weight方法的典型用法代碼示例。如果您正苦於以下問題:PHP ps_product::get_weight方法的具體用法?PHP ps_product::get_weight怎麽用?PHP ps_product::get_weight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ps_product
的用法示例。
在下文中一共展示了ps_product::get_weight方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: vmGet
function change_product_item_price()
{
require_once CLASSPATH . 'ps_product.php';
global $VM_LANG, $vmLogger, $mosConfig_offset;
$ps_product = new ps_product();
$order_item_id = vmGet($_REQUEST, 'order_item_id');
$product_item_price_new = trim(vmGet($_REQUEST, 'product_item_price'));
$product_final_price_new = trim(vmGet($_REQUEST, 'product_final_price'));
$db = new ps_DB();
// Added, to read user_info_id
$q = "SELECT user_info_id, product_id, product_quantity, product_final_price, product_item_price, product_final_price - product_item_price AS item_tax ";
$q .= "FROM #__{vm}_order_item WHERE order_id = '" . $this->order_id . "' ";
$q .= "AND order_item_id = '" . addslashes($order_item_id) . "'";
$db->query($q);
$db->next_record();
$product_id = $db->f('product_id');
$timestamp = time() + $mosConfig_offset * 60 * 60;
$user_info_id = $db->f('user_info_id');
$prod_weight = $ps_product->get_weight($product_id);
$my_taxrate = $ps_product->get_product_taxrate($product_id, $prod_weight, $user_info_id);
$product_item_price = $db->f('product_item_price');
$product_final_price = $db->f('product_final_price');
$quantity = $db->f('product_quantity');
if (is_numeric($product_item_price_new)) {
$product_final_price_new = round($product_item_price_new * ($my_taxrate + 1), 2);
}
$product_item_price_new = $product_final_price_new / ($my_taxrate + 1);
$q = "UPDATE #__{vm}_order_item ";
$q .= "SET product_item_price = " . $product_item_price_new . ", ";
$q .= "product_final_price = " . $product_final_price_new . ", ";
$q .= "mdate = " . $timestamp . " ";
$q .= "WHERE order_item_id = '" . addslashes($order_item_id) . "'";
$db->query($q);
$db->next_record();
$this->recalc_order($this->order_id);
$this->reload_from_db = 1;
$vmLogger->info($VM_LANG->_('PHPSHOP_ORDER_PRINT_PRICE') . $VM_LANG->_('PHPSHOP_ORDER_EDIT_SOMETHING_HAS_CHANGED'));
}