本文整理汇总了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'));
}