Questions tagged [object]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
43 views

Object Object Error

I am facing this error [object Object] frequently on the iPhone at the Checkout, on the Homepage, and Add to Cart . I can't reproduce till now, can anybody guide me on how can I can reproduce and fix ...
Rana Zain's user avatar
  • 662
2 votes
1 answer
606 views

Magento 2.4.4 - Module coupon return $object_or_class must be of type object|string, null given

I have updated the Magento 2.4.4 version and also the stripe payment module. I noticed that when I try to save or create a coupon from the Magento backend it comes back this error related to the ...
Jackom's user avatar
  • 493
1 vote
1 answer
82 views

Magento 2: Custom module admin configuration access errror

I have used a custom module and when click on the admin configuration module menu throws the error. This error is facing only in production mode. And faced issue when run php bin/magento setup:di:...
Kirti Nariya's user avatar
  • 3,471
0 votes
0 answers
62 views

How to solve Type Error occurred when creating object: Webkul\MpBlog\Block\Account\Navigation?

1 exception(s): Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Webkul\MpBlog\Block\Account\Navigation Exception #0 (Magento\Framework\Exception\...
Sonali Ghule's user avatar
0 votes
1 answer
115 views

How do I know what data I can access via an observer?

I'm trying to use the sales_order_invoice_pay observer. I can see the dispatch in: /vendor/magento/module-sales/Model/Order/Invoice.php $this->_eventManager->dispatch('sales_order_invoice_pay', [...
William Oakley's user avatar
0 votes
1 answer
308 views

Magento 2 - How to find out which data is available for an object?

I have a quote item: /** * @var \Magento\Quote\Model\QuoteFactory */ protected $_cartFactory; public function __construct( ... \Magento\Checkout\Model\CartFactory $cartFactory, ... ) { ...
Black's user avatar
  • 3,340
0 votes
2 answers
156 views

Issue in extending a model magento 2

I want to extend the Magento\ConfigurableProduct\Helper\Product\Options\Loader as per this github issue https://github.com/magento/magento2/issues/21663#issuecomment-477966963 My di.xml file is <?...
Ramesh KR's user avatar
  • 866
0 votes
1 answer
494 views

Magento 2.3 How to convert JSON response array to array of same type object REST API

I have created a custom api to get review and rating summary: public function getRatingSummary($productId) { $result =[]; $product = $this->_productRepository->getById($productId)...
Adrian Joseph's user avatar
0 votes
2 answers
1k views

Magento 2: How to pass object as a argument from phtml

I want to pass object as a argument from phtml file how can I do this? As I've checked we can pass string using $block->setData('var','test') but didn't found for object.
Dj3's user avatar
  • 101
4 votes
1 answer
590 views

Magento 2 What is Alternative of Zend\Form\Annotation\Object in php 7.2

i was using PHP 7.0 i used to use Zend\Form\Annotation\Object Now i have upgraded my system to 7.2 and Now i am getting an error that PHP Fatal error: Cannot use Zend\Form\Annotation\Object as ...
Waqar Ali's user avatar
  • 2,329
0 votes
1 answer
570 views

Error occurred when creating object

I have a plugin with constructor <?php namespace Vendor\Contact\Plugin\Controller\Index; use \Zend_Validate; use Magento\Contact\Controller\Index\Post; use Magento\Framework\App\Request\Http; use ...
Михайло Годованюк's user avatar
2 votes
1 answer
496 views

Magento 2: Regarding Initialling Interface

As per object oriented programming concept, an interface can not be initialised directly but can be used to implement in other class and the instance of that class can be created. So my question is ...
Kishan Patadia's user avatar
0 votes
1 answer
611 views

How to create empty object of Payment class in Magento 2

I have to create Payment object in vendor/magento/module-paypal/Plugin/OrderCanInvoice.php Is it $foo = new Payment() ? It gives me an error Uncaught ArgumentCountError: Too few arguments to ...
summu's user avatar
  • 847
0 votes
0 answers
465 views

Convert Object to Array

I try to convert my custom Object to Array. Here my Object : Namespace\Project\Model\Custom\Object Object ( [attr1:protected] => value1 [attr2:protected] => value2 [attr3:protected]...
Kozame's user avatar
  • 964
0 votes
1 answer
357 views

How to move first element of object to first Magento 2

My object is something like this object(Magento\Framework\Data\Collection)[8565] protected '_items' => array (size=3) 15841610 => object(Magento\Framework\DataObject)[8701] ...
summu's user avatar
  • 847
0 votes
1 answer
741 views

Magento2: How can I access Zend\Stdlib\Parameters Object array?

I have below result: echo "<pre>"; print_r($data); die(); Result Zend\Stdlib\Parameters Object ( [storage:ArrayObject:private] => Array ( [success_url] => ...
Ravi Soni's user avatar
  • 1,809
0 votes
1 answer
174 views

How to see inside $this object in Magento 2 logger

How can I see inside the $this object in my logger file using prs logger? I tried this \Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->info("in ...
summu's user avatar
  • 847
0 votes
2 answers
424 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....
user7064432's user avatar
2 votes
3 answers
8k views

How to delete object from collection in magento2

How to remove any object from magento 2 collection. If we have collection of products and we want to delete product which is at first index . how to delete that product without deleting it from ...
Ashar Riaz's user avatar
  • 1,035
1 vote
3 answers
3k views

How to convert this object data into array?

I have this Data Object value. Magento\Customer\Model\Data\AttributeMetadata Object ( [_data:protected] => Array ( [frontend_input] => boolean [input_filter] ...
Aditya Shah's user avatar
  • 7,617
2 votes
3 answers
523 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'...
Degnan's user avatar
  • 99
0 votes
2 answers
442 views

How to replace direct use of Object Manager?

in the success.phtml file I currently have a direct use of the object manager, which I am now reading is not best practice. I was wondering how to make a constructor to replace the following code in ...
Degnan's user avatar
  • 99
5 votes
0 answers
240 views

HELP - How to convert Default SOAP-v2 API Magento Objects into XML Values?

In Magento1.9 - product collection by default return values as Magento Objects using soap v2, how can i change into XML, <?php ini_set('display_errors','On'); $proxy = new SoapClient('abc.com/api/...
zus's user avatar
  • 165
1 vote
1 answer
1k views

Magento 1 - Convert Object into an array value

I was trying to get the information of tracking in the UPS. I got on of the method from the core (app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php => method name getTracking($trackings)) that ...
Emipro Technologies Pvt. Ltd.'s user avatar
2 votes
0 answers
625 views

Magento2 - How to return string as object in webapi response?

Can anyone let me know how to return success message with object like this same as magento does for the exception in REST webapi: { "message": "A customer with the same email already exists in an ...
bhargav shastri's user avatar
0 votes
0 answers
1k views

Magento 2 - Update product collection price and reset collection

I want to update product price from the collection and use that collection again. I have written a code for that as per below: $price = 23; foreach ($this->_collection as $key => $value) { ...
Emipro Technologies Pvt. Ltd.'s user avatar
1 vote
0 answers
40 views

Magento magento_default_pages_tmp objectID(10) too big?

I'm trying to use Algolia in Magento for autocomplete search. It tell me that this object is too big.. Now I'm not interested to algolia working or not. My interest is to understand what is this ...
BigBlack's user avatar
  • 133
3 votes
1 answer
208 views

Script error while uploading category image in Magento 2.1.9 using IE11

I have a Magento 2.1.9 installed. When I try to upload an image for a category from backend in the IE11 browser it shows a script error SCRIPT438: Object doesn't support property or method 'set' ...
amesh's user avatar
  • 561
6 votes
2 answers
3k views

Magento 2, How to get Payment infoInterface from order?

I am working on a custom payment method. I am stuck in between where one of my methods required Payment object of \Magento\Payment\Model\InfoInterface But I am getting Magento\Sales\Model\Order\...
Charlie's user avatar
  • 3,136
14 votes
1 answer
5k views

Magento2 plugin around method different between callable and Closure paramters on param $proceed

I have checked magento2 ,There are two types of parameters that can be sent to around method \Closure $proceed example aroundSave(\Magento\Catalog\Model\Product $subject, \closure $proceed) callable ...
Amit Bera's user avatar
  • 77.5k
1 vote
0 answers
23 views

Class instatiation with data

I have created custom Factory class for my custom model class. Of course basically you can instantiate it by calling $this->objectManager->create(Someobject::class);. But, ObjectManage has also ...
Bartosz Kubicki's user avatar
1 vote
0 answers
86 views

Can't able to set value for nested object param

Below one is my custom observer object, I need to get/set value of processor object { ["_quality":protected]=> int(10) /* 1st quality param.*/ ["_processor":protected]=> object(...
pauli bharathi's user avatar
0 votes
2 answers
2k views

Get all gallery images

I'm trying to pull through the gallery images on the product page because customizing the gallery with code: <?php $_product = $block->getProduct(); ?> <?php $gallery = $_product->...
drafiko's user avatar
  • 45
1 vote
1 answer
1k views

Magento 1.9 - Order object passed to event observer is empty

I am trying to get data from a new order placed on our website to use it for integration with our ERP/CRM system. I use the event sales_order_place_after and my observer function fires as expected, ...
AP Datum's user avatar
10 votes
2 answers
21k views

Magento2: How to convert JSON to Array of nested objects

I am wanting to understand if there are some functions in Magento Framework which will assist me in mapping an array of nested objects from JSON (such as what would happen when the REST API is ...
BAF's user avatar
  • 719
1 vote
1 answer
40 views

Magento 2 - Prohibits depends directly the ObjectManager, but all object can use factory object

As Magento prohibits depending on and directly using the ObjectManager, whether all object can use factory object to instantiate?
Liang's user avatar
  • 13
1 vote
1 answer
91 views

Duplicate codes sent to user - SELECT FOR UPDATE

Hi guys I am working an a site that sells electronic codes, the issue I am having is if two people order in the same few seconds they are BOTH sent the SAME codes. I need a way editing it so when the ...
KiwisTasteGood's user avatar
1 vote
1 answer
1k views

How to store value in object Magento 2

How do you change price in the frontend without affecting database. I have found the following code for it, but now I want to set my custom price in object. Magento\Framework\Pricing\Amount\Base ...
Ajay Patel's user avatar
  • 1,513
8 votes
2 answers
2k views

Plugins - is it bad habit to inherit from modified class in order to use protected properties

If I make plugin it is not neccessary to inherit from class I override. But, sometimes method I change uses properties that has protected access and they can't be used by plugin class. But if I ...
Bartosz Kubicki's user avatar
5 votes
1 answer
12k views

Magento2: Convert DataObject/Array into magento2 Collection?

How to convert the Data object into Magento2 Collection ? In Mage1 we could do as below.. Mage1: $collection = new Varien_Data_Collection(); foreach ($items as $item) { $...
Mohammad Mujassam's user avatar
0 votes
1 answer
2k views

Magento : how to get certain element value from array - object

below you can see the value genrate through print_r when i am trying get value of $post->PostContent() - return value is "post 1111111111111111Read More" but i want to get second value that is - "...
user3443146's user avatar
2 votes
1 answer
3k 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" ...
Blackpanther0001's user avatar
1 vote
1 answer
2k views

magento 2 how to get object from selected product (then get attributes)

When a product gets clicked on -> the product details page opens and shows detailed information and images of the product. I want to display (programmatically) some custom product attributes(which I ...
Blackpanther0001's user avatar
1 vote
0 answers
37 views

Proxy object - when should I use them in fact

I have yesterday read great tutorial about Proxy objects: http://alanstorm.com/magento_2_object_manager_proxy_objects/ I understand that I should use them to lazy load object which have can be slowly ...
Bartosz Kubicki's user avatar
3 votes
1 answer
100 views

How to learn about Magento objects

I recently started developing on magento2 and I'm finding a habitual problem always. When I start creating new extension or something, it's normal I will need M2 objects on my controller's ...
Marc Pont's user avatar
  • 1,453
3 votes
3 answers
997 views

Magento 2 Images from one .phtml to another .phtml

In a module I have installed I am trying to create a phtml page but can't work out how to pull through information(Like an image) to my new custom .phtml File containing information: view.phtml <...
Mark's user avatar
  • 755
3 votes
2 answers
7k views

Magento 2 get gallery images

I'm trying to pull through the gallery images on the product page as I'm re doing the gallery. The code I'm using is: <?php $_product = $block->getProduct(); ?> <?php $gallery = $_product-...
Mark's user avatar
  • 755
0 votes
1 answer
121 views

How to know what to write to pull through a product attribute Magento 2

Please excuse my ignorance as PHP 7 is completely new to me. The more and more I work with Magento 2 the more I'm understanding objects. But my question is: You have objects the their contents such ...
Mark's user avatar
  • 755
2 votes
1 answer
2k views

i need set flag in model save before event and get in model save after event in magento 2

I have Create two event model save before and after i get specific object and set flag in before model and get in after model. for example in before model public function execute(\Magento\...
Pratik's user avatar
  • 3,805
4 votes
2 answers
1k views

How does Magento model distinguish column names in its get/set Model methods?

Let's say I have a Model associated to a table with a column called title. I understand that I can do a $model->setTitle("Hello"); to set a value to this field. I can probably do the same for ...
xenon's user avatar
  • 895