Skip to content

Instantly share code, notes, and snippets.

@Schrank
Created February 20, 2016 12:19
Show Gist options
  • Save Schrank/1b23920bb4adeaf9ca27 to your computer and use it in GitHub Desktop.
Save Schrank/1b23920bb4adeaf9ca27 to your computer and use it in GitHub Desktop.
From 9577ab235d9ad56b0020bc0a77ffb6b11cc28f3b Mon Sep 17 00:00:00 2001
From: Fabian Blechschmidt <[email protected]>
Date: Mon, 15 Feb 2016 22:44:12 +0100
Subject: [PATCH] fix broken methods and templates
---
app/code/local/MST/Fancycheckout/controllers/LoadController.php | 6 ++++--
app/code/local/MST/Fancycheckout/controllers/SaveController.php | 5 ++---
.../fancycheckout/checkout/billing/billing_shipping_address.phtml | 5 +++--
.../fancycheckout/checkout/review/review_info/product_info.phtml | 5 +++--
4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/app/code/local/MST/Fancycheckout/controllers/LoadController.php b/app/code/local/MST/Fancycheckout/controllers/LoadController.php
index 49acc22..060d5f8 100644
--- a/app/code/local/MST/Fancycheckout/controllers/LoadController.php
+++ b/app/code/local/MST/Fancycheckout/controllers/LoadController.php
@@ -393,7 +393,9 @@ The maximum quantity allowed for "'.$item->getProduct()->getName().'" is '.(int)
}
}
}
- Mage::getModel('customer/session')->setData('message',$result['error']);
+ if(isset($result['error'])) {
+ Mage::getModel('customer/session')->setData('message',$result['error']);
+ }
$this->_redirectUrl(Mage::getBaseUrl().'fancycheckout');
}
@@ -456,4 +458,4 @@ The maximum quantity allowed for "'.$item->getProduct()->getName().'" is '.(int)
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
}
}
-?>
\ No newline at end of file
+?>
diff --git a/app/code/local/MST/Fancycheckout/controllers/SaveController.php b/app/code/local/MST/Fancycheckout/controllers/SaveController.php
index 3b04ac1..56bbba7 100644
--- a/app/code/local/MST/Fancycheckout/controllers/SaveController.php
+++ b/app/code/local/MST/Fancycheckout/controllers/SaveController.php
@@ -236,10 +236,10 @@ class MST_Fancycheckout_SaveController extends Mage_Checkout_Controller_Action
if (isset($redirectUrl)) {
$redirect_checkout = $redirectUrl;
}else{
- $redirect_checkout = $result['redirect'];
+ $redirect_checkout = isset($result['redirect']) ? $result['redirect'] : '';
}
if($result['success']){
- if($redirectUrl){
+ if(isset($redirectUrl)){
$url = $redirectUrl;
}else{
$url = Mage::getBaseUrl().'checkout/onepage/success';
@@ -258,4 +258,3 @@ class MST_Fancycheckout_SaveController extends Mage_Checkout_Controller_Action
}
}
}
-?>
\ No newline at end of file
diff --git a/app/design/frontend/base/default/template/fancycheckout/checkout/billing/billing_shipping_address.phtml b/app/design/frontend/base/default/template/fancycheckout/checkout/billing/billing_shipping_address.phtml
index 898ebe9..8714e01 100644
--- a/app/design/frontend/base/default/template/fancycheckout/checkout/billing/billing_shipping_address.phtml
+++ b/app/design/frontend/base/default/template/fancycheckout/checkout/billing/billing_shipping_address.phtml
@@ -1,5 +1,6 @@
<div class="opc_billing opc_bill_to_adress">
- <?php
+ <?php
+ $validate_product = '';
$mage_ver = Mage::helper('fancycheckout')->getMagentoVersion();
$logged = $this->isCustomerLoggedIn();
$has_addr = $this->customerHasAddresses();
@@ -770,4 +771,4 @@
<?php } ?>
//]]>
</script>
-</div>
\ No newline at end of file
+</div>
diff --git a/app/design/frontend/base/default/template/fancycheckout/checkout/review/review_info/product_info.phtml b/app/design/frontend/base/default/template/fancycheckout/checkout/review/review_info/product_info.phtml
index 0d72ae9..297d193 100644
--- a/app/design/frontend/base/default/template/fancycheckout/checkout/review/review_info/product_info.phtml
+++ b/app/design/frontend/base/default/template/fancycheckout/checkout/review/review_info/product_info.phtml
@@ -1,7 +1,8 @@
<div class="load_review loading_image" >
<img src="<?php echo $this->getSkinUrl('fancycheckout/images/loading.gif') ?>" />
</div>
-<?php
+<?php
+ $canApplyMsrp = false;
echo $this->getChildHtml('items_before');
$ennable_delete_product_cart = trim(Mage::getStoreConfig('fancycheckout/review/product_cart_remove'));
$ennable_thumbnail_product = trim(Mage::getStoreConfig('fancycheckout/review/thumbnail_product'));
@@ -375,4 +376,4 @@
});
});
});
-</script>
\ No newline at end of file
+</script>
--
2.5.4 (Apple Git-61)
From 88cca90c30e5d66bc4d9b5bd1b6867ec50370f38 Mon Sep 17 00:00:00 2001
From: Fabian Blechschmidt <[email protected]>
Date: Fri, 19 Feb 2016 17:32:33 +0100
Subject: [PATCH] fix more bugs in fancycheckout
---
.../controllers/OffcanvascheckoutController.php | 17 ++++++++++++-----
.../step2/billing_shipping_address.phtml | 3 ++-
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/app/code/local/MST/Fancycheckout/controllers/OffcanvascheckoutController.php b/app/code/local/MST/Fancycheckout/controllers/OffcanvascheckoutController.php
index cc07cfe..06f6065 100644
--- a/app/code/local/MST/Fancycheckout/controllers/OffcanvascheckoutController.php
+++ b/app/code/local/MST/Fancycheckout/controllers/OffcanvascheckoutController.php
@@ -2,6 +2,8 @@
require_once 'Mage/Checkout/controllers/CartController.php';
class MST_Fancycheckout_OffcanvascheckoutController extends Mage_Checkout_CartController
{
+ private $_current_layout;
+
public function getFancycheckout()
{
return Mage::getSingleton('fancycheckout/data');
@@ -111,6 +113,7 @@ class MST_Fancycheckout_OffcanvascheckoutController extends Mage_Checkout_CartCo
{
$cart = $this->_getCart();
$params = $this->getRequest()->getParams();
+ $qty_product_added_to_cart = array();
if(!$params['qty']){$params['qty'] = 1;}
if($params['isAjax'] == 1){
$response = array();
@@ -154,7 +157,10 @@ class MST_Fancycheckout_OffcanvascheckoutController extends Mage_Checkout_CartCo
}
}
}
- }
+ }
+ if(!isset($qty_product_added_to_cart[$product_id])) {
+ $qty_product_added_to_cart[$product_id] = 0;
+ }
if(Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id)->getManageStock() == 1)
{
if((int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id)->getQty() >= $params['qty'] + $qty_product_added_to_cart[$product_id]){
@@ -1135,7 +1141,7 @@ The maximum quantity allowed for "'.$item->getProduct()->getName().'" is '.(int)
}
}
if(Mage::getStoreConfig('fancycheckout/registration/type') == 3){
- if($bill_data['register_account'] == 1){
+ if(isset($bill_data['register_account']) && $bill_data['register_account'] == 1){
if(isset($bill_data['customer_password']) && isset($bill_data['confirm_password'])){
if(strlen(trim($bill_data['customer_password'])) == 0 && strlen(trim($bill_data['confirm_password']))== 0)
{
@@ -1253,11 +1259,12 @@ The maximum quantity allowed for "'.$item->getProduct()->getName().'" is '.(int)
}
}
}
- if(count($response)>0){
+ if(isset($response) && count($response)>0){
$response['success'] = false;
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
}else{
- $response['success'] == true;
+ $response = array();
+ $response['success'] = true;
$bill_data = $this->_filterPostData($bill_data);
$bill_addr_id = $this->getRequest()->getPost('billing_address_id', false);
$ship_updated = false;
@@ -2129,4 +2136,4 @@ The maximum quantity allowed for "'.$item->getProduct()->getName().'" is '.(int)
}
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
}
-}
\ No newline at end of file
+}
diff --git a/app/design/frontend/base/default/template/fancycheckout/offcanvascheckout/step2/billing_shipping_address.phtml b/app/design/frontend/base/default/template/fancycheckout/offcanvascheckout/step2/billing_shipping_address.phtml
index d907415..0ae14ef 100644
--- a/app/design/frontend/base/default/template/fancycheckout/offcanvascheckout/step2/billing_shipping_address.phtml
+++ b/app/design/frontend/base/default/template/fancycheckout/offcanvascheckout/step2/billing_shipping_address.phtml
@@ -1,4 +1,5 @@
-<?php
+<?php
+ $validate_product = '';
$mage_ver = Mage::helper('fancycheckout')->getMagentoVersion();
$logged = $this->isCustomerLoggedIn();
$has_addr = $this->customerHasAddresses();
--
2.5.4 (Apple Git-61)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment