Custom extension not displaying additional fee in admin order view page The Next CEO of Stack OverflowAdmin Order Grid overridden with custom fields cannot be filteredMagento custom module with custom database table admin pageCustom button in adminhtml order view page : how to run php script on click?Instead of attribute value, its displaying array of ids in view pageOrder information is not displayingWhite screen in order view at magento adminController 404 Page Not Found [Extension Dev]Exeption error when adding new custom Tab to Order View page in AdminHow can I get admin order view blocks into a custom module pageInvoice is not displaying in Invoice tab in admin order view - Magento 1
MessageLevel in QGIS3
Rotate a column
Why do remote companies require working in the US?
Why does standard notation not preserve intervals (visually)
Are there any limitations on attacking while grappling?
Can we say or write : "No, it'sn't"?
Interfacing a button to MCU (and PC) with 50m long cable
Bold, vivid family
How do we know the LHC results are robust?
Is 'diverse range' a pleonastic phrase?
How do scammers retract money, while you can’t?
Won the lottery - how do I keep the money?
What happens if you roll doubles 3 times then land on "Go to jail?"
Sending manuscript to multiple publishers
Why does the UK parliament need a vote on the political declaration?
Why didn't Khan get resurrected in the Genesis Explosion?
Is it possible to search for a directory/file combination?
Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?
How does the mv command work with external drives?
In excess I'm lethal
Is it my responsibility to learn a new technology in my own time my employer wants to implement?
Is there a way to save my career from absolute disaster?
Why has the US not been more assertive in confronting Russia in recent years?
Multiple labels for a single equation
Custom extension not displaying additional fee in admin order view page
The Next CEO of Stack OverflowAdmin Order Grid overridden with custom fields cannot be filteredMagento custom module with custom database table admin pageCustom button in adminhtml order view page : how to run php script on click?Instead of attribute value, its displaying array of ids in view pageOrder information is not displayingWhite screen in order view at magento adminController 404 Page Not Found [Extension Dev]Exeption error when adding new custom Tab to Order View page in AdminHow can I get admin order view blocks into a custom module pageInvoice is not displaying in Invoice tab in admin order view - Magento 1
I am currently developing a custom extension and i am stucked at the admin order view page.
Let me describe my problem with images so you can get it easier.
Here is a screenshot of the page before an order is created (in the frontend):
Here is a screenshot of the page in the admin panel where you can see the created order details (in the admin panel):
My entire problem is that the extension is not displaying the SMS Notification
amount in the admin order view page. As you can see in the order view page the amount of 0.50
is included in the Grand Total, but it is not displayed in the row for SMS Notification
.
Now i'm going to post all the files of the extension i think may have any role for the resolving of the problem.
I have in: /store/app/code/community/VivasIndustries/SmsNotification/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<VivasIndustries_SmsNotification>
<version>1.0.0</version>
</VivasIndustries_SmsNotification>
</modules>
<global>
<models>
<smsnotification>
<class>VivasIndustries_SmsNotification_Model</class>
<resourceModel>vivasindustries_smsnotification_resource</resourceModel>
</smsnotification>
<vivasindustries_smsnotification_resource>
<class>VivasIndustries_SmsNotification_Model_Resource</class>
<entities>
<smsnotification>
<table>VivasIndustries_SmsNotification</table>
</smsnotification>
<smsnotificationhistory>
<table>VivasIndustries_SmsHistory</table>
</smsnotificationhistory>
</entities>
</vivasindustries_smsnotification_resource>
</models>
<resources>
<smsnotification_setup>
<setup>
<module>VivasIndustries_SmsNotification</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</smsnotification_setup>
<smsnotification_read>
<connection>
<use>core_read</use>
</connection>
</smsnotification_read>
<smsnotification_write>
<connection>
<use>core_write</use>
</connection>
</smsnotification_write>
</resources>
<events>
<checkout_type_onepage_save_order_after> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_onepage_save_order_after_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotal</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_onepage_save_order_after_smsprice_handler>
</observers>
</checkout_type_onepage_save_order_after>
<checkout_type_multishipping_create_orders_single> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_multishipping_create_orders_single_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotalForMultishipping</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_multishipping_create_orders_single_smsprice_handler>
</observers>
</checkout_type_multishipping_create_orders_single>
<sales_order_save_after>
<observers>
<vivasindustries_smsnotification>
<class>smsnotification/observer</class>
<method>orderSaved</method>
</vivasindustries_smsnotification>
</observers>
</sales_order_save_after>
</events>
<sales>
<quote>
<totals>
<smsprice_total>
<class>smsnotification/quote_address_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</quote>
<order_invoice>
<totals>
<smsprice_total>
<class>smsnotification/order_invoice_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_invoice>
<order_creditmemo>
<totals>
<smsprice_total>
<class>percentpayment/order_creditmemo_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_creditmemo>
</sales>
<helpers>
<smsnotification>
<class>VivasIndustries_SmsNotification_Helper</class>
</smsnotification>
</helpers>
<blocks>
<smsnotification>
<class>VivasIndustries_SmsNotification_Block</class>
</smsnotification>
</blocks>
</global>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<vivas>
<title>Vivas - All</title>
</vivas>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<smsnotification>
<file>smsnotification.xml</file>
</smsnotification>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<VivasIndustries_SmsNotification before="Mage_Adminhtml">VivasIndustries_SmsNotification_Adminhtml</VivasIndustries_SmsNotification>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<default>
<vivas>
<smspricegroup>
<smsprice_name>SMS Notification</smsprice_name>
<smsprice_fee>0.5</smsprice_fee>
</smspricegroup>
</vivas>
</default>
</config>
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Data extends Mage_Core_Helper_Abstract
public function formatFee($amount)
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__($SmspriceLabel);
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Adminhtml/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Adminhtml_Data extends Mage_Adminhtml_Helper_Data
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Newordertotalobserver.php
<?php
class VivasIndustries_SmsNotification_Model_Newordertotalobserver
public function saveSmspriceTotal(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$quote = $observer -> getEvent() -> getQuote();
$shippingAddress = $quote -> getShippingAddress();
if($shippingAddress && $shippingAddress -> getData('smsprice_total'))
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
else
$billingAddress = $quote -> getBillingAddress();
$order -> setData('smsprice_total', $billingAddress -> getData('smsprice_total'));
$order -> save();
public function saveSmspriceTotalForMultishipping(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$address = $observer -> getEvent() -> getAddress();
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
$order -> save();
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Quote/Address/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Quote_Address_Total_Smsprice extends Mage_Sales_Model_Quote_Address_Total_Abstract
public function __construct()
$this -> setCode('smsprice_total');
public function getSmsPriceStatus()
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
return ($EnableSmsPrice);
public function collect(Mage_Sales_Model_Quote_Address $address)
parent :: collect($address);
$items = $this->_getAddressItems($address);
if (!count($items))
return $this;
$quote= $address->getQuote();
if($this->getSmsPriceStatus())
$discountAmount = Mage::getStoreConfig('vivas/smspricegroup/smsprice_fee');
$address->setSmspriceAmount($discountAmount);
$address->setBaseSmspriceAmount($discountAmount);
$quote->setSmspriceAmount($discountAmount);
//amount definition
$discountAmount = $quote -> getStore() -> roundPrice($discountAmount);
$this -> _setAmount($discountAmount) -> _setBaseAmount($discountAmount);
$address->setData('smsprice_total',$discountAmount);
return $this;
public function fetch(Mage_Sales_Model_Quote_Address $address)
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
if($this->getSmsPriceStatus())
parent :: fetch($address);
$amount = $address -> getTotalAmount($this -> getCode());
if ($amount != 0)
$address -> addTotal(array(
'code' => $this -> getCode(),
'title' => $this -> getLabel(),
'value' => $amount
));
return $address;
public function getLabel()
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__("$SmspriceLabel:");
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Invoice/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Invoice_Total_Smsprice
extends Mage_Sales_Model_Order_Invoice_Total_Abstract
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
$order=$invoice->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal&&count($order->getInvoiceCollection())==0)
$invoice->setGrandTotal($invoice->getGrandTotal()+$orderDiscountTotal);
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Creditmemo/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Creditmemo_Total_Smsprice
extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
return $this;
$order = $creditmemo->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal)
$creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$orderDiscountTotal);
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Resource/Smsnotification/Collection.php:
<?php
class VivasIndustries_SmsNotification_Model_Resource_Smsnotification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
protected function _construct()
$this->_init('smsnotification/smsnotification');
I have in: /store/app/code/community/VivasIndustries/SmsNotification/sql/smsnotification_setup/mysql4-install-1.0.0.php:
<?php
$installer=$this;
$installer->startSetup();
$installer->run("
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsNotification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`state` varchar(500) NOT NULL,
`smstext` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsHistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`receiver` varchar(500) NOT NULL,
`phone` varchar(500) NOT NULL,
`email` varchar(500) NOT NULL,
`smstext` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
/*$installer->run("
ALTER TABLE `".$this->getTable('sales/quote_address')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
ALTER TABLE `".$this->getTable('sales/order')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
"); */
$installer->addAttribute("quote_address", "smsprice_total", array("type"=>"varchar"));
$installer->addAttribute("order", "smsprice_total", array("type"=>"varchar"));
$installer->endSetup();
?>
So guys these are all files for which i think may be important for the resolving of my problem. Please if you need any more information let me know.
php ce-1.9.0.1
add a comment |
I am currently developing a custom extension and i am stucked at the admin order view page.
Let me describe my problem with images so you can get it easier.
Here is a screenshot of the page before an order is created (in the frontend):
Here is a screenshot of the page in the admin panel where you can see the created order details (in the admin panel):
My entire problem is that the extension is not displaying the SMS Notification
amount in the admin order view page. As you can see in the order view page the amount of 0.50
is included in the Grand Total, but it is not displayed in the row for SMS Notification
.
Now i'm going to post all the files of the extension i think may have any role for the resolving of the problem.
I have in: /store/app/code/community/VivasIndustries/SmsNotification/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<VivasIndustries_SmsNotification>
<version>1.0.0</version>
</VivasIndustries_SmsNotification>
</modules>
<global>
<models>
<smsnotification>
<class>VivasIndustries_SmsNotification_Model</class>
<resourceModel>vivasindustries_smsnotification_resource</resourceModel>
</smsnotification>
<vivasindustries_smsnotification_resource>
<class>VivasIndustries_SmsNotification_Model_Resource</class>
<entities>
<smsnotification>
<table>VivasIndustries_SmsNotification</table>
</smsnotification>
<smsnotificationhistory>
<table>VivasIndustries_SmsHistory</table>
</smsnotificationhistory>
</entities>
</vivasindustries_smsnotification_resource>
</models>
<resources>
<smsnotification_setup>
<setup>
<module>VivasIndustries_SmsNotification</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</smsnotification_setup>
<smsnotification_read>
<connection>
<use>core_read</use>
</connection>
</smsnotification_read>
<smsnotification_write>
<connection>
<use>core_write</use>
</connection>
</smsnotification_write>
</resources>
<events>
<checkout_type_onepage_save_order_after> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_onepage_save_order_after_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotal</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_onepage_save_order_after_smsprice_handler>
</observers>
</checkout_type_onepage_save_order_after>
<checkout_type_multishipping_create_orders_single> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_multishipping_create_orders_single_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotalForMultishipping</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_multishipping_create_orders_single_smsprice_handler>
</observers>
</checkout_type_multishipping_create_orders_single>
<sales_order_save_after>
<observers>
<vivasindustries_smsnotification>
<class>smsnotification/observer</class>
<method>orderSaved</method>
</vivasindustries_smsnotification>
</observers>
</sales_order_save_after>
</events>
<sales>
<quote>
<totals>
<smsprice_total>
<class>smsnotification/quote_address_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</quote>
<order_invoice>
<totals>
<smsprice_total>
<class>smsnotification/order_invoice_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_invoice>
<order_creditmemo>
<totals>
<smsprice_total>
<class>percentpayment/order_creditmemo_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_creditmemo>
</sales>
<helpers>
<smsnotification>
<class>VivasIndustries_SmsNotification_Helper</class>
</smsnotification>
</helpers>
<blocks>
<smsnotification>
<class>VivasIndustries_SmsNotification_Block</class>
</smsnotification>
</blocks>
</global>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<vivas>
<title>Vivas - All</title>
</vivas>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<smsnotification>
<file>smsnotification.xml</file>
</smsnotification>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<VivasIndustries_SmsNotification before="Mage_Adminhtml">VivasIndustries_SmsNotification_Adminhtml</VivasIndustries_SmsNotification>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<default>
<vivas>
<smspricegroup>
<smsprice_name>SMS Notification</smsprice_name>
<smsprice_fee>0.5</smsprice_fee>
</smspricegroup>
</vivas>
</default>
</config>
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Data extends Mage_Core_Helper_Abstract
public function formatFee($amount)
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__($SmspriceLabel);
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Adminhtml/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Adminhtml_Data extends Mage_Adminhtml_Helper_Data
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Newordertotalobserver.php
<?php
class VivasIndustries_SmsNotification_Model_Newordertotalobserver
public function saveSmspriceTotal(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$quote = $observer -> getEvent() -> getQuote();
$shippingAddress = $quote -> getShippingAddress();
if($shippingAddress && $shippingAddress -> getData('smsprice_total'))
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
else
$billingAddress = $quote -> getBillingAddress();
$order -> setData('smsprice_total', $billingAddress -> getData('smsprice_total'));
$order -> save();
public function saveSmspriceTotalForMultishipping(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$address = $observer -> getEvent() -> getAddress();
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
$order -> save();
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Quote/Address/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Quote_Address_Total_Smsprice extends Mage_Sales_Model_Quote_Address_Total_Abstract
public function __construct()
$this -> setCode('smsprice_total');
public function getSmsPriceStatus()
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
return ($EnableSmsPrice);
public function collect(Mage_Sales_Model_Quote_Address $address)
parent :: collect($address);
$items = $this->_getAddressItems($address);
if (!count($items))
return $this;
$quote= $address->getQuote();
if($this->getSmsPriceStatus())
$discountAmount = Mage::getStoreConfig('vivas/smspricegroup/smsprice_fee');
$address->setSmspriceAmount($discountAmount);
$address->setBaseSmspriceAmount($discountAmount);
$quote->setSmspriceAmount($discountAmount);
//amount definition
$discountAmount = $quote -> getStore() -> roundPrice($discountAmount);
$this -> _setAmount($discountAmount) -> _setBaseAmount($discountAmount);
$address->setData('smsprice_total',$discountAmount);
return $this;
public function fetch(Mage_Sales_Model_Quote_Address $address)
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
if($this->getSmsPriceStatus())
parent :: fetch($address);
$amount = $address -> getTotalAmount($this -> getCode());
if ($amount != 0)
$address -> addTotal(array(
'code' => $this -> getCode(),
'title' => $this -> getLabel(),
'value' => $amount
));
return $address;
public function getLabel()
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__("$SmspriceLabel:");
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Invoice/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Invoice_Total_Smsprice
extends Mage_Sales_Model_Order_Invoice_Total_Abstract
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
$order=$invoice->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal&&count($order->getInvoiceCollection())==0)
$invoice->setGrandTotal($invoice->getGrandTotal()+$orderDiscountTotal);
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Creditmemo/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Creditmemo_Total_Smsprice
extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
return $this;
$order = $creditmemo->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal)
$creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$orderDiscountTotal);
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Resource/Smsnotification/Collection.php:
<?php
class VivasIndustries_SmsNotification_Model_Resource_Smsnotification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
protected function _construct()
$this->_init('smsnotification/smsnotification');
I have in: /store/app/code/community/VivasIndustries/SmsNotification/sql/smsnotification_setup/mysql4-install-1.0.0.php:
<?php
$installer=$this;
$installer->startSetup();
$installer->run("
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsNotification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`state` varchar(500) NOT NULL,
`smstext` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsHistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`receiver` varchar(500) NOT NULL,
`phone` varchar(500) NOT NULL,
`email` varchar(500) NOT NULL,
`smstext` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
/*$installer->run("
ALTER TABLE `".$this->getTable('sales/quote_address')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
ALTER TABLE `".$this->getTable('sales/order')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
"); */
$installer->addAttribute("quote_address", "smsprice_total", array("type"=>"varchar"));
$installer->addAttribute("order", "smsprice_total", array("type"=>"varchar"));
$installer->endSetup();
?>
So guys these are all files for which i think may be important for the resolving of my problem. Please if you need any more information let me know.
php ce-1.9.0.1
add a comment |
I am currently developing a custom extension and i am stucked at the admin order view page.
Let me describe my problem with images so you can get it easier.
Here is a screenshot of the page before an order is created (in the frontend):
Here is a screenshot of the page in the admin panel where you can see the created order details (in the admin panel):
My entire problem is that the extension is not displaying the SMS Notification
amount in the admin order view page. As you can see in the order view page the amount of 0.50
is included in the Grand Total, but it is not displayed in the row for SMS Notification
.
Now i'm going to post all the files of the extension i think may have any role for the resolving of the problem.
I have in: /store/app/code/community/VivasIndustries/SmsNotification/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<VivasIndustries_SmsNotification>
<version>1.0.0</version>
</VivasIndustries_SmsNotification>
</modules>
<global>
<models>
<smsnotification>
<class>VivasIndustries_SmsNotification_Model</class>
<resourceModel>vivasindustries_smsnotification_resource</resourceModel>
</smsnotification>
<vivasindustries_smsnotification_resource>
<class>VivasIndustries_SmsNotification_Model_Resource</class>
<entities>
<smsnotification>
<table>VivasIndustries_SmsNotification</table>
</smsnotification>
<smsnotificationhistory>
<table>VivasIndustries_SmsHistory</table>
</smsnotificationhistory>
</entities>
</vivasindustries_smsnotification_resource>
</models>
<resources>
<smsnotification_setup>
<setup>
<module>VivasIndustries_SmsNotification</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</smsnotification_setup>
<smsnotification_read>
<connection>
<use>core_read</use>
</connection>
</smsnotification_read>
<smsnotification_write>
<connection>
<use>core_write</use>
</connection>
</smsnotification_write>
</resources>
<events>
<checkout_type_onepage_save_order_after> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_onepage_save_order_after_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotal</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_onepage_save_order_after_smsprice_handler>
</observers>
</checkout_type_onepage_save_order_after>
<checkout_type_multishipping_create_orders_single> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_multishipping_create_orders_single_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotalForMultishipping</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_multishipping_create_orders_single_smsprice_handler>
</observers>
</checkout_type_multishipping_create_orders_single>
<sales_order_save_after>
<observers>
<vivasindustries_smsnotification>
<class>smsnotification/observer</class>
<method>orderSaved</method>
</vivasindustries_smsnotification>
</observers>
</sales_order_save_after>
</events>
<sales>
<quote>
<totals>
<smsprice_total>
<class>smsnotification/quote_address_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</quote>
<order_invoice>
<totals>
<smsprice_total>
<class>smsnotification/order_invoice_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_invoice>
<order_creditmemo>
<totals>
<smsprice_total>
<class>percentpayment/order_creditmemo_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_creditmemo>
</sales>
<helpers>
<smsnotification>
<class>VivasIndustries_SmsNotification_Helper</class>
</smsnotification>
</helpers>
<blocks>
<smsnotification>
<class>VivasIndustries_SmsNotification_Block</class>
</smsnotification>
</blocks>
</global>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<vivas>
<title>Vivas - All</title>
</vivas>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<smsnotification>
<file>smsnotification.xml</file>
</smsnotification>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<VivasIndustries_SmsNotification before="Mage_Adminhtml">VivasIndustries_SmsNotification_Adminhtml</VivasIndustries_SmsNotification>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<default>
<vivas>
<smspricegroup>
<smsprice_name>SMS Notification</smsprice_name>
<smsprice_fee>0.5</smsprice_fee>
</smspricegroup>
</vivas>
</default>
</config>
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Data extends Mage_Core_Helper_Abstract
public function formatFee($amount)
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__($SmspriceLabel);
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Adminhtml/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Adminhtml_Data extends Mage_Adminhtml_Helper_Data
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Newordertotalobserver.php
<?php
class VivasIndustries_SmsNotification_Model_Newordertotalobserver
public function saveSmspriceTotal(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$quote = $observer -> getEvent() -> getQuote();
$shippingAddress = $quote -> getShippingAddress();
if($shippingAddress && $shippingAddress -> getData('smsprice_total'))
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
else
$billingAddress = $quote -> getBillingAddress();
$order -> setData('smsprice_total', $billingAddress -> getData('smsprice_total'));
$order -> save();
public function saveSmspriceTotalForMultishipping(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$address = $observer -> getEvent() -> getAddress();
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
$order -> save();
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Quote/Address/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Quote_Address_Total_Smsprice extends Mage_Sales_Model_Quote_Address_Total_Abstract
public function __construct()
$this -> setCode('smsprice_total');
public function getSmsPriceStatus()
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
return ($EnableSmsPrice);
public function collect(Mage_Sales_Model_Quote_Address $address)
parent :: collect($address);
$items = $this->_getAddressItems($address);
if (!count($items))
return $this;
$quote= $address->getQuote();
if($this->getSmsPriceStatus())
$discountAmount = Mage::getStoreConfig('vivas/smspricegroup/smsprice_fee');
$address->setSmspriceAmount($discountAmount);
$address->setBaseSmspriceAmount($discountAmount);
$quote->setSmspriceAmount($discountAmount);
//amount definition
$discountAmount = $quote -> getStore() -> roundPrice($discountAmount);
$this -> _setAmount($discountAmount) -> _setBaseAmount($discountAmount);
$address->setData('smsprice_total',$discountAmount);
return $this;
public function fetch(Mage_Sales_Model_Quote_Address $address)
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
if($this->getSmsPriceStatus())
parent :: fetch($address);
$amount = $address -> getTotalAmount($this -> getCode());
if ($amount != 0)
$address -> addTotal(array(
'code' => $this -> getCode(),
'title' => $this -> getLabel(),
'value' => $amount
));
return $address;
public function getLabel()
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__("$SmspriceLabel:");
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Invoice/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Invoice_Total_Smsprice
extends Mage_Sales_Model_Order_Invoice_Total_Abstract
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
$order=$invoice->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal&&count($order->getInvoiceCollection())==0)
$invoice->setGrandTotal($invoice->getGrandTotal()+$orderDiscountTotal);
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Creditmemo/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Creditmemo_Total_Smsprice
extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
return $this;
$order = $creditmemo->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal)
$creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$orderDiscountTotal);
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Resource/Smsnotification/Collection.php:
<?php
class VivasIndustries_SmsNotification_Model_Resource_Smsnotification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
protected function _construct()
$this->_init('smsnotification/smsnotification');
I have in: /store/app/code/community/VivasIndustries/SmsNotification/sql/smsnotification_setup/mysql4-install-1.0.0.php:
<?php
$installer=$this;
$installer->startSetup();
$installer->run("
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsNotification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`state` varchar(500) NOT NULL,
`smstext` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsHistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`receiver` varchar(500) NOT NULL,
`phone` varchar(500) NOT NULL,
`email` varchar(500) NOT NULL,
`smstext` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
/*$installer->run("
ALTER TABLE `".$this->getTable('sales/quote_address')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
ALTER TABLE `".$this->getTable('sales/order')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
"); */
$installer->addAttribute("quote_address", "smsprice_total", array("type"=>"varchar"));
$installer->addAttribute("order", "smsprice_total", array("type"=>"varchar"));
$installer->endSetup();
?>
So guys these are all files for which i think may be important for the resolving of my problem. Please if you need any more information let me know.
php ce-1.9.0.1
I am currently developing a custom extension and i am stucked at the admin order view page.
Let me describe my problem with images so you can get it easier.
Here is a screenshot of the page before an order is created (in the frontend):
Here is a screenshot of the page in the admin panel where you can see the created order details (in the admin panel):
My entire problem is that the extension is not displaying the SMS Notification
amount in the admin order view page. As you can see in the order view page the amount of 0.50
is included in the Grand Total, but it is not displayed in the row for SMS Notification
.
Now i'm going to post all the files of the extension i think may have any role for the resolving of the problem.
I have in: /store/app/code/community/VivasIndustries/SmsNotification/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<VivasIndustries_SmsNotification>
<version>1.0.0</version>
</VivasIndustries_SmsNotification>
</modules>
<global>
<models>
<smsnotification>
<class>VivasIndustries_SmsNotification_Model</class>
<resourceModel>vivasindustries_smsnotification_resource</resourceModel>
</smsnotification>
<vivasindustries_smsnotification_resource>
<class>VivasIndustries_SmsNotification_Model_Resource</class>
<entities>
<smsnotification>
<table>VivasIndustries_SmsNotification</table>
</smsnotification>
<smsnotificationhistory>
<table>VivasIndustries_SmsHistory</table>
</smsnotificationhistory>
</entities>
</vivasindustries_smsnotification_resource>
</models>
<resources>
<smsnotification_setup>
<setup>
<module>VivasIndustries_SmsNotification</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</smsnotification_setup>
<smsnotification_read>
<connection>
<use>core_read</use>
</connection>
</smsnotification_read>
<smsnotification_write>
<connection>
<use>core_write</use>
</connection>
</smsnotification_write>
</resources>
<events>
<checkout_type_onepage_save_order_after> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_onepage_save_order_after_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotal</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_onepage_save_order_after_smsprice_handler>
</observers>
</checkout_type_onepage_save_order_after>
<checkout_type_multishipping_create_orders_single> <!-- identifier of the event we want to catch -->
<observers>
<checkout_type_multishipping_create_orders_single_smsprice_handler> <!-- identifier of the event handler -->
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
<class>smsnotification/newordertotalobserver</class> <!-- observers class alias -->
<method>saveSmspriceTotalForMultishipping</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</checkout_type_multishipping_create_orders_single_smsprice_handler>
</observers>
</checkout_type_multishipping_create_orders_single>
<sales_order_save_after>
<observers>
<vivasindustries_smsnotification>
<class>smsnotification/observer</class>
<method>orderSaved</method>
</vivasindustries_smsnotification>
</observers>
</sales_order_save_after>
</events>
<sales>
<quote>
<totals>
<smsprice_total>
<class>smsnotification/quote_address_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</quote>
<order_invoice>
<totals>
<smsprice_total>
<class>smsnotification/order_invoice_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_invoice>
<order_creditmemo>
<totals>
<smsprice_total>
<class>percentpayment/order_creditmemo_total_smsprice</class>
<after>subtotal,freeshipping,tax_subtotal,shipping</after>
<before>grand_total</before>
</smsprice_total>
</totals>
</order_creditmemo>
</sales>
<helpers>
<smsnotification>
<class>VivasIndustries_SmsNotification_Helper</class>
</smsnotification>
</helpers>
<blocks>
<smsnotification>
<class>VivasIndustries_SmsNotification_Block</class>
</smsnotification>
</blocks>
</global>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<vivas>
<title>Vivas - All</title>
</vivas>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<smsnotification>
<file>smsnotification.xml</file>
</smsnotification>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<VivasIndustries_SmsNotification before="Mage_Adminhtml">VivasIndustries_SmsNotification_Adminhtml</VivasIndustries_SmsNotification>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<default>
<vivas>
<smspricegroup>
<smsprice_name>SMS Notification</smsprice_name>
<smsprice_fee>0.5</smsprice_fee>
</smspricegroup>
</vivas>
</default>
</config>
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Data extends Mage_Core_Helper_Abstract
public function formatFee($amount)
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__($SmspriceLabel);
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Helper/Adminhtml/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Adminhtml_Data extends Mage_Adminhtml_Helper_Data
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Newordertotalobserver.php
<?php
class VivasIndustries_SmsNotification_Model_Newordertotalobserver
public function saveSmspriceTotal(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$quote = $observer -> getEvent() -> getQuote();
$shippingAddress = $quote -> getShippingAddress();
if($shippingAddress && $shippingAddress -> getData('smsprice_total'))
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
else
$billingAddress = $quote -> getBillingAddress();
$order -> setData('smsprice_total', $billingAddress -> getData('smsprice_total'));
$order -> save();
public function saveSmspriceTotalForMultishipping(Varien_Event_Observer $observer)
$order = $observer -> getEvent() -> getOrder();
$address = $observer -> getEvent() -> getAddress();
$order -> setData('smsprice_total', $shippingAddress -> getData('smsprice_total'));
$order -> save();
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Quote/Address/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Quote_Address_Total_Smsprice extends Mage_Sales_Model_Quote_Address_Total_Abstract
public function __construct()
$this -> setCode('smsprice_total');
public function getSmsPriceStatus()
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
return ($EnableSmsPrice);
public function collect(Mage_Sales_Model_Quote_Address $address)
parent :: collect($address);
$items = $this->_getAddressItems($address);
if (!count($items))
return $this;
$quote= $address->getQuote();
if($this->getSmsPriceStatus())
$discountAmount = Mage::getStoreConfig('vivas/smspricegroup/smsprice_fee');
$address->setSmspriceAmount($discountAmount);
$address->setBaseSmspriceAmount($discountAmount);
$quote->setSmspriceAmount($discountAmount);
//amount definition
$discountAmount = $quote -> getStore() -> roundPrice($discountAmount);
$this -> _setAmount($discountAmount) -> _setBaseAmount($discountAmount);
$address->setData('smsprice_total',$discountAmount);
return $this;
public function fetch(Mage_Sales_Model_Quote_Address $address)
$EnableSmsPrice = Mage::getStoreConfig('vivas/smspricegroup/smsprice_active');
if($this->getSmsPriceStatus())
parent :: fetch($address);
$amount = $address -> getTotalAmount($this -> getCode());
if ($amount != 0)
$address -> addTotal(array(
'code' => $this -> getCode(),
'title' => $this -> getLabel(),
'value' => $amount
));
return $address;
public function getLabel()
$SmspriceLabel = Mage::getStoreConfig('vivas/smspricegroup/smsprice_name');
return Mage::helper('smsnotification')->__("$SmspriceLabel:");
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Invoice/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Invoice_Total_Smsprice
extends Mage_Sales_Model_Order_Invoice_Total_Abstract
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
$order=$invoice->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal&&count($order->getInvoiceCollection())==0)
$invoice->setGrandTotal($invoice->getGrandTotal()+$orderDiscountTotal);
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Order/Creditmemo/Total/Smsprice.php:
<?php
class VivasIndustries_SmsNotification_Model_Order_Creditmemo_Total_Smsprice
extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
return $this;
$order = $creditmemo->getOrder();
$orderDiscountTotal = $order->getSmspriceTotal();
if ($orderDiscountTotal)
$creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$orderDiscountTotal);
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$orderDiscountTotal);
return $this;
I have in: /store/app/code/community/VivasIndustries/SmsNotification/Model/Resource/Smsnotification/Collection.php:
<?php
class VivasIndustries_SmsNotification_Model_Resource_Smsnotification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
protected function _construct()
$this->_init('smsnotification/smsnotification');
I have in: /store/app/code/community/VivasIndustries/SmsNotification/sql/smsnotification_setup/mysql4-install-1.0.0.php:
<?php
$installer=$this;
$installer->startSetup();
$installer->run("
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsNotification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`state` varchar(500) NOT NULL,
`smstext` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `VivasIndustries_SmsHistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`receiver` varchar(500) NOT NULL,
`phone` varchar(500) NOT NULL,
`email` varchar(500) NOT NULL,
`smstext` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
/*$installer->run("
ALTER TABLE `".$this->getTable('sales/quote_address')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
ALTER TABLE `".$this->getTable('sales/order')."` ADD `smsprice_total` DECIMAL( 10, 2 ) NOT NULL;
"); */
$installer->addAttribute("quote_address", "smsprice_total", array("type"=>"varchar"));
$installer->addAttribute("order", "smsprice_total", array("type"=>"varchar"));
$installer->endSetup();
?>
So guys these are all files for which i think may be important for the resolving of my problem. Please if you need any more information let me know.
php ce-1.9.0.1
php ce-1.9.0.1
edited 12 mins ago
Teja Bhagavan Kollepara
3,01241949
3,01241949
asked May 7 '15 at 17:33
Venelin VasilevVenelin Vasilev
59232554
59232554
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This module should have in Block/Adminhtml/Sales at least an Order.php class that extends Mage_Sales_Block_Order_Totals, eg:
class Company_Sms_Block_Adminhtml_Sales_Order extends Mage_Sales_Block_Order_Totals
protected function _initTotals()
parent::_initTotals();
$smsAmount = $this->getOrder()->getSmsAmount();
if ($smsAmount != 0)
$this->addTotal(
new Varien_Object(
array(
'code' => 'sms',
'value' => $smsAmount,
'label' => $helper->__('Some Text'),
)
));
return $this;
Then in the config.xml you should also add something like this:
<adminhtml>
<rewrite>
<sales_order_totals>Company_Sms_Block_Adminhtml_Sales_Order</sales_order_totals>
</rewrite>
</adminhtml>
And also in config.xml you should have this so the new value gets from the quote to the order:
<fieldsets>
<sales_convert_quote_address>
<sms_amount>
<to_order>*</to_order>
</sms_amount>
</sales_convert_quote_address>
</fieldsets>
Aditionally you could check in your DB in sales_flat_order and sales_flat_quote for the value for smsprice_total. If it's 0 there then the code above (fieldsets), if all the rest is good, should fix it.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f67093%2fcustom-extension-not-displaying-additional-fee-in-admin-order-view-page%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This module should have in Block/Adminhtml/Sales at least an Order.php class that extends Mage_Sales_Block_Order_Totals, eg:
class Company_Sms_Block_Adminhtml_Sales_Order extends Mage_Sales_Block_Order_Totals
protected function _initTotals()
parent::_initTotals();
$smsAmount = $this->getOrder()->getSmsAmount();
if ($smsAmount != 0)
$this->addTotal(
new Varien_Object(
array(
'code' => 'sms',
'value' => $smsAmount,
'label' => $helper->__('Some Text'),
)
));
return $this;
Then in the config.xml you should also add something like this:
<adminhtml>
<rewrite>
<sales_order_totals>Company_Sms_Block_Adminhtml_Sales_Order</sales_order_totals>
</rewrite>
</adminhtml>
And also in config.xml you should have this so the new value gets from the quote to the order:
<fieldsets>
<sales_convert_quote_address>
<sms_amount>
<to_order>*</to_order>
</sms_amount>
</sales_convert_quote_address>
</fieldsets>
Aditionally you could check in your DB in sales_flat_order and sales_flat_quote for the value for smsprice_total. If it's 0 there then the code above (fieldsets), if all the rest is good, should fix it.
add a comment |
This module should have in Block/Adminhtml/Sales at least an Order.php class that extends Mage_Sales_Block_Order_Totals, eg:
class Company_Sms_Block_Adminhtml_Sales_Order extends Mage_Sales_Block_Order_Totals
protected function _initTotals()
parent::_initTotals();
$smsAmount = $this->getOrder()->getSmsAmount();
if ($smsAmount != 0)
$this->addTotal(
new Varien_Object(
array(
'code' => 'sms',
'value' => $smsAmount,
'label' => $helper->__('Some Text'),
)
));
return $this;
Then in the config.xml you should also add something like this:
<adminhtml>
<rewrite>
<sales_order_totals>Company_Sms_Block_Adminhtml_Sales_Order</sales_order_totals>
</rewrite>
</adminhtml>
And also in config.xml you should have this so the new value gets from the quote to the order:
<fieldsets>
<sales_convert_quote_address>
<sms_amount>
<to_order>*</to_order>
</sms_amount>
</sales_convert_quote_address>
</fieldsets>
Aditionally you could check in your DB in sales_flat_order and sales_flat_quote for the value for smsprice_total. If it's 0 there then the code above (fieldsets), if all the rest is good, should fix it.
add a comment |
This module should have in Block/Adminhtml/Sales at least an Order.php class that extends Mage_Sales_Block_Order_Totals, eg:
class Company_Sms_Block_Adminhtml_Sales_Order extends Mage_Sales_Block_Order_Totals
protected function _initTotals()
parent::_initTotals();
$smsAmount = $this->getOrder()->getSmsAmount();
if ($smsAmount != 0)
$this->addTotal(
new Varien_Object(
array(
'code' => 'sms',
'value' => $smsAmount,
'label' => $helper->__('Some Text'),
)
));
return $this;
Then in the config.xml you should also add something like this:
<adminhtml>
<rewrite>
<sales_order_totals>Company_Sms_Block_Adminhtml_Sales_Order</sales_order_totals>
</rewrite>
</adminhtml>
And also in config.xml you should have this so the new value gets from the quote to the order:
<fieldsets>
<sales_convert_quote_address>
<sms_amount>
<to_order>*</to_order>
</sms_amount>
</sales_convert_quote_address>
</fieldsets>
Aditionally you could check in your DB in sales_flat_order and sales_flat_quote for the value for smsprice_total. If it's 0 there then the code above (fieldsets), if all the rest is good, should fix it.
This module should have in Block/Adminhtml/Sales at least an Order.php class that extends Mage_Sales_Block_Order_Totals, eg:
class Company_Sms_Block_Adminhtml_Sales_Order extends Mage_Sales_Block_Order_Totals
protected function _initTotals()
parent::_initTotals();
$smsAmount = $this->getOrder()->getSmsAmount();
if ($smsAmount != 0)
$this->addTotal(
new Varien_Object(
array(
'code' => 'sms',
'value' => $smsAmount,
'label' => $helper->__('Some Text'),
)
));
return $this;
Then in the config.xml you should also add something like this:
<adminhtml>
<rewrite>
<sales_order_totals>Company_Sms_Block_Adminhtml_Sales_Order</sales_order_totals>
</rewrite>
</adminhtml>
And also in config.xml you should have this so the new value gets from the quote to the order:
<fieldsets>
<sales_convert_quote_address>
<sms_amount>
<to_order>*</to_order>
</sms_amount>
</sales_convert_quote_address>
</fieldsets>
Aditionally you could check in your DB in sales_flat_order and sales_flat_quote for the value for smsprice_total. If it's 0 there then the code above (fieldsets), if all the rest is good, should fix it.
answered May 29 '15 at 22:39
lloiaconolloiacono
2,9661338
2,9661338
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f67093%2fcustom-extension-not-displaying-additional-fee-in-admin-order-view-page%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown