Questions tagged [methods]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
72 views

How can we check context object list for observer in magento2

I want to know context object list which we can use methods directly from $context object in Observer. Just like in below URl. Magento2 – Use Defined Methods from Context Object URL:- https://webkul....
0
votes
1answer
47 views

Create custom payment gateway in Magento 2?

Which class we need to extends,implement interface and method use when create a custom payment gateway.
2
votes
3answers
149 views

Difference between load() and get() methods

While going through the Magento code I have been seeing a lot of instances of: $objectName->load($foo) or $objectName->get($foo) and I was wondering, what is the difference between the 'load'...
0
votes
0answers
65 views

Magento2 Custom api with Two methods

I followed below link to create custom api. https://belvg.com/blog/how-to-create-custom-api-in-magento-2.html. Where 2 methods are written in that first method is working but calling rest/V1/test1 ...
0
votes
2answers
304 views

Save method is not working for products

I want to resave all products programmatically. So I am trying to use the below code to achieve it. But the save method is not working in it. I have placed the code in the root directory of my Magento ...
0
votes
1answer
152 views

How does '@method Address setCollectShippingRates(int $value)' work?

Magento 2.2, Clsss 'Magento\Quote\Model\Quote\Address'. I cannot find body of method 'setCollectShippingRates()'. <?php namespace Magento\Quote\Model\Quote; /** * Sales Quote address model * ...
0
votes
1answer
321 views

Custom Payment Methods not showing on checkout

Preconditions Magento 2.1.9 PHP 5.6 Ubuntu 16 Expected result Many choices payment method Actual result here is log exception.log: [2018-03-28 19:38:24] main.CRITICAL: exception 'Exception' with ...
1
vote
0answers
17 views

How to create soap api method to sign up in magento website from facebook account?

I want to create a soap api method for sign up from facebook login details. In which I will use user facebook id and password from user and create magento website sign up from this detail
1
vote
1answer
671 views

magento 2 unable to set the values for product collection using service contract from custom module?

I am trying to form a custom format for product collection(getList) using service-contract concept in magento 2 i am able to add keys but i am unable to add values to the response object can you ...
11
votes
1answer
417 views

How to override a static method in Magento2

Plugin Interceptors and overriding with preference does not work on static methods. Need to override getOptionArray method in Magento\Catalog\Model\Product\Visibility to return a custom visibility ...
2
votes
1answer
1k views

Magento 2 multiple shipping options on checkout

Is there a way to create something like: Free Shipping 3 days delivery (+5£) Next day Delivery (+9£) so the customer can choose on checkout? Is there a module to do this?
0
votes
1answer
603 views

CURL request using DELETE method in Magento 2

I am trying to call a curl request for delete method using Magento\Framework\HTTP\Client\Curl.php. In this class makeRequest method is responsible for sending curl request. But as I can see that ...
1
vote
2answers
211 views

$this->getOrders()

I am using Magento 1.7. In recent.phtml under app/design/frontend/default/custom_theme/template/sales/order, there is the following call: $_orders = $this->getOrders(); and later on $_orders is ...
0
votes
1answer
75 views

Empty getAddToCompareUrl only in guest mode

I have this variable $_compareUrl=$this->getAddToCompareUrl($_product) to get compare url but this is empty in guest mode, only when i signed in magento it's not empty. I recently migrate from ...
0
votes
1answer
14 views

Repositories and Methods

Does anybody have a link where I can find a list of all Magento 2.1 (or Magento 2) repositories and their methods? I tried to find this in Magento Devdocs and can't seem to find anything. Maybe I am ...
0
votes
1answer
50 views

Are commented methods good practice?

When looking inside Magento 2 core code, I found some commented methods, as it was in Magento 1 : * @method string getState() * @method string getStatus() I know how it works technically, and the ...
0
votes
2answers
107 views

How to define methods inside of Plugin in Magento 2

I try to overwrite get_url() function located in item.php from this path \vendor\magento\module-catalog\Model\Layer\Filter\Item.php For this, i created a PLUGIN, and my code it's this one: <?php ...
0
votes
1answer
671 views

Rest api with same route of different entity type and using put and post method

<routes> <route_collection> <route>/cart/addtocart/:device_id/:product_id/:qty</route> <action_type>collection</action_type> </...
2
votes
1answer
49 views

How to know all available methods and how to use them [closed]

I'm still learning how to use Magento and I see that it has lots of useful methods. However, my only way of learning that a method exists, and how to use it, remains looking at code that's already ...
1
vote
2answers
1k views

Magento 2 My Orders->Order Shipments->Track this shipment results in Invalid method error

(magento 2.0.10) My Orders->Order Shipments->Track this shipment->after click. Invalid method Magento\Framework\View\Element\Template::formatDeliveryDateTime(Array ( [0] => 2016-11-22 ...
2
votes
1answer
1k views

magento 2: where are methods ($_product->getResource()->getAttribute($_code)->getFrontend()->getValue($_product)) declared?

lets say in my catalog_product_view.xml I have this additional Block: <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.demo" template="product/view/warranty.phtml" ...
0
votes
2answers
1k views

Invalid method Mage_Core_Block_Template::getProducts(Array

I am trying to call getProducts method from content.phtml file. Block file: class AdminModules_Topjob_Block_Topjob extends Mage_Core_Block_Template { public function getProducts($pro_cond,...
1
vote
3answers
353 views

Why can i pass in unlimited argument as injection in constructor of magento2?

In my understanding, argument passed to a function/method are strictly mapped to your function call, and the arguments must be arranged in correct order to map what you pass in your function call. e....
2
votes
1answer
710 views

Magento 2: Custom function – best place to put it?

I've created a little function for one of my template (.phtml) files which I'd like to re-use in a few other template files. All the function does is concatenate a couple of strings together and trim ...
2
votes
2answers
119 views

What methods typically go in Model, Resource and Collection

I'm fairly new to Magento, coming from a Symfony/Laravel background. Magento's ORM implementation seems a bit confusing at first. Most resource/collection classes only seem to have a _construct() ...
3
votes
1answer
135 views

Where does Magento implement methods?

I am new to Magento. I have following code in a template file called brand.html $brandImageUrl = $this->getBrandImageUrl($brand); My understanding (roughly) is that $this refers to an instance of ...
2
votes
1answer
763 views

getIdentities() what it does? [duplicate]

I get a warrning on Magento\Catalog\Block\Product\ListProduct->getIdentities() Warning: Invalid argument supplied for foreach() I checked the specified method but I do not understand what does ...
2
votes
1answer
166 views

Understanding code and pratical

I have been reading a lot of blog from Alan strom and Magento tutorials and i have gained a lot, still blurry but good. Now i am at a point, where i need to put everything together. I am really lost ...
1
vote
1answer
530 views

Magento 2: Updated file not working

I want to update the class Select and its getValuesHTML() method which is saved here: module-catalog/Block/Product/View/Options/Type/Select.php I have made a copy of this file and placed it in my ...
0
votes
1answer
155 views

Reusing methods from other blocks in custom block

Having a custom Block where I fetch custom data what is the accepted workaround to inject the methods in this custom Block from another block. Having the following situation I fetch in my custom ...
0
votes
2answers
903 views

Error : Call to undefined method addStoreFilter()

my manufactorer manage grid can't filter at store column. Uncaught Error: Call to undefined method Magebuzz_Manufacturer_Model_Mysql4_Manufacturer_Collection::addStoreFilter() prepare column: ...
1
vote
0answers
83 views

How to instantiate my new class and methods

I'm looking to trigger anything on a /admin/customer/edit just to know it's working.. an echo or print.. I have this code below. app/code/community/YourModule/etc/config.xml <global> <...
0
votes
1answer
25 views

Magento 2 method call evrrytime on reload

hi I am newb to magento and I am looking for certain process through which magento will call some method every time whenever its frontend or backend reloads
1
vote
1answer
272 views

layouts - make a sibling my child

lets say there's the following hierarchy of blocks: <block name="parent"> <block name="child" /> </block> and I want to push a block of my own inside "parent", and put the ...
1
vote
1answer
34 views

Where do you place common methods that you use throughout your module

I have a method that is going to be called in multiple files in my module: public function getStore(){ $order = Mage::registry('current_order'); $store_id = $order->...
0
votes
1answer
698 views

Can not access payment methods tab in magento back office

I installed the last version available of Magento 1.9.2.1. I try to access the payment methods tab as an admin and I have this error: Fatal error: Call to a member function setAllowedTypes() on a non-...
2
votes
1answer
558 views

invalid method in /lib/Varien/Object.php after update, causing maintenance mode

I just updated some modules and now my webshop keeps showing the maintenance page, whilst there is not maintenance.flag file in the root folder. I checked the /var/log and in the exception.log it ...
0
votes
2answers
2k views

How is getContinueShoppingUrl() called by Mage::getSingleton('checkout/session')?

I'm using Magento 1.9 and am trying to gain a better understanding of the method, getContinueShoppingUrl(), when called by Mage::getSingleton('checkout/session') but can't seem to find the file that ...
1
vote
0answers
21 views

Method is being called from the “wrong” class - undefined method error [duplicate]

I have a CE Magento 1.9 application that is using a custom theme from Trego and a checkout extension from Webtex. The application was functioning but then after installing the checkout extension, I ...
0
votes
1answer
373 views

Magento becomes unresponsive / hangs while trying to save config in System > Configuration > Payment methods

currently i have two payment methods for my site . cash on delivery is working fine. but when i try to make payment using payumoney. then after placing the order it should redirect to payumoney ...
4
votes
1answer
120 views

<Namespace>_<module>_Model_<module>::_construct() not allowing method calls

I'm having a curious problem in model's _construct function. When the model is instantiated I would like to call a method to pull and save an access key from a database into a class property so it is ...
0
votes
1answer
4k views

Invalid method Mage_Core_Block_Template::methodblock

here is a block file: <?php class webhive_ManageUrl_Block_Monblock extends Mage_Core_Block_Template { public function methodblock() { return 'informations about my block !!' ; } } view ...
0
votes
1answer
640 views

What does this code do in magento? $this->_init('weblog/blogpost');

This is my model Class <?php class Magentotutorial_Weblog_Model_Blogpost extends Mage_Core_Model_Abstract { protected function _construct() { $this->_init('weblog/blogpost'); } } ?> My ...
4
votes
1answer
5k views

What is _init() return what is use of init() function?

I want to know About what is _init() do in magento? $this->_initSometext();
2
votes
1answer
2k views

What is __prepareLayout Function Return and what is hasData and setData perform ?

public function _prepareLayout() { return parent::_prepareLayout(); } And public function getVire() { if (!$this->hasData('vire')) { $this->setData('vire', Mage::...
0
votes
2answers
87 views

What does this code do in magento?

What does this code do in magento ? $customer = $this->_getCustomer(); this code in createPostAction in customer/accountController . Why put underscore "_" in most of Method
2
votes
2answers
873 views

what does setObject function do in magento?

<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?> this code call 'customer/...
2
votes
1answer
414 views

I want to override Mage_Sales_Model_Quote_Item

I want to override Mage_Sales_Model_Quote_Item I have already made the extended file in my extension but I am not able to call it please help me .
1
vote
3answers
1k views

How to get products attributes and use them as condition to set shipping price

Below is my setShippingCost function in my Observer.php: public function setShippingCost($evt){ $session = Mage::getSingleton('checkout/session'); $quote = Mage::getSingleton('checkout/...
1
vote
1answer
3k views

Add two methods to the same event in the observer

Hi I need help with the following I created a new method in for sales/model/observer.php as follows class Company_Sales_Model_Observer { public function addid(Varien_Event_Observer $observer) ...