Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [programming]

The tag has no usage guidance.

1
vote
0answers
33 views

Magento2 - how to automatically create UpgradeData, UpgradeSchema based on existing table(s)

Who knows is there any tools, modules or whatever to convert existing table dump and structure into UpgradeData, UpgradeSchema? Why? For example you created complicated settings stored in DB and you ...
2
votes
1answer
173 views

Pass multiple variables to view

We can pass a variable to a .phtml view file like this: $currentTime = date("H:i", time()); $someValue = 123; $this->loadLayout(); $this->getLayout() ->getBlock('newsletter_popup') ...
0
votes
0answers
37 views

Magento 2: Adding Products to Top Navigation

We have a client who wishes for the top navigation bar to show the products that each toplevel category contains as the child menu items. I've done a lot of Googling but haven't been able to find ...
1
vote
2answers
284 views

How write a Magento 2 standard Model class

I have create database table and want to create model,resource,Collection class and know that how to create. Have follow the blog https://www.softprodigy.com/store/article/create-model-and-...
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
1answer
152 views

Using variables in Category Title. Meta and descriptions - e.g. product count

is there an easy way to make certain variables available in the field for: category title, category description or category meta? Suppose we want to make our category title "{COUNT}+ Brand name ...
0
votes
1answer
17 views

dynamic display php javascript

I am looking at a couple different e-Commerce solutions. One is WooCommerce and Magento is the other. The website I want to develop would access a database of cities, flights, tourist itineraries, and ...
4
votes
2answers
2k views

What is good practise for getting resource/collection models?

Which one is more correct: Mage::getResourceModel() or Mage::getModel('catalog/product')->getCollection() I always use the first method unless I already have a model that I can call the ...
0
votes
1answer
35 views

Observer with no effect

Login to the website frontend in a customer account. Click on "Account information" and edit some information (firstname, lastname, ...). Click on the save button. Now login to the magento backend and ...
1
vote
2answers
41 views

Help writing an observer the “Magento Way”

Fairly new to objected oriented programming and very new to Magento programming, but trying to learn the "right way". I'm writing a before save observer to update product attributes based on other ...
0
votes
0answers
121 views

Get product name from store not from admin

I am working on product collection query which is filtered from different root categories. My products are coming correctly but my product name is coming from admin section not from store section. $...
1
vote
1answer
167 views

Load with addWebsiteFilter not working

I am working on product collection. Here is my query: $_product = Mage::getModel('catalog/product')->addWebsiteFilter($allWebsiteIds)->load($productid); But this is not working. As reference ...
0
votes
2answers
402 views

Programatically get product collection which are exists in array of categry ids

I am working on magento product collection query. My requirement to fetch products which are present in array of category. Example: $all_selected_categories = array('15','35','48','75'); Above ...
0
votes
1answer
27 views

Why magento not provide facility of add product for a store view

I am working on multi store functionality and stuck in a problem for managing products. My requirement is just around for store views products that's why sending this post. I just want to know, why ...
3
votes
2answers
2k views

Cannot checkout error. Please agree to all the terms and conditions before placing the order

Hi we recently saw this error on Magento 1.9.0.1. And no idea why. And especially where to look on how to debug. T&C haas been enabled in backend. And 1 agreement was set (ID=1). It does not ...
0
votes
1answer
2k views

Intermittent 'Cannot create an empty shipment.' when bulk processing shipments

We have an intermittent 'Cannot create an empty shipment.' when bulk processing shipments. Used the API before. This controller is triggered with bulk selected orders in order overview. It ships all ...
1
vote
1answer
21k views

Javascript - Can't get 'getElementsByClassName' working

Im struggling to figure out why my code is not working. Here is part of the JS: function init() { var showMenu = document.getElementsByClassName('showMenu'), perspectiveWrapper = document....
3
votes
1answer
108 views

How to enable interruptable downloads on downloadable products?

I have a downloadable product store. My problem is that some of my files range over 1GB which is quite often, too large to download in one sitting. I want my customers to be able to pause their ...
1
vote
1answer
66 views

Tab view on landingpage?

On the product lasting pages there is the tab view. Is it possible to create custom tabs on landingpages? A bit like this https://www.decalgirl.com/custom/cases - this is not my page, just like the ...
3
votes
2answers
2k views

Advanced level learning for Magento [closed]

The main question would be, how do you people get advanced understating of core Magento? In particular there are a few subjects that preoccupy me the most: Cart/payment/checkout process. Quote/order ...
0
votes
1answer
1k views

How to only show cms block in phtml file on homepage

we need to show cms block in footer of homepage only our block is called footer_partners We tried both <?php $ref = new Mage_Page_Block_Html_Header(); if($ref->getIsHomePage()): ?> <div ...
3
votes
2answers
113 views

How i can clean cache programmatically for only one store?

How i can clean cache programmatically for only one store ? and refresh index for only one store ?
1
vote
1answer
1k views

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e.Featured’ in ‘where clause’

HI All Respected Magento Devs, I was customizing my magento website after theme installation and i am not sure how it could happened but my site stopped working due to this below error. strangely my ...
0
votes
1answer
195 views

How to have “My Cart” in banner7.phtml? how to show everything same like in header My cart

i have installed magento 1.8.1 and i want to show My Cart right after banner section. i am placing the code in banner.phtml file and it seems working but problem is that it is not showing cart items ...
1
vote
1answer
109 views

Find The Declaration of a Block

I've written a function that uses debug_backtrace() to find which methods were called in which PHP files to eventually load a given Block. (Look for the blockBacktrace method in the Helper class here.)...
4
votes
1answer
4k views

Show tracking link for custom shipping method

We defined a custom shipping method by extending Mage_Shipping_Model_Carrier_Abstract. There is a method public function isTrackingAvailable() { return true; } But after we enter a tracking ...
4
votes
1answer
1k views

PayPal Ipn model and automatically order state changes

First of all i will explain you about the actuall functionality: Customer buys in shop via PayPal Shop operators call the order from an external software (WaWi; don't know in en) and the software ...
1
vote
1answer
133 views

wishlist not getting?

Hi i am using below code for wishlist but i not getting below result. $customer = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*'); $wishList = Mage::getModel('...
0
votes
1answer
4k views

Programmatically reordering

I'm trying to create a new order, based on an old order. $orig_order = Mage::getModel('sales/order')->load((int)$order_id); $order_model = Mage::getSingleton('adminhtml/sales_order_create')...
3
votes
2answers
3k views

Programmatically Set/Change Thumbnail Image To Another From Gallery

I have a huge catalog of products which all have about 4 images per product with the same naming structure being something like "xxxxxx_FR.jpg" "xxxxxx_BK.jpg" "xxxxxx_FL.jpg" where the x's represent ...
17
votes
3answers
16k views

Importing orders from a CSV into Magento programmatically

We're switching from an old, outdated point-of-sale system to using Magento 1.7 as our POS exclusively. Not unexpectedly, one of the challenges we're facing is how to get almost 20 years of records ...
7
votes
3answers
18k views

How do I get a website id from a store id?

Given a store id, how do I get the website id that matches that store?
1
vote
2answers
5k views

How to get pricing_value for Super Attribute Option

Somehow I can't figure out how to get the pricing values for a configurable product's super attribute options. Currently I have an array of attribute id and attribute option id which looks like this:...
0
votes
3answers
8k views

Payment not saving in quote when creating order programmatically

I have a current script that uses a mishmash of pure Magento methods and the API. I'm trying to convert it all to straight Magento methods, but I'm having an issue to get the payment method to stay. ...
1
vote
1answer
5k views

Convert attribute type from Text to Dropdown

How can I convert a product attribute type from Text to Select in the Magento Backend. Is there any in-built functionality or we need to write custom code for that? I already have attribute values ...
1
vote
1answer
699 views

How do you set Allow Countries directly in the database, programmatically or using n98-magerun?

I have a list of over 200 countries I need to allow for an EE 1.13 site. I'd prefer not to do this through the admin interface because it is tedious and I am error prone. Is it possible to set Allow ...
1
vote
1answer
13k views

How to filter product collection by attribute's admin option values?

I am currently developing a product configurator. I am submitting a form which sends the admin option values of my custom attributes via POST to a controller action. If I use the current store's ...
0
votes
1answer
583 views

addFieldToFilter doesn't return the right product for selected attribute values

I am currently programming a product configurator module for Magento. Everything is working fine so far besides the core functionality: choosing the right product from the database for the selected ...
0
votes
1answer
712 views

Obtain value from attribute frontend property

We would like to use the values from the Magento attribute frontend properties 'Use in Quick Search' and 'Use in Advanced Search'. We have changed the properties translations to 'Show for wholesale ...
7
votes
1answer
16k views

Magento + JQuery + Ajax - How do I reload just parts of my custom Module instead of the whole Block?

I was just recently given the task to create a simple Product configurator for our Magento Template in 5 days, where you can choose some attributes and it calculates the price for you, fades over a ...
2
votes
1answer
1k views

Class calling another class

I am new in PHP as well as in Magento. I have some questions regarding factory methods and fundamental of PHP of OOPS. As if we want to call a method in php we instating the class and we call a ...
10
votes
1answer
2k views

“Gang of Four” Design Patterns in Magento Core

There are a few very obvious patterns in use in Magento's core, such as: Singleton Registry Event/Observer Factory Model/View/Controller But there are others that may be in use in Magento that I'm ...
1
vote
2answers
8k views

Programmatically Converting Currency

I am trying to convert currency in Magento 1.5 using the following code in a separate file to check currency conversion. I have two stores with respective currency settings in the admin. ...
3
votes
2answers
2k views

getFinalPrice() on associated simple product returns base price not parent product special price

I have 2 products one is configurable and has a special price of 100 and the associated product has no special price assigned and Final Price is not being returned on the associated product. I am ...
15
votes
2answers
14k views

How to Programmatically set a Product's Multi-Select Attribute by Labels

If have a multiselect attribute and want to set the selection on a product. $selectedOptions = "red,green,blue"; $product->..... // # what to do? How can I do that?
0
votes
1answer
1k views

How to get Discount Percent

I am looking for a way to get the discount percent of an order, possibly from the order class or the invoice class, it would be amazing if $order->getDiscountPercent(); worked, but it doesn't, ...
0
votes
1answer
3k views

admin sales order total shipment empty

I recently have the problem that the yellow block with the total order on the bottom right of the sale order info page stays empty. I looked into the files and found out that in /app/design/adminhtml/...
4
votes
1answer
181 views

Can't find callbackFunction

I've been looking all over the place and I can't find what this is: updateCallback : function(elm, status) { if (typeof elm.callbackFunction != 'undefined') { eval(elm.callbackFunction+'(\...
2
votes
1answer
1k views

create bundle order programmatically

I have this code: http://pastebin.com/iFwyKM7G Inside an event-observer class which executes after the customer registered. It creates an order automatically and it works for simple products. ...
5
votes
3answers
4k views

Get new empty item on model method

Collections provide a handy means of getting a blank model - e.g.: $quote->getItemsCollection()->getNewEmptyItem(); Is there any means of doing this from an existing model without having to ...