rewrite - Magento Overwriting Block -
moved to:
I work on a Magento job And I have been dabbled in dark art since a while I am currently writing a small script which will override the shipping methods on the checkout screen.
App / code / local / cl ic studios / shipment filter /etc/config.xml
& lt; Global & gt; & Lt; Block & gt; & Lt; Checkout & gt; & Lt; Rewrite & gt; & Lt; Onepage_shipping_method_available & gt; ClarkStudios_Shipmentfilter_Block_Onepage_Shipping_Method_Available & lt; / Onepage_shipping_method_available & gt; & Lt; / Rewrite & gt; & Lt; / Checkout & gt; & Lt; / Block & gt; & Lt; / Global & gt;
App / code / local / cl ic studios / shipment filter / block / onpage / shipping / method / available.fip
Square ClarkStudios_Shipmentfilter_Block_Onepage_Shipping_Method_ Available Mage_Checkout_Block_Onepage_Shipping_Method_ is available {public function getShippingRates () ($ 'HAHAHAHAHAH!'); $ Rate = original :: get shipping rights ($); $ 2_kg_array = array ('au', 'us', 'ca' 'BR', 'VE'); $ Quote = Dana :: getSingleton ('Checkout / Session') -> GetQuote (); $ Shipping_country = $ this- & gt; Get () -> GetShippingAddress () ) - & gt; getCountry (); $ weight = $ Coat-> getShippingAddress () - & gt; getWeight (); if (in_array ($ shipping_ count, $ two_kg_array) & amp; amp; amp; amp; $ weight> 2) {$ rates = array (); } If ($ shipping_graha, $ 2_kg_array) and amp; $ weight> gt; 30) {$ rates = array ();} return to $ rate;}}
I think (! It seems that Magento is not recognizing my block rewrite, fire seems to die. I have probably done something fundamental wrong here, but the hand held in the right direction will be highly appreciated.
I should know that depending on the weight of the car, I want to change which shipping methods on one page checkout page. For the first time, I want to set a fire on the funeral so that I wish it. I also flashed the cache.
Steve
You missed your class in your config.xml File
. So you should have config.xml
,
And, you have lost the Checkout directory, you should have a directory structure,
ap / code / local / cl ic studios / shipment filter / block / checkout / Onepage / shipping / method / available.fip
then your class should be
I've added Helper config.xml. So your assistant should be, Helper / Data.php
Finally we were overwriting onepage checkout. So anything goes wrong if you can not move to the next level, (I mean you did not get any message) then the use of die ()
is not used. Just print some values or something
Comments
Post a Comment