Questions tagged [class]

A template for creating new objects that describes the common state(s) and behavior(s). NOT TO BE CONFUSED WITH CSS CLASSES. Use [css] instead.

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

Can't change Customer's Customer Tax Class

I have this weird problem where I can't change a customer's Customer Tax Class through the admin interface. It keeps jumping back to Retail customer. So when I select a different Customer Tax Class ...
0
votes
1answer
170 views

Extending Plugin Model - Magento + Wordpress

I haven't created a Magento module before and after a lot of research I attempted to create a module to insert wordpress avatars into blog posts inside Magento (I am using Fishpig). Below I will list ...
0
votes
0answers
447 views

How to Fetch Product child Function Outside External file in Magento

I want to fetch all child function of magento outside of it.I have CORE_PHP with some jquery functionality and php function,In that Files,I need to add Product Children Function of magento into that ...
0
votes
3answers
74 views

Problem modifying core function - class is not called

I apologize in advance for this question has been treated many times, but I think I just need a personal trainer on this! I am trying to modify the function sendPasswordResetConfirmationEmail in Mage/...
0
votes
1answer
723 views

Add category id to product item class

Is it possible to add the category ids of a product into the html class of the product item itself? For example: let's say I do have 3 categories, catID: 20, ID: 21 and ID: 22. For each product I ...
2
votes
2answers
2k views

How to remove body class from specific page?

I'm using an extension that adds a class name vnecoms-cp to the body of adminhtml pages. This is then used to style the pages using css. My problem is, this affects 1 specific page in a negative way. ...
1
vote
3answers
2k views

problems overriding 3rd party extension block class

the extension in question has the following structure: app code local MST Menupro Block Base.php Base.php has: class MST_Menupro_Block_Base extends Mage_Core_Block_Template { my custom ...
2
votes
1answer
2k views

Extending an abstract block class

I'm modifying getCountryHtmlSelect() through a custom class that extends another core class that extends Mage_Checkout_Block_Onepage_Abstract. Here's the class with the customized code: local/...
0
votes
1answer
208 views

Including a custom module model / block into template

I'm trying to follow this guide. But I want to add the template directly into the homepage using cms.xml, something like: <block type="trendingproducts/data" name="trending.products" template="...
1
vote
0answers
23 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 ...
15
votes
1answer
8k views

DI & Extending a Block on Magento 2

I seem to be struggling to grasp Magento 2 dependency injection with blocks, every time I try to extend a block that isn't \Magento\Framework\View\Element\Template I end up with errors. I want to ...
0
votes
1answer
676 views

Backend: Form Contains Abstract Method -> Fatal Error

I'm getting following error when I acces my form: Class MP_Search_Block_Adminhtml_Option_Edit_Tab_Form contains 1 abstract method and must therefore be declared abstract or implement the remaining ...
2
votes
2answers
2k views

lib class not found

I am loading a custom class from the lib folder and I'm getting the following error: Fatal error: Class 'NameSpace_MyClass' not found in /dir/to/site/app/code/local/NameSpace/Module/controllers/...
1
vote
1answer
239 views

Unable to call function within class of extension

I currently have some code on a product view page like: <?php $_product = $this->getProduct(); if (Mage::helper('core')->isModuleEnabled('Module_Name')): $exclImg = $_product->...
2
votes
1answer
224 views

Class inheritance question in magento (google analytics)

In a custom module I'm inserting universal analytics so I have to change a few functions from Ga.php file In Ga.php there is: class Mage_GoogleAnalytics_Block_Ga extends Mage_Core_Block_Template { //...
3
votes
2answers
683 views

Change $this to different block in related.phtml

I am working in related.phtml in app/design/frontend/[package]/default/template/catalog/product/list/. Here there is a foreach loop: <?php foreach($this->getItems() as $_item): ?> which loops ...
3
votes
0answers
108 views

Configurable Drop-down options in related products (related.phtml) - error Call to a member function getSortedChildren() on a non-object [duplicate]

I am trying to give the related products on each product page, the ability to show the drop-down options of configurable products; so that the user can select options and add to basket without ...
0
votes
2answers
1k views

How do add a class to the Wishlist Link in the Top Menu?

I want to add a class to the wishlist link in the top menu. In my app/design/frontend/default/abcd/layout/wishlist.xml, I have a reference: <reference name="top.links"> <block type="...
0
votes
1answer
654 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 ...
1
vote
1answer
177 views

model rewrite not working in admin side [closed]

i have rewritten fedex.php model file(collect rates method only). its working in front end cart and checkout pages. But its not working in admin side order creation.Can you help any one? update: ...
0
votes
2answers
2k views

Magento_Db_Adapter_Pdo_Mysql not found in Resource.php

Firstly, I have little knowledge of the workings of Magento as I'm mainly a WordPress developer so please be gentle. I have been tasked with moving an existing Magento install onto a VPS. The VPS is ...
1
vote
3answers
1k views

Product Page - Add Span Class - Price Symbol

I wish to add a simple span class on the product view page for the price. <span class="price-symbol">$</span> <span class="price">$99.90</span>
9
votes
3answers
579 views

What (type of) classes are generated in Magento 2?

In Magento 2 there are a set of classes that are generated automatically and stored in var/generation and they are used in the core code. While trying to create a custom module by replicating one of ...
2
votes
3answers
20k views

How do you change the number of product columns?

I want to change the number of products that are shown. But I don't want to hard code this into the theme. This: <ul class=​"products-grid products-grid--max-4-col first last odd">​…​</ul&...
2
votes
1answer
893 views

500 Internal Server Error in store page

I recently updated my Magento from 1.4 to 1.9 and faced with the issue: it gives HTTP-header 500 Internal Server Error, but all the content is still loading (so just instead 200 OK I have 500 Internal ...
1
vote
2answers
39 views

Should custom Magento code always be a module, regardless of size

As a Magento newbie, I'm still trying to learn the good and the bad when it comes to developing for Magento. I need to write a class, that in Yii I would just create a class in the 'vendors' ...
7
votes
2answers
570 views

Where helper aliases of some of core modules defined?

This confuses me a bit. I wonder why I didn't notice it before. When I look for helper definition of Mage_Sales core module, it surprised me that, I couldn't find helper defintion there. This confuses ...
2
votes
0answers
130 views

How to add a class to an attribute group? [closed]

hi this is the js code where magento generates new groups in admin: addGroup : function() { var group_name = prompt("<?php echo Mage::helper('catalog')->__('Please ...
1
vote
1answer
438 views

how do i extend a magento class from core?

I know that it is not safe to modify the core, so i want to extend a class. My need is to add a new button. In the image below you can see where: So, I created a module for that. I think the idea is ...
1
vote
3answers
4k views

Fatal error: Class 'Zend_Cache' not found /app/code/core/Mage/Core/Model/Cache.php

Does anyone know why this kind of messages appear? It seems like my Magento installation does not fully load all Zend classes, although they are there on a proper place with proper file permissions. ...
3
votes
2answers
178 views

Why separately placing methods in interface instead of abstract class?

I want to delete Interface Mage_Shipping_Model_Carrier_Interface. interface Mage_Shipping_Model_Carrier_Interface { /** * Check if carrier has shipping tracking option available * ...
1
vote
1answer
4k views

Magento Including External library

I have tried Joreon Vermeulen's method https://stackoverflow.com/questions/6417394/how-to-add-a-3rd-party-library-to-magento to autoload classes but to no avail. Now in my custom autoloader I get the ...
7
votes
1answer
7k views

Usage of getsingleton() and getModel()

Is there a set of guidelines that I can go by to decide when I should use mage::getModel() and mage::getSingleton() From what I can tell it seems as though getSingleton either gets an existing ...
2
votes
1answer
180 views

Identical Code in Block Class Overload has Different Results

The following code samples are long, but here is the issue: If I create a custom file /app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php and add two new columns to the product grid, it ...
3
votes
1answer
6k views

Want to rewrite core Helper class (Mage::helper('core'))

i want rewrite magento helper core class Mage_Core_Helper_Data. I have try below code, but it is not working <?xml version="1.0" ?> <config> <global> ... &...
3
votes
2answers
3k views

Magento collection classes confusion

I confused by following collection classes $orders = Mage::getResourceModel('sales/order_item_collection'); $orders = Mage::getResourceModel('sales/order'); $orders = Mage::getResourceModel('sales/...
2
votes
1answer
1k views

Fatal error: Class 'Altima_Lookbook_Helper_Data' not found in /home/offerbea/public_html/app/Mage.php on line 547

I have installed it from magento connect, and now in my back-end it displayed as it. Please somebody help me how to fix it. I gues it causing by i was put the compliation mode in on. Thank you
2
votes
4answers
2k views

How to call Mage_Page_Block_Html_Pager class in list.phtml

I am wanting to include a larger than normal 'next page' type button in the list.phtml template whilst still having the normal pagination from pager.phtml The function I'm wanting to use is found in ...
0
votes
2answers
154 views

Model Class Fallthrough

I created a new model class called Company_CatalogSearch_Model_System_Config_ListSort which I used to create a copy of the Product Listing Sort By option from the catalog module, just for the ...
3
votes
1answer
1k views

How are magento lib files loaded - Sage lib class not being accessed by model

On a mage site using sagepay, inside the Sagepaysuite model there is a call to a class file: Ebizmarts/SagePaySuite/Model/Api/Payment.php $xml = new Ebizmarts_Simplexml_Element('<customer />...
4
votes
2answers
1k views

Rewrite single method using local class

I need to override Varien class because I need to change one method. app/code/core/Varien/Data/Collection/Db.php From what I know, the only way is to put it inside local folder. app/code/local/...
2
votes
0answers
189 views

Adding to Magento Category Menu Fails [closed]

we're working with a class which should be placing groups and pages into the top menu of our magento shop, however it doesn't seem to be functioning. From what I can see first the observer is ...
3
votes
3answers
159 views

Name for Magento 'pseudo' constructor

I understand why and how Magento uses the secondary/pseudo constructor e.g. the constructor that begins with a single underscore. Is there a specific name for this method: pseudo constructor ...
1
vote
1answer
341 views

ColumnCount on frontpage doesn't work

I'm trying to add the class "first" and "last" to my categories on the frontpage, but it only adds the "first" class - AND to all of the list items. Can someone please help me with this? My .phtml ...
0
votes
1answer
91 views

Access a class's method

I am trying to access a class's method using Mage::getSingleton() I have done the following: <?php $allReviews = Mage::getSingleton('efkreports/product_allReviews')->getAllProductReviews(); ?&...
0
votes
2answers
164 views

Why is magento missing a type class for bundle products?

I am looking at a section of code that uses this: if ($_item->getProduct()->getTypeId() === Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) to determine whether a product is ...
0
votes
1answer
121 views

What type of Inheritance is better for customizing code?

I am trying to customize the catalog and sales/order grids in magento. There are 3 ways I know, by which I can implement by custom logic on these grids: Multilevel inheritance for example ...
0
votes
1answer
1k views

Is multiple inheritance allowed in Magento?

When go through the core source, I figured out that some classes have been extended by many child classes. Eg: class Mage_Sales_Model_Quote_Address_Total_Grand extends ...
0
votes
1answer
6k views

Get best selling or hot selling products list

I am new to PHP. I am trying to get best selling products list using the code which I found in Mage_Adminhtml_Block_Dashboard_Tab_Products_Ordered class from _prepareCollection method. if ($this->...
2
votes
2answers
2k views

Calling Grandparent Class in magento class inheritance

UPDATE: This issue was finally tracked down as a class inheritance issue. The original code in class becomes invalid, due to fact that the class inheritance has been updated, and the 'parent::parent' ...

1 2 3