번들 제품을 다른 번들 제품에 추가하려고합니다. 내 상태를 달성하는 것은 매우 간단합니다. 파일이 같은 /app/code/Mage/Bundle/etc/config.xml
편집 :Magento - 번들 제품 번들 제품 (거의 작동 중)
...
<allowed_selection_types>
<simple/>
<bundle/> <!-- Add this at line 104-->
<virtual/>
</allowed_selection_types>
...
그렇게함으로써를 성공적 그것의 안에 다른 번들 제품 번들 제품을 만들 수 있습니다!
제 문제는이 제품을 AdminPanel 또는 SOAP (트로프 프론트 엔드를 사용하지는 않았지만 아마도 작동하지 않음)를 통해 주문에 추가 할 수 없다는 것입니다.
[19-Jun-2013 15:52:48 UTC] PHP Fatal error: Call to a member function getPosition() on a non-object in app\code\core\Mage\Bundle\Model\Product\Type.php on line 865
충돌이 shakeSelections($a, $b)
에서 발생합니다 : 코드 $a->getOption()
는 객체를 반환하지 않습니다
나는 다음과 같은 오류가 관리자 패널에 "주문 선정 제품 (들)을 추가"를 클릭
. null이 아니며 객체도 아닙니다 (저는 PHP noobie이므로 이해가되지 않습니다).
지금 내가 카트에 제품의 새로운 종류를 추가 할 수있어 == 업데이트 ==!
...
/*
* Create extra attributes that will be converted to product options in order item
* for selection (not for all bundle)
*/
$price = $product->getPriceModel()->getSelectionFinalTotalPrice($product, $selection, 0, $qty);
$attributes = array(
'price' => Mage::app()->getStore()->convertPrice($price),
'qty' => $qty,
'option_label' => is_null($selection->getOption()) ? '' : $selection->getOption()->getTitle(),
'option_id' => is_null($selection->getOption()) ? 0 : $selection->getOption()->getId()
);
$type = $selection->getTypeInstance(true);
if (get_class($type) != 'Mage_Bundle_Model_Product_Type'){
$_result = $selection->getTypeInstance(true)->prepareForCart($buyRequest, $selection);
}
...
또한 아래의 기능 :
public function shakeSelections($a, $b)
{
$ta = $a->getOption();
$tb = $b->getOption();
$aPosition = array(
is_null($ta) ? 0 : $ta->getPosition(),
$a->getOptionId(),
$a->getPosition(),
$a->getSelectionId()
);
$bPosition = array(
is_null($tb) ? 0 : $tb->getPosition(),
$b->getOptionId(),
$b->getPosition(),
$b->getSelectionId()
);
if ($aPosition == $bPosition) {
return 0;
} else {
return $aPosition < $bPosition ? -1 : 1;
}
}
나는 마법사 \ 번들 \ 모델 \ 제품 \ Type.php, 그래서 지금은 다음과 같은 코드가 \ 파일 응용 프로그램 \ 코드 \ 코어를 편집 한
내가 도입 한 가능한 부작용을 발견하기 위해 조사 중입니다. 현재이 묶음 제품 번들의 재고 관리에 문제가 있다는 것을 알았습니다.
추가 정보가 있으면 추후에 보내주십시오. 고마워요!
내 진행 상황을 따라 아마 어떻게 든 나를 도울 수 있도록 내가 GitHub의에서이 REPO을 시작했습니다
== 둘째 편집 ==.
https://github.com/matheusjadimb/MagentoBundleOfBundled
1.7에서 1.9로 업그레이드하는 작업을 수행 할 때 핵심 파일을 덮어 쓰기 때문에 어려움을 겪을 수 있습니다. – bogatyrjov