-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
executable file
·43 lines (35 loc) · 1.63 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Silvercart configurable product
after you install this module in silvercart, the several steps of modification in the core code.
1 SilvercartProductGroupPage.php
in init function register addCartForm
// BBQ 05,04,2014 configurable product register addCartForm
if($product->IsConfigurableProduct){
$childrenProducts = $product->ChildrenProducts();
if($childrenProducts->Count()){
foreach($childrenProducts as $childproduct){
$this->registerCustomHtmlForm(
'SilvercartProductAddCartFormDetail'.$childproduct->ID,
new SilvercartProductAddCartFormDetail(
$this,
array(
'productID' => $childproduct->ID,
)
)
);
}
}
}
// BBQ 05,04,2014 configurable product register addCartForm
in getProducts function add condition
//BBQ 05,04,2014 add configurable product
$filter .= " and IsChildProduct = 0 " ;
//BBQ 05,04,2014 add configurable product
2 SilvercartProduct.php
modify the Link function to configurable product.
// BBQ 05,04,2014 configurable product
$configurableProduct = SilvercartConfigurableProductBridge::get_one('SilvercartConfigurableProductBridge' , 'TargetID =' . $this->ID);
if($configurableProduct){
$product = DataObject::get_by_id('SilvercartProduct', $configurableProduct->SourceID);
$link = $this->SilvercartProductGroup()->OriginalLink() . $product->ID . '/' . $product->title2urlSegment();
}
// BBQ 05,04,2014 configurable product