Skip to content

Commit

Permalink
edit files
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv8888 committed Jul 4, 2017
1 parent 679c891 commit 4efd7bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/code/PDP/Integration/Helper/PdpOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ public function getLinkDesignPdp($sku) {
}
if($proId) {
$url = $this->getUrlToolDesign().'/?pid='.$proId;
} elseif( strpos($sku,'CustomDismensionProd') !== false ) {
$url = $this->getUrlToolDesign().'/?width=594&height=420&unit=mm&size_layout=Landscape&custom=1';
}
}
return $url;
Expand Down
11 changes: 7 additions & 4 deletions app/code/PDP/Integration/Model/Pdpproduct/PdpItemRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ public function save(\PDP\Integration\Api\Data\PdpItemInterface $pdpItem)
$infoRequest['custom_size_layout'] = $customSize->getSizeLayout();
$additionalOptions[] = array('label' => __('Size layout'), 'value' => $customSize->getSizeLayout());
}
$pdpProductId = $product->getEntityId();
} else {
$pdpProductId = $pdpItem->getEntityId();
}
if(isset($dataOpt['product_color']['color_price']) && $dataOpt['product_color']['color_price']) {
$color_price = $dataOpt['product_color']['color_price'];
Expand Down Expand Up @@ -241,7 +244,7 @@ public function save(\PDP\Integration\Api\Data\PdpItemInterface $pdpItem)
$data = array(
'item_id' => $itemId,
'product_id' => $__quoteItem->getProductId(),
'pdp_product_id' => $pdpItem->getEntityId(),
'pdp_product_id' => $pdpProductId,
'sku' => $pdpItem->getSku(),
'store_id' => $__quoteItem->getStoreId(),
'value' => serialize($dataOpt)
Expand Down Expand Up @@ -275,7 +278,7 @@ public function save(\PDP\Integration\Api\Data\PdpItemInterface $pdpItem)
$data = array(
'item_id' => $itemId,
'product_id' => $itembypro->getProductId(),
'pdp_product_id' => $pdpItem->getEntityId(),
'pdp_product_id' => $pdpProductId,
'sku' => $pdpItem->getSku(),
'store_id' => $itembypro->getStoreId(),
'value' => serialize($dataOpt)
Expand Down Expand Up @@ -326,7 +329,7 @@ public function save(\PDP\Integration\Api\Data\PdpItemInterface $pdpItem)
$data = array(
'item_id' => $itemId,
'product_id' => $__quoteItem->getProductId(),
'pdp_product_id' => $pdpItem->getEntityId(),
'pdp_product_id' => $pdpProductId,
'sku' => $pdpItem->getSku(),
'store_id' => $__quoteItem->getStoreId(),
'value' => serialize($dataOpt)
Expand Down Expand Up @@ -360,7 +363,7 @@ public function save(\PDP\Integration\Api\Data\PdpItemInterface $pdpItem)
$data = array(
'item_id' => $itemId,
'product_id' => $itembypro->getProductId(),
'pdp_product_id' => $pdpItem->getEntityId(),
'pdp_product_id' => $pdpProductId,
'sku' => $pdpItem->getSku(),
'store_id' => $itembypro->getStoreId(),
'value' => serialize($dataOpt)
Expand Down
4 changes: 3 additions & 1 deletion app/code/PDP/Integration/Observer/LoadGuestDesign.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ private function _loadCustomerQuote() {
$proId = $value['type_id'];
}
}
if($proId) {
$product = $item->getProduct();
if($product->getTypeId() == 'pdpro') {
if(!$proId) $proId = $item->getProductId();
$requestOptions = $item->getBuyRequest();
foreach($dataObjQuoteItem as $_key => $dataQuote) {
if($requestOptions->getDesignId() == $dataQuote['design_id'] && $item->getProductId() == $dataQuote['product_id'] && $proId == $dataQuote['pdp_product_id']) {
Expand Down

0 comments on commit 4efd7bd

Please sign in to comment.