朋友寫了一個腳本來獲取所選產品的產品ID和產品數量。 那就是:自定義變量=>產品ID /數量
$product_id_string = $_POST['custom'];
$product_id_string = rtrim($product_id_string, ",");
$id_values = array();
$id_str_array = explode(",", $product_id_string);
$fullAmount = 0;
foreach ($id_str_array as $key => $value) {
$id_quantity_pair = explode("-", $value);
$product_id = $id_quantity_pair[0]; // product ID
$product_quantity = $id_quantity_pair[1]; // product quantity
}
我怎麼理解它...的產品ID和它的數量是讀剛出來的自定義變量的? 問候!
你真正的問題是什麼?你卡在哪裏? – Rikesh
歡迎來到Stack Overflow。請在發佈任何內容之前閱讀[** FAQ **](http://stackoverflow.com/faq) –
例如:在我的paypal-buy-button中我有custom = 123456。 –