お世話になっております。
なんとか自力でやろうとしたのですが
途中で頭が混乱して、上手くできませんでした。
下記が一応、自作したもので、多く間違っているとは思いますが
方向性的には合っているでしょうか。
もしよろしければご確認頂ければ幸いです。
どうぞよろしくお願い致します。
==========================
規格1:ライター
下記パターンの場合、
product_class_id=29 classcategory_id1=7
product_class_id=30 classcategory_id1=7
にライターをカートに入れるようにしたいです。
ライター:product_Id=16 , product_class_id=65
==========================
public function addProduct($product_class_id, $quantity){
$objProduct = new SC_Product_Ex();
$arrProduct = $objProduct->getProductsClass($product_class_id);{
if($arrProduct.product_class_id == '29' or '30'){
functionisTargetProduct($productTypeId=='1',$productId=='16') {
$max= $this->getMax($productTypeId);
for($i= 0; $i<= $max; $i++) {
if($this->cartSession[$productTypeId][$i]['cart_no'] != "") {
if( $this->cartSession[$productTypeId][$i]["productsClass"]["product_id"]==$productId){
return true;
}
}
}
return false;
}
if($this->isHoge = $objCartSess->isTargetProduct($cart_key,$target_productId);)else{
addProduct($product_class_id=='16', $quantity=='1')
}
$productTypeId = $arrProduct['product_type_id'];
$find = false;
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['id'] == $product_class_id) {
$val = $this->cartSession[$productTypeId][$i]['quantity'] + $quantity;
if (strlen($val) <= INT_LEN) {
$this->cartSession[$productTypeId][$i]['quantity'] += $quantity;
}
$find = true;
}
}
}